Java Doc for QueryTest.java in  » J2EE » Jaffa » org » jaffa » persistence » blackboxtests » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » J2EE » Jaffa » org.jaffa.persistence.blackboxtests 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.jaffa.persistence.blackboxtests.QueryTest

QueryTest
public class QueryTest extends TestCase (Code)
Tests for performing queries through the Jaffa Persistence Engine.
author:
   GautamJ



Constructor Summary
public  QueryTest(String name)
    

Method Summary
protected  voidsetUp()
     Sets up the fixture, by creating the UOW.
protected  voidtearDown()
     Tears down the fixture, by closing the UOW.
public  voidtestBasicQuery()
    
public  voidtestDateTimeQuery()
    
public  voidtestDualFieldQuery()
    
public  voidtestInnerJoinQuery()
    
public  voidtestLongQuery()
    
public  voidtestNestedInnerJoinQuery()
    
public  voidtestOrAndQuery()
    
public  voidtestQueryWithEscapeCharacters()
     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.
public  voidtestTwoInnerJoinsQuery()
    


Constructor Detail
QueryTest
public QueryTest(String name)(Code)
Creates new QueryTest
Parameters:
  name - The name of the test case.




Method Detail
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



www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.