Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
EclipseLink/Development/Testing/DBWS
< EclipseLink | Development | Testing
Revision as of 13:14, 23 March 2009 by Unnamed Poltroon (Talk)
Summary
DBWS has a number of test suites, all written using JUnit4. This page outlines the various testsuites and the types of testing in each suite.
DBWS core tests
In the SVN repository under the DBWS component's high-level directory, there is a project eclipselink.dbws.test
:
Eclipselink Tree
\---trunk
| about.html
| ...
|
+---dbws
| +---eclipselink.dbws.test
| | | .classpath
| | | .project
| | | build.properties
| | | build.xml
| | |
| | +---etc
| | | dbsetup_keymappings.sql
| | | dbsetup_relationships.sql
| | | dbteardown_keymappings.sql
| | | dbteardown_relationships.sql
| | |
| | \---src
| | \---dbws
| | \---testing
| | | DBWSTestHelper.java
| | | RootHelper.java
| | |
| | +---keymappings
| | | KeyMappingsTestSuite.java
| | |
| | \---relationships
| | RelationshipsAddress.java
| | RelationshipsEmployee.java
| | RelationshipsPhone.java
| | RelationshipsTestSuite.java
\---trunk
| about.html
| ...
|
+---dbws
| +---eclipselink.dbws.test
| | | .classpath
| | | .project
| | | build.properties
| | | build.xml
| | |
| | +---etc
| | | dbsetup_keymappings.sql
| | | dbsetup_relationships.sql
| | | dbteardown_keymappings.sql
| | | dbteardown_relationships.sql
| | |
| | \---src
| | \---dbws
| | \---testing
| | | DBWSTestHelper.java
| | | RootHelper.java
| | |
| | +---keymappings
| | | KeyMappingsTestSuite.java
| | |
| | \---relationships
| | RelationshipsAddress.java
| | RelationshipsEmployee.java
| | RelationshipsPhone.java
| | RelationshipsTestSuite.java
The setup required to run these tests is running the appropriately named dbsetup_xxx.sql
script
(and conversely dbteardown_xxx.sql
- where xxx
= keymappings
or relationships
).
The test code is in the (related) xxxTestSuite class - let's look at KeyMappingsTestSuite
:
public class KeyMappingsTestSuite { static final String KEYMAPPINGS_SCHEMA = "<?xml version='1.0' encoding='UTF-8'?>" + "<xsd:schema targetNamespace=\"urn:keymappings\" xmlns=\"urn:keymappings\" elementFormDefault=\"qualified\"\n" + "xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"\n" + ">\n" + "<xsd:complexType name=\"phone\">\n" + "<xsd:sequence>\n" + "<xsd:element name=\"area-code\" type=\"xsd:string\" />\n" + "<xsd:element name=\"phone-number\" type=\"xsd:string\" />\n" + "<xsd:element name=\"type\" type=\"xsd:string\" />\n" + "</xsd:sequence>\n" + "<xsd:attribute name=\"phone-id\" type=\"xsd:int\" use=\"required\" />\n" + "<xsd:attribute name=\"owner-ref-id\" type=\"xsd:int\" use=\"required\" />\n" + "</xsd:complexType>\n" + ...