The JSR 235 TCK is a suite of test cases designed to provide a comprehensive analysis of an SDO implementation as compared with the JSR 235 SDO specification. These test cases are executed and analyzed through the use of the JUnit testing framework. The JSR 235 TCK Test Harness is an ANT build script that provides compilation, packaging and test execution services for the JSR 235 TCK.
The JSR 235 TCK requires a set of commonly used open source tools for compilation and execution.
.Java 5
.JUnit 4.1 (http://www.junit.org/)
.XMLUnit 1.1 or higher (http://xmlunit.sourceforge.net/)
.Apache ANT version 1.7 or higher (http://ant.apache.org/)
.Apache XMLSchema version 1.2 or higher (http://ws.apache.org/commons/XmlSchema/)
Install and configure ANT appropriately for your development platform. The other three tools’ jar files may be placed in the \tck\lib directory. From there, they will be picked up during the ANT script execution.
The JSR 235 TCK has been designed to be used by all JSR 235 specification compliant implementations. With that in mind a mechanism was needed to provide implementation specific resources not available through the standard SDO API. The RuntimeHelper interface provides this mechanism. Before an implementation can be tested with the TCK, you will need to create/enhance a class that implements the RuntimeHelper interface. The RuntimeHelper interface can be found in the commonj.sdo.impl.RuntimeHelper.java file.
The test harness will compile the TCK, package the results into a Jar file and then execute the test cases. Below is a sequence of events needed to unpack and execute the TCK.
1.A test location needs to be identified and a directory created.
a.Create a new directory (for example ‘.\tck’)
b.Unzip the jsr235tck.zip file into this new directory.
2.Create an implementation specific JUnit test suite. See com.ibm.sdo.tck.framework.ImplTestSuiteExample.java.
3.Customize the jsr235tckProperties.xml file to match your system configuration.
a.The <testsuite> value should be set to your implementation’s top level test suite (this is the class you’ve customized in step #2.
b.Provide the location where all implementation specific jar files are located using the <lib> tag.
4.Verify required tools are available for test harness execution.
a.See TCK Dependencies above.
5.Perform the test harness execute target.
a.Using ANT syntax ‘ant –f jsr235tckBuild.xml execute’
b.This target will call multiple internal targets to compile and package the tck, and then execute the implementation specific test suite.
c.The results of the execution are stored in the \results directory in the result.xml file.
6.As needed, perform execution clean target.
a.This target will clean out the results of the execute target. It deletes the \results directory and targeted contents of the \lib directory.
The SDO specification does not define the means by which implementations must generate static SDO classes. Because of this limitation, The TCK tests statically generated code based on the assumption that the implementers have added their generated code to their test harness classpath prior to invoking the TCK. Adding these generated classes to the classpath will hide the generated interfaces that are included in the TCK. The TCK will report an error if it finds it is using the TCK provided interfaces. Adding the generated classes to the TCK classpath is accomplished as follows:
1.Execute implementation’s static generator against the src/main/resources/staticTest/simple.xsd schema.
2.After execution the following set of interfaces (at a minimum) should have been created:
a.com.ibm.sdo.tck.staticTest/ComplexType1.java
b.com.ibm.sdo.tck.staticTest/CT2.java
3.Take all the generated artifacts and package them into a jar file.
4.Place the new jar into the directory identified in the jsr235tckProperties.xml file by the <lib> tag.
The SDO implementer’s test harness must also ensure that the SDO Types associated with the generated classes are defined within a HelperContext instance. This requires the implementer to provide an implementation of the RuntimeHelper.defineStaticTypes() method in its test harness' implementation of the RuntimeHelper interface. The method call is provided with the HelperContext instance, the namespace of the schema that describes the required classes and a location hint in the form of a path indicating where the schema file may be found. This method should be called once per namespace prior to each test that requires static classes.
.Fixed instance class for AnnotationsTest to handle round-tripping when the implementation does set/get via serialized form.
.Changed EqualityTest utility so that DataObject Type equality doesn't require the same instance of Type.
.Modified test data creation to avoid differences in implementations concerning rendering of decimal values during serialization.
.More TCK refactoring.
.Refactored TCK package structure.
.Added RuntimeHelper interface to TCK source.
.Added test suite example to TCK source.
.Removed schema validation of the serialized instance enhancement in DefaultSerializationTest .
.Enabled testing of XSDHelper.getNamespaceURI(Type) method in XSDHelperTest class.
.Removed corner case testing of like Data Objects with different Change Summaries in EqualityHelperTest.testChangeSummary().
.Enhanced DefaultSerializationTest to include schema validation of the serialized instance document.
.Moved testWrapperObjectsForSimpleTypes test from DataObjectTestBase class into SimpleContentTest class. Enhanced this test to include testing of serialization.
.Fixed a problem in CopyHelper2Test where an IDREF property was changed from being an element to an attribute.
.Added new test class ChangeSummarySerializationTest. This test cases verfies that an implementation can load a serialized xml instance that contains a change summary.
.Cleaned up many aspects of the DataHelperTest class.
.Added a new test case in DataObjectTestBase to test wrapper objects.
.Added a new test class for testing EqualityHelper.
.Enhanced CopyHelper testing with the CopyHelper2Test class.
.Added new test case to validate the optimization of a restricted type.
.Enhanced ChangeSummaryTest.testSequenceBody() to use a mixture of elements and text, not just text.
.Added new interface to xml compare utility.
.Fixed sequence size assertion in ChangeSummaryTest.testSequenceBody()
.Fixed a number of issues in TCKUtil where dynamic types are created.
.Cleaned up some assertions in XSDHelperTest.testRedefinition().
.Removed objectionable assertions in SubstitutionGroupTest.
.Changed how type checking is done in XMLWithoutSchemaTest.
.More clean up of small issues.
.Removed all checks for base type list sizes due to the confining nature of that assertion.
.Clean up on a number of small issues
.Added test for anonymous types into XSDComplexTypeTest
.Major rework of the DataHelperTest case
.Added option filtering to XMLCompareUtil
.Removed testing of commonj.sdo.DataGraph
.Modified the interface used to register static types
.Added check in EqualityTest to filter any checking of ChangeSummary type
.Corrected some issues in the SDOPathTest where a single value not a list is returned.
.Changed how PropertyTest and TypeTest account for instance properties.
.Corrected an issue with the appinfo test case in XSDHelperTest. The returned value should be a full XML document not a snippet.
.Modified ChangeSummaryTest where the method ChangeSummary.getOldSequence() was improperly being tested against a type that was not a valid sequence. Now that test is contained in the testSequenceBody method.
.Cleaned up how the HelperContextTest case inspects expected interfaces.
.Added some additional testing of dynamic types in cleanup in the annotations test cases. Corrected some problems in that those test cases as well.
.Added testing of the sdo java instanceClass attribute.
.Completely reworked how TCK tests Data Objects for equality. Now the TCK has a self-contained test method. This change will aid in validating EqualityHelper which is going to be an additional test added in the near future.
.Added an additional check in OpenTypeTest to validate EG issue #18 decision.
.Made changes to the DataHelperTest case to bring it in line with the new spec documentation described in EG issue #10.
.Added a new DefaultSerialization test case. This test case validates the ability of the implementation to serialize all simple type default values, then deserialize them back.
.Adjusted schema namespace prefixes to be consistent and in line with agreed upon notation (sdo/sdox/sdoj).
.Corrected a problem in SubstitutionGroupTest.substitutionGroupTest1 where properties were not being created in the proper order to match control sample.
.Added checking of xsd:all such that it maps to type.sequenced. This is per resolution of issue EG issue #20.
.Completed a first pass evaluation version of the new static tests.
.Added new test cases for the SDO Path function.
.Corrected a problem found in the XSDComplexTypeTest class where Type.getDeclaredProperties() should not include parent type modified properties. This change was made to address EG issue #22.
.Enhanced SimpleContentTest class to include more testing of complex types that wrap a simple type.
.Corrected some issues with the XMLCompareUtil class to allow the comparison of xml documents to be more forgiving of QName values with different namespace prefixes.
.Added additional tolerance to the XMLCompareUtil in the area of namespace declaration comparison.
.Corrected a number of minor issues in the AnnotationsTests.
.Improved the packaging process to better control package refactoring.
.Added some minor improvements to the static testing framework being created.
.Added a new parameter ‘HelperContext’ to the RuntimeHelper.createDataGraph() method.
.Corrected or removed number of invalid or defective test cases.
.Create initial version of the static test framework.
.Created new set of annotations tests.
.Added more asserts in ChangeSummaryTest.testDelete().
.Improved ChangeSummary.testSequenceBody() test.
.Added a new test to XSDComplexTypeTest. The new test 'testNestedTypes' validates that XSDHelper.define() will work properly with nested complex types in a schema.
.Changed some testscases which use test data with BigDecimal values that end in ".0" to use ".9" instead - e.g. new BigDecimal("1000.0") changed to new BigDecimal("1000.9"). This avoids possible normalization during serialization and deserialization. i.e. "1000.0" should be normalized to "1000" according to W3C - which results in failures in tests that check if the value after roundtrip is still "1000.0"
.Initial revision