TestRunner is a project to automate running the TCK for all databases,
identity types, security settings, schemas, mappings, and test cases
with a single maven invocation. We discussed doing the hard stuff
either in maven or with an extended java/JUnit TestRunner. It seems
possible to do it in maven. Below is a working outline of a maven goal
that loops through the various parameters and repeatedly executes a test
run, followed by the results generated by this goal.
_______________
maven.xml:
_______________
<project default="default"
xmlns:j="jelly:core"
xmlns:ant="jelly:ant"
xmlns:maven="jelly:maven"
xmlns:u="jelly:util"
>
...
<!-- ================== -->
<!-- Running test cases -->
<!-- ================== -->
<preGoal name="runallcfgs.jdori">
<!-- Install schema for each database -->
<u:properties file="${basedir}/test/conf/db.list"/>
<u:tokenize var="jdo.tck.dblist" delim=" ">
${jdo.tck.dblist}
</u:tokenize>
<j:forEach var="jdo.tck.db" items="${jdo.tck.dblist}">
<attainGoal name="databaseStub"/>
</j:forEach>
<!-- Enhance and build jar file for each identity type -->
<u:properties file="${basedir}/test/conf/identity.list"/>
<u:tokenize var="jdo.tck.idlist" delim=" ">
${jdo.tck.idlist}
</u:tokenize>
<j:forEach var="jdo.tck.id" items="${jdo.tck.idlist}">
<attainGoal name="enhanceStub"/>
</j:forEach>
</preGoal>
<goal name="runallcfgs.jdori" prereqs="java:compile, testrunner.set,
copyprops">
<!-- Run tests for all databases, identity types, and
configurations -->
<j:forEach var="jdo.tck.db" items="${jdo.tck.dblist}">
<j:forEach var="jdo.tck.id" items="${jdo.tck.idlist}">
<u:properties
file="${basedir}/test/conf/configurations.list"/>
<u:tokenize var="jdo.tck.cfglist" delim=" ">
${jdo.tck.cfglist}
</u:tokenize>
<j:forEach var="jdo.tck.cfg" items="${jdo.tck.cfglist}">
<!-- get jdo.tck.classes (list of testclasses),
jdo.tck.testdata, jdo.tck.mapping -->
<u:properties
file="${basedir}/test/conf/${jdo.tck.cfg}"/>
<attainGoal name="runtckStub"/>
</j:forEach>
</j:forEach>
</j:forEach>
</goal>
<goal name="databaseStub">
<echo>Install schema in ${jdo.tck.db}</echo>
</goal>
<goal name="enhanceStub">
<echo>Enhance classes for ${jdo.tck.id}</echo>
</goal>
<goal name="runtckStub">
<echo>Run tck using database ${jdo.tck.db},
identity type ${jdo.tck.id},
configuration ${jdo.tck.cfg}
</echo>
<echo>Run test classes ${jdo.tck.classes}
with test data ${jdo.tck.testdata}
and mapping/schema files ${jdo.tck.mapping}
</echo>
</goal>
_______________
Results:
_______________
$ maven -o runallcfgs.jdori
__ __
| \/ |__ _Apache__ ___
| |\/| / _` \ V / -_) ' \ ~ intelligent projects ~
|_| |_\__,_|\_/\___|_||_| v. 1.0.2
You are working offline so the build will continue, but
jpox-SNAPSHOT.jar may be out of date!
You are working offline so the build will continue, but
jdo2-api-SNAPSHOT.jar may be out of date!
You are working offline so the build will continue, but
jpox-enhancer-SNAPSHOT.jar may be out of date!
build:start:
java:prepare-filesystem:
java:compile:
[echo] Compiling to c:\svn5\jdo\trunk\tck20/target/classes
testrunner.set:
copyprops:
runallcfgs.jdori:
databaseStub:
[echo] Install schema in derby
databaseStub:
[echo] Install schema in mysql
databaseStub:
[echo] Install schema in oracle
enhanceStub:
[echo] Enhance classes for application
enhanceStub:
[echo] Enhance classes for datastore
runtckStub:
[echo] Run tck using database derby,
identity type application,
configuration cfg1.conf
[echo] Run test classes
org.apache.jdo.tck.api.jdohelper.GetObjectIdForNull
org.apache.jdo.tck.api.jdohelper.GetObjectIdForTransient
org.apache.jdo.tck.api.jdohelper.GetObjectIdNotPersistenceCapable
org.apache.jdo.tck.api.jdohelper.GetPersistenceManager
org.apache.jdo.tck.api.jdohelper.GetPersistenceManagerForNull
org.apache.jdo.tck.api.jdohelper.GetPersistenceManagerForTransient
org.apache.jdo.tck.api.jdohelper.GetPersistenceManagerNotPersistenceCapable
org.apache.jdo.tck.api.jdohelper.GetTransactionalObjectId
org.apache.jdo.tck.api.jdohelper.GetTransactionalObjectIdForNull
org.apache.jdo.tck.api.jdohelper.GetTransactionalObjectIdForTransient
org.apache.jdo.tck.api.jdohelper.GetTransactionalObjectIdNotPersistenceCapable
with test data
and mapping/schema files
runtckStub:
[echo] Run tck using database derby,
identity type application,
configuration cfg2.conf
[echo] Run test classes
org.apache.jdo.tck.mapping.CompanyModelCompletenessTest
with test data org.apache.jdo.tck.pc.company.company.xml
and mapping/schema files
org.apache.jdo.tck.pc.company.company.orm
runtckStub:
[echo] Run tck using database derby,
identity type application,
configuration cfg3.conf
[echo] Run test classes
org.apache.jdo.tck.mapping.CompanyModelCompletenessTest
with test data org.apache.jdo.tck.pc.company.company2.xml
and mapping/schema files
org.apache.jdo.tck.pc.company.company2.orm
runtckStub:
[echo] Run tck using database derby,
identity type datastore,
configuration cfg1.conf
[echo] Run test classes
org.apache.jdo.tck.api.jdohelper.GetObjectIdForNull
org.apache.jdo.tck.api.jdohelper.GetObjectIdForTransient
org.apache.jdo.tck.api.jdohelper.GetObjectIdNotPersistenceCapab
le org.apache.jdo.tck.api.jdohelper.GetPersistenceManager
org.apache.jdo.tck.api.jdohelper.GetPersistenceManagerForNull
org.apache.jdo.tck.api.jdohelper.GetPersistenceManagerForTransient
org.apache.jd
o.tck.api.jdohelper.GetPersistenceManagerNotPersistenceCapable
org.apache.jdo.tck.api.jdohelper.GetTransactionalObjectId
org.apache.jdo.tck.api.jdohelper.GetTransactionalObjectIdForNull
org.apache.jdo
.tck.api.jdohelper.GetTransactionalObjectIdForTransient
org.apache.jdo.tck.api.jdohelper.GetTransactionalObjectIdNotPersistenceCapable
with test data
and mapping/schema files
runtckStub:
[echo] Run tck using database derby,
identity type datastore,
configuration cfg2.conf
[echo] Run test classes
org.apache.jdo.tck.mapping.CompanyModelCompletenessTest
with test data org.apache.jdo.tck.pc.company.company.xml
and mapping/schema files
org.apache.jdo.tck.pc.company.company.orm
runtckStub:
[echo] Run tck using database derby,
identity type datastore,
configuration cfg3.conf
[echo] Run test classes
org.apache.jdo.tck.mapping.CompanyModelCompletenessTest
with test data org.apache.jdo.tck.pc.company.company2.xml
and mapping/schema files
org.apache.jdo.tck.pc.company.company2.orm
runtckStub:
[echo] Run tck using database mysql,
identity type application,
configuration cfg1.conf
[echo] Run test classes
org.apache.jdo.tck.api.jdohelper.GetObjectIdForNull
org.apache.jdo.tck.api.jdohelper.GetObjectIdForTransient
org.apache.jdo.tck.api.jdohelper.GetObjectIdNotPersistenceCapab
le org.apache.jdo.tck.api.jdohelper.GetPersistenceManager
org.apache.jdo.tck.api.jdohelper.GetPersistenceManagerForNull
org.apache.jdo.tck.api.jdohelper.GetPersistenceManagerForTransient
org.apache.jd
o.tck.api.jdohelper.GetPersistenceManagerNotPersistenceCapable
org.apache.jdo.tck.api.jdohelper.GetTransactionalObjectId
org.apache.jdo.tck.api.jdohelper.GetTransactionalObjectIdForNull
org.apache.jdo
.tck.api.jdohelper.GetTransactionalObjectIdForTransient
org.apache.jdo.tck.api.jdohelper.GetTransactionalObjectIdNotPersistenceCapable
with test data
and mapping/schema files
runtckStub:
[echo] Run tck using database mysql,
identity type application,
configuration cfg2.conf
[echo] Run test classes
org.apache.jdo.tck.mapping.CompanyModelCompletenessTest
with test data org.apache.jdo.tck.pc.company.company.xml
and mapping/schema files
org.apache.jdo.tck.pc.company.company.orm
runtckStub:
[echo] Run tck using database mysql,
identity type application,
configuration cfg3.conf
[echo] Run test classes
org.apache.jdo.tck.mapping.CompanyModelCompletenessTest
with test data org.apache.jdo.tck.pc.company.company2.xml
and mapping/schema files
org.apache.jdo.tck.pc.company.company2.orm
runtckStub:
[echo] Run tck using database mysql,
identity type datastore,
configuration cfg1.conf
[echo] Run test classes
org.apache.jdo.tck.api.jdohelper.GetObjectIdForNull
org.apache.jdo.tck.api.jdohelper.GetObjectIdForTransient
org.apache.jdo.tck.api.jdohelper.GetObjectIdNotPersistenceCapable
org.apache.jdo.tck.api.jdohelper.GetPersistenceManager
org.apache.jdo.tck.api.jdohelper.GetPersistenceManagerForNull
org.apache.jdo.tck.api.jdohelper.GetPersistenceManagerForTransient
org.apache.jdo.tck.api.jdohelper.GetPersistenceManagerNotPersistenceCapable
org.apache.jdo.tck.api.jdohelper.GetTransactionalObjectId
org.apache.jdo.tck.api.jdohelper.GetTransactionalObjectIdForNull
org.apache.jdo.tck.api.jdohelper.GetTransactionalObjectIdForTransient
org.apache.jdo.tck.api.jdohelper.GetTransactionalObjectIdNotPersistenceCapable
with test data
and mapping/schema files
runtckStub:
[echo] Run tck using database mysql,
identity type datastore,
configuration cfg2.conf
[echo] Run test classes
org.apache.jdo.tck.mapping.CompanyModelCompletenessTest
with test data org.apache.jdo.tck.pc.company.company.xml
and mapping/schema files
org.apache.jdo.tck.pc.company.company.orm
runtckStub:
[echo] Run tck using database mysql,
identity type datastore,
configuration cfg3.conf
[echo] Run test classes
org.apache.jdo.tck.mapping.CompanyModelCompletenessTest
with test data org.apache.jdo.tck.pc.company.company2.xml
and mapping/schema files
org.apache.jdo.tck.pc.company.company2.orm
runtckStub:
[echo] Run tck using database oracle,
identity type application,
configuration cfg1.conf
[echo] Run test classes
org.apache.jdo.tck.api.jdohelper.GetObjectIdForNull
org.apache.jdo.tck.api.jdohelper.GetObjectIdForTransient
org.apache.jdo.tck.api.jdohelper.GetObjectIdNotPersistenceCapable
org.apache.jdo.tck.api.jdohelper.GetPersistenceManager
org.apache.jdo.tck.api.jdohelper.GetPersistenceManagerForNull
org.apache.jdo.tck.api.jdohelper.GetPersistenceManagerForTransient
org.apache.jdo.tck.api.jdohelper.GetPersistenceManagerNotPersistenceCapable
org.apache.jdo.tck.api.jdohelper.GetTransactionalObjectId
org.apache.jdo.tck.api.jdohelper.GetTransactionalObjectIdForNull
org.apache.jdo.tck.api.jdohelper.GetTransactionalObjectIdForTransient
org.apache.jdo.tck.api.jdohelper.GetTransactionalObjectIdNotPersistenceCapable
with test data
and mapping/schema files
runtckStub:
[echo] Run tck using database oracle,
identity type application,
configuration cfg2.conf
[echo] Run test classes
org.apache.jdo.tck.mapping.CompanyModelCompletenessTest
with test data org.apache.jdo.tck.pc.company.company.xml
and mapping/schema files
org.apache.jdo.tck.pc.company.company.orm
runtckStub:
[echo] Run tck using database oracle,
identity type application,
configuration cfg3.conf
[echo] Run test classes
org.apache.jdo.tck.mapping.CompanyModelCompletenessTest
with test data org.apache.jdo.tck.pc.company.company2.xml
and mapping/schema files
org.apache.jdo.tck.pc.company.company2.orm
runtckStub:
[echo] Run tck using database oracle,
identity type datastore,
configuration cfg1.conf
[echo] Run test classes
org.apache.jdo.tck.api.jdohelper.GetObjectIdForNull
org.apache.jdo.tck.api.jdohelper.GetObjectIdForTransient
org.apache.jdo.tck.api.jdohelper.GetObjectIdNotPersistenceCapable
org.apache.jdo.tck.api.jdohelper.GetPersistenceManager
org.apache.jdo.tck.api.jdohelper.GetPersistenceManagerForNull
org.apache.jdo.tck.api.jdohelper.GetPersistenceManagerForTransient
org.apache.jdo.tck.api.jdohelper.GetPersistenceManagerNotPersistenceCapable
org.apache.jdo.tck.api.jdohelper.GetTransactionalObjectId
org.apache.jdo.tck.api.jdohelper.GetTransactionalObjectIdForNull
org.apache.jdo.tck.api.jdohelper.GetTransactionalObjectIdForTransient
org.apache.jdo.tck.api.jdohelper.GetTransactionalObjectIdNotPersistenceCapable
with test data
and mapping/schema files
runtckStub:
[echo] Run tck using database oracle,
identity type datastore,
configuration cfg2.conf
[echo] Run test classes
org.apache.jdo.tck.mapping.CompanyModelCompletenessTest
with test data org.apache.jdo.tck.pc.company.company.xml
and mapping/schema files
org.apache.jdo.tck.pc.company.company.orm
runtckStub:
[echo] Run tck using database oracle,
identity type datastore,
configuration cfg3.conf
[echo] Run test classes
org.apache.jdo.tck.mapping.CompanyModelCompletenessTest
with test data org.apache.jdo.tck.pc.company.company2.xml
and mapping/schema files
org.apache.jdo.tck.pc.company.company2.orm
BUILD SUCCESSFUL
-- Michelle