net.sourceforge.sqlunit.handlers

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 » Testing » sqlunit » net.sourceforge.sqlunit.handlers 
net.sourceforge.sqlunit.handlers
Handler implementations for SQLUnit. The SQLUnit package is designed as a set of individual XML handlers for the various elements of the SQLUnit test suite authoring XML. There is a one to one correspondence between the SQLUnit element and the SQLUnit handler class as illustrated in the table below:
XML Element SQLUnit Handler Class
sqlunit
  • connection
  • setup
    • sql
    • include
  • test
    • prepare
    • sql or call
    • result
  • teardown
    • sql
    • include
 
  • net.sourceforge.sqlunit.ConnectionHandler
  • net.sourceforge.sqlunit.SetupHandler
    • net.sourceforge.sqlunit.SqlHandler
    • net.sourceforge.sqlunit.IncludeHandler
  • net.sourceforge.sqlunit.TestHandler
    • net.sourceforge.sqlunit.PrepareHandler
    • net.sourceforge.sqlunit.SqlHandler|CallHandler
    • net.sourceforge.sqlunit.ResultHandler
  • net.sourceforge.sqlunit.TeardownHandler
    • net.sourceforge.sqlunit.SqlHandler
    • net.sourceforge.sqlunit.IncludeHandler

Each handler class reads the JDOM element and extracts the information to pass back to the SQLUnit class. The SQLUnit class is designed as a JUnit test class. The JUnit class contains a single test method called testWrapper() which is responsible for reading the XML file and carrying out the operations specified in the setup element, followed by each test in sequence, followed by the operations in the teardown element. The ConnectionHandler class is called before all the other operations to get a JDBC connection to the database.

All handler classes implement the IHandler interface, which specifies a single process method which takes a JDOM Element org.jdom.Element and a java.sql.Connection object and returns a java.lang.Object. A given handler implementation may not need to return an Object, in which case it must return null. The HandlerFactory uses the handlers.properties Java properties file to instantiate the appropriate instance of a handler given the JDOM Element name.

Apart from the handlers, there are some auxilliary classes that provide utilities to the handlers. The SymbolTable class is a container of variables that are declared within an SQLUnit test script. The DatabaseResult object is a HashMap of fields and values returned from processing a SQL statement or stored procedure, or parsed out of a SQLUnit result element. The key for this HashMap is a DatabaseResultKey which is really a tuple of (resultsetId, rowId, colId) for each column returned by a SQL statement or stored procedure specified by the SQLUnit sql or call elements and parsed out of the SQLUnit result element. The SqlTypeUtils class is responsible for converting between database type to String and back, depending on the method called.

The SQLUnitException class is a common class that is shared by the SQLUnit package. The content of the SQLUnitException error messages is handled by specifying constant Strings in the IErrorCodes interface class.

Java Source File NameTypeComment
ArgHandler.javaClass The ArgHandler takes the JDOM Element representing the arg tag and converts it to a Arg object.
BatchCallHandler.javaClass The BatchCallHandler class processes the contents of a batchcall tag in the input XML file.
BatchResultHandler.javaClass The BatchResultHandler class processes the contents of a batchresult tag in the input XML file.
BatchSqlHandler.javaClass The BatchSqlHandler class processes the contents of a batchsql tag in the input XML file.
BatchTestHandler.javaClass The BatchTestHandler allows the grouping of a number of Stored Procedure calls and/or SQL statements and a number of expected results from these. The whole group is executed within a single transactional context, so a failure in one of the SQL statements will roll back the entire test to the point before it was called.
CallHandler.javaClass The CallHandler class processes the contents of a call tag in the input XML file.
CategoryHandler.javaClass The CategoryHandler processes the contents of a Category tag in the input SQLUnit XML file.
ClassifiersHandler.javaClass The ClassifiersHandler processes a JDOM Element representing the classifiers element.
ColHandler.javaClass The ColHandler processes a JDOM Col element and returns a Col bean.
ConnectionHandler.javaClass The ConnectionHandler class creates a JDBC connection object given its parameters in the form of a JDOM Element.
ConstructorArgsHandler.javaClass The ConstructorArgsHandler parses the JDOM Element constructorArgs and processes it to return an array of Arg objects.
DiffHandler.javaClass The DiffHandler compares result sets from two different SQL statements or stored procedure calls.
DynamicSqlHandler.javaClass The DynamicSqlHandler class processes the contents of an dynamicSql tag in the input XML file.
EchoHandler.javaClass Writes an INFO trace to the log file.
ExceptionHandler.javaClass The Exception Handler parses a JDOM Element representing an exception tag and returns an ExceptionBean object.
FieldHandler.javaClass Handles a field element, child of a struct element.
ForeachHandler.javaClass This class implements the handling of the foreach element.
FuncDefHandler.javaClass The FuncDefHandler processes a Function Definition JDOM Element.
FuncHandler.javaClass The FuncHandler looks up the named definition from the symbol table and runs it after resolving the query, then returns a result.
IncludeHandler.javaClass The IncludeHandler reads and executes SQL statements specified in a included file.
JndiHandler.javaClass The JndiHandler parses the JDOM Element methodArgs and processes it to return an array of Arg objects.
MatchHandler.javaClass The ResultHandler class parses the XML representing the result object.
MethodArgsHandler.javaClass The MethodArgsHandler parses the JDOM Element methodArgs and processes it to return an array of Arg objects.
MethodInvokerHandler.javaClass The MethodInvokerHandler class processes the contents of an methodInvoker tag in the input XML file.
OutParamHandler.javaClass The OutParamHandler takes the JDOM Element representing the outparam tag and converts it to a OutParam object.
ParamHandler.javaClass The ParamHandler takes the JDOM Element representing the param tag and converts it to a Param object.
ParamSetHandler.javaClass The ParamSetHandler takes the JDOM Element representing the paramset tag and converts it to an array of Param objects.
PrepareHandler.javaClass The PrepareHandler class takes care of setting up data within a test block.
ResultHandler.javaClass The ResultHandler class parses the XML representing the result object.
ResultSetHandler.javaClass The ResultSetHandler processes a JDOM ResultSet element and returns a ResultSet bean.
RowHandler.javaClass The RowHandler processes a JDOM Row element and returns a Row bean.
SetHandler.javaClass The SetHandler allows setting variables into the Symbol table.
SetupHandler.javaClass The SetupHandler class handles the setup tag of the XML input file.
SeverityHandler.javaClass The SeverityHandler processes the contents of the Severity tag in the input XML file.
SkipHandler.javaClass The SkipHandler class processes the contents of a Skip tag in the input SQLUnit XML file.
SqlHandler.javaClass The SqlHandler class processes the contents of an sql tag in the input XML file.
StructHandler.javaClass Handles a struct element.
SubDefHandler.javaClass The SubDefHandler processes a JDOM Element representing a subroutine definition.
SubHandler.javaClass The SubHandler is called from within the sub tag.
SubParamHandler.javaClass The SubParamHandler takes the JDOM Element representing a subparam tag and converts it to a SubParam object.
TeardownHandler.javaClass The TeardownHandler class handles the instructions in the teardown tag of the XML input file.
TestHandler.javaClass The TestHandler class is responsible for executing a single test specified by the contents of the test tag in the input XML file.
TypeDefHandler.javaClass Handles a typedef element, child of a typemap element.
TypeMapHandler.javaClass Handles a typemap element, child of a typemap element.
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.