| |
|
| org.jaffa.persistence.blackboxtests.QueryTest
QueryTest | public class QueryTest extends TestCase (Code) | | Tests for performing queries through the Jaffa Persistence Engine.
author: GautamJ |
QueryTest | public QueryTest(String name)(Code) | | Creates new QueryTest
Parameters: name - The name of the test case. |
setUp | protected void setUp()(Code) | | Sets up the fixture, by creating the UOW. This method is called before a test is executed.
|
tearDown | protected void tearDown()(Code) | | Tears down the fixture, by closing the UOW. This method is called after a test is executed.
|
testBasicQuery | public void testBasicQuery()(Code) | | Tests the sql:
Select * from item where item_id like 'Z-TEST%'
and condition like '%TESTSYCD%'
and part = 'Z-TESTPART-01’
and sc is not null
and qty > 1 and qty < 3
and key_ref like '%TEST-KEY-REF'
order by item_id
This should return 3 item records
|
testDateTimeQuery | public void testDateTimeQuery()(Code) | | Tests the sql:
Select * from item Where
created_datetime = to_date('2003-09-10 20:30:40', 'yyyy-MM-dd hh24:mi:ss')
or created_datetime = to_date('2003-09-10', 'yyyy-MM-dd')
or created_datetime is null
order by item_id
This should return 3 item records
|
testDualFieldQuery | public void testDualFieldQuery()(Code) | | Tests the sql:
Select * from item where item_id = received_item_id
and status_2 != status_3
and item_id >= 'Z-TESTITEM-01'
and item_id <= 'Z-TESTITEM-02'
order by item_id desc
This should return 2 item records
|
testInnerJoinQuery | public void testInnerJoinQuery()(Code) | | Tests the sql:
Select * from item Where exists
(select 1 from cat1 Where cat1.part = item.part and cat1.noun = 'Z-TESTNOUN%')
order by item_id
This should return 3 item records
|
testLongQuery | public void testLongQuery()(Code) | | Tests the sql:
Select * from catz where part='Z-TESTPART-01'
This should return 1 catz record
|
testNestedInnerJoinQuery | public void testNestedInnerJoinQuery()(Code) | | Tests the sql:
Select * from item Where condition = 'Z-TESTSYCD-01'
and exists (select 1 from cat1 Where cat1.part = item.part
and exists(select 1 from syci where syci.category_instrument = cat1.category_instrument
and category_instrument like 'Z%' and support_equip_b='T') )
order by item_id
This should return 3 item records
|
testOrAndQuery | public void testOrAndQuery()(Code) | | Tests the sql:
Select * from item Where
( (status_1 is null or status_2 is null or status_3 = 'A') and condition like 'Z-TESTSYCD%' )
or (item_id like 'Z-TESTITEM%')
order by item_id
This should return 3 item records
|
testQueryWithEscapeCharacters | public void testQueryWithEscapeCharacters()(Code) | | Creates 2 ZZ_JUT_INSTRUMENT records with the prefix 'Z-|%_'
It then Tests the sql:
Select * from ZZ_JUT_INSTRUMENT where CategoryInstrument like 'Z-|||%|_%' escape '|'
This should return 2 ZZ_JUT_INSTRUMENT records.
The records are then deleted.
|
testTwoInnerJoinsQuery | public void testTwoInnerJoinsQuery()(Code) | | Tests the sql:
Select * from item
and exists (select 1 from cat1 Where cat1.part = item.part and cat1.noun = 'Z-TESTNOUN%')
and exists (select 1 from sycd where sycd.condition = item.condition and description like 'Z%')
order by item_id
This should return 3 item records
|
|
|
|