To download Oracle’s implementation, go here. Accept the license agreement and download File System Service Provider, 1.2 Beta 3 and then unpack the downloaded zip into lib/ext
. It includes the jars fscontext.jar
and providerutil.jar
.
Building from Top Level TCK Project
For instructions for checking out the JDO source, see the Apache JDO source code page.
To build JDO with all subprojects go to the root directory of the branch you are working in (or master)
mvn clean install
This will build the artifacts jdo-api and jdo-exectck and will run the TCK.
Building the JDO API
To build the API, change to the “api” directory of the branch you are working in (or master) and run
mvn clean install
This will build the jdo-api artifact and install it in your local Maven repository and run the TCK on the Reference Implementation.
Running the JDO TCK on an Implementation Under Test
Firstly build from the top level TCK project as described above. To run the JDO TCK on an Implementation Under Test, edit tck/pom.xml and add the iut dependencies to the profile called iut. Also check the following files under tck/src/main/resources/conf and change the content to the needs of the Implementation Under Test: iut-jdoconfig.xml
, iut-log4j.properties
, iut-persistence.xml
and iut-pmf.properties
.
Change to the “tck” directory of the branch you are working in (or master) and run
mvn -Djdo.tck.impl="iut" clean install
and this will run the TCK (via the “jdo-exectck” plugin) on the Implementation Under Test on all supported databases and identity types.
The jdo-exectck Maven plugin (built from the exectck directory) has various options so you can run other implementations or only run particular tests.
Custom Goals
The jdo-exectck Maven plugin has the following custom goals
- help : Displays help text describing custom goals and options
- installSchema : Installs the database schema
- enhance : enhances the test classes being used
- runtck : Runs the TCK
Command Line Options
The jdo-exectck Maven plugin has the following options
- -Djdo.tck.impl : either jdori (reference implementation) or iut (implementation under test).
- -Djdo.tck.cfglist : Overrides the definition of jdo.tck.cfglist found in tck/src/conf/configuration.list by supplying one or more comma-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 : Overrides the property value in project.properties by supplying one or more comma-separated database names. Currently only derby is supported.
- -Djdo.tck.identitytypes : Overrides the identity types to be run, supplying one or more comma-separated identity types (applicationidentity or datastoreidentity) to use for this run.
- -Djdo.tck.impl.logfile : Location of implementation log file. Default:
${user.dir}/datanucleus.txt
- -Djdo.tck.doInstallSchema : Setting this parameter to false will bypass schema installation.
- -Djdo.tck.doEnhance : Setting this parameter to false will bypass enhancement.
- -Djdo.tck.doRunTCK : Setting this parameter to false will bypass running the TCK.
- -Djdo.tck.runTCKVerbose : Setting this parameter to true will display test progress and error output while the TCK is running.
- -Djdo.tck.onFailure : Specifies how test failures are treated. failFast will immediately abort the test run. failGoal (default) will execute the whole TCK before failing. logOnly will report failures to console and logs only but return ‘SUCCESS’ to the Maven execution environment.
Examples
Example 1 : Installs the database schema for datastore identity for all supported databases.
mvn -Djdo.tck.identitytypes=datastoreidentity jdo-exectck:installSchema
Example 2 : Runs the test configurations specified in alltests.conf
and cfg1.conf
on the JDORI, using all supported identity types and databases.
mvn -Djdo.tck.cfglist="alltests.conf cfg1.conf" jdo-exectck:runtck
Files
While running the TCK, maven uses the following configuration files in src/conf:
- configurations.list : A list of files. Each file listed is a test configuration file.
- test configuration files (*.conf). Each of these files sets values for
- jdo.tck.testdescription : An optional string describing the purpose of these tests
- jdo.tck.classes : A list of one or more test classes (required)
- jdo.tck.testdata : The fully qualified file name of the xml test data file(optional)
- jdo.tck.standarddata : The fully qualified file name of the xml test data file(optional)
- jdo.tck.mapping : The file designator that maven.xml uses to build a javax.jdo.option.Mapping value and corresponding schema name (required)
- exclude.list : A list of test classes NOT to execute during a TCK test run