The JDO 2 Technology Compatibility Kit

Overview of the JDO 2 Technology Compatibility Kit

The JDO 2 project includes the JDO 2 TCK and its dependencies:

JDO releases may be downloaded from the Apache JDO downloads page. Minor updates of releases are only available as source from the Subversion repository. Follow the instructions below to build the TCK from source.

For complete rules for certifying a JDO implementation, see RunRules.html in the top level tck2 project directory.

Prerequisites

You must install the software listed in the following sections to successfully run the TCK. Other dependencies, such as the reference implementation, DataNucleus, and the Apache Derby database, are downloaded automatically by maven. Note that Apache JDO uses the apache commons logging package for logging.

Maven

You must have Maven version 1.1 to build the projects from source and to execute the TCK. You can download maven from http://maven.apache.org/start/download.html

Note that maven uses the user.home system property for the location of the maven local repostitory: ${user.home}/.maven/repository. Under Windows this system property is C:\Documents and Settings\user no matter what the HOME variable is set to. As a workaround you may set the system property by adding -Duser.home=%HOME% to the environment variable MAVEN_OPTS.

Mevenide is a nice maven plugin for IDEs available from http://mevenide.codehaus.org. In Netbeans, after you install the plugin, you can open an existing maven project by File -> Open Project -> Open Project Folder. Navigate to a directory including a maven project (e.g. api2) and choose this directory. Netbeans will create a project folder. If you right-click the Maven project you can examine the contents of the project.xml (see Properties) or execute goals.

JNDI implementation (fscontext.jar and providerutil.jar)

The JNDI test cases in tck2 need a JNDI implementation. The TCK is configured to use Sun's JNDI implementation. To use your own implementation, put the implementation jar files into lib/ext and update jndi.properties in the TCK directory src/conf. To download Sun's implementation, go to http://java.sun.com/products/jndi/downloads/index.html, click the Download button at 'Download JNDI 1.2.1 & More', accept a license agreement, download 'File System Service Provider, 1.2 Beta 3' and then unpack the downloaded zip. It includes the jars fscontext.jar and providerutil.jar.

Building the TCK from Source

For instructions for checking out the JDO source, see the Apache JDO source code page. To build the TCK dependencies, change to the top level directory of the branch you are working in (or trunk if you are using the latest unreleased code) and run
maven tck2.default
Then change to the "tck2" directory and run
maven build
When execution completes, you are ready to run the TCK.

Running the TCK

In the tck2 project, run "maven build" to build the tck. This will compile, enhance, install the schemas, and run all the tests on the RI on all supported databases and identitytypes.

You may use the following custom goals and command line options with the tck2 project:

Custom Goals

help
displays help text describing custom goals and options
runtck.jdori
runs the TCK on the JDO Reference Implementation
runtck.iut
runs the TCK on the implementation under test
installSchema
installs the database schema
enhance.jdori
enhances the class files using the JDO RI enhancer
enhance.iut
enhances the class files using the implementation under test's enhancer
debugtck.jdori
waits for a debugger to attach and then runs the TCK on the JDO RI
debugtck.iut
waits for a debugger to attach and then runs the TCK on the implementation under test
cleanClasses
deletes classes and enhanced classes

Command Line Options

-Djdo.tck.cfglist=configuration file list
Overrides the definition of jdo.tck.cfglist found in tck2/src/conf/configuration.list by supplying one or more space-separated test configuration files. Test configuration files typically have the .conf extension. To run a single test, create a .conf file (copy an existing file) and put the test into the jdo.tck.classes property.
-Djdo.tck.dblist=database list
Overrides the property value in project.properties by supplying one or more space-separated database names
-Djdo.tck.identitytypes=identity type list
Overrides the property value in project.properties by supplying one or more space-separated identity types (applicationidentity or datastoreidentity) to use for this run.
-Djdo.tck.cleanupaftertest=boolean
When false, data is retained in the database after the test. This allows inspection of data after test is run. Default is true.
-Djdo.tck.debug.port=port number
Sets the port number the JVM should listen for a debugger on. Default is 8787.
-Djdo.tck.debug.jvmargs=args
Sets the "-Xdebug ..." arguments to allow you to supply your own debug directives.

Files

Maven looks for the following configuration files in src/conf:

Examples

maven -Djdo.tck.identitytypes=datastoreidentity installSchema
Installs the database schema for datastore identity for all supported databases
maven -Djdo.tck.cfglist="alltests.conf cfg1.conf" runtck.jdori
Runs the test configurations specified in alltests.conf and cfg1.conf on the JDORI, using all supported identity types and databases.
maven -Djdo.tck.cfglist=detach.conf debugtck.jdori
Runs the test detach.conf configuration, waiting for a debugger to attach on the default port
maven -Djdo.tck.cfglist=detach.conf -Djdo.tck.debug.port=9343 debugtck.jdori
Runs the test detach.conf configuration, waiting for a debugger to attach on port 9343

Note: