Index: test/sql/derby/datastoreidentity/schema2.sql
===================================================================
--- test/sql/derby/datastoreidentity/schema2.sql (revision 354756)
+++ test/sql/derby/datastoreidentity/schema2.sql (working copy)
@@ -64,7 +64,7 @@
);
CREATE TABLE persons (
- DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY,
+ DATASTORE_IDENTITY INTEGER NOT NULL,
PERSONID INTEGER UNIQUE NOT NULL,
FIRSTNAME VARCHAR(32) NOT NULL,
LASTNAME VARCHAR(32) NOT NULL,
@@ -80,7 +80,7 @@
);
CREATE TABLE fulltimeemployees (
- DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY,
+ DATASTORE_IDENTITY INTEGER NOT NULL,
PERSONID INTEGER UNIQUE NOT NULL,
FIRSTNAME VARCHAR(32) NOT NULL,
LASTNAME VARCHAR(32) NOT NULL,
@@ -104,7 +104,7 @@
);
CREATE TABLE parttimeemployees (
- DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY,
+ DATASTORE_IDENTITY INTEGER NOT NULL,
PERSONID INTEGER UNIQUE NOT NULL,
FIRSTNAME VARCHAR(32) NOT NULL,
LASTNAME VARCHAR(32) NOT NULL,
@@ -128,7 +128,7 @@
);
CREATE TABLE medicalinsurance (
- DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY,
+ DATASTORE_IDENTITY INTEGER NOT NULL,
INSID INTEGER,
CARRIER VARCHAR(64) NOT NULL,
EMPLOYEE INTEGER REFERENCES fulltimeemployees,
@@ -137,7 +137,7 @@
);
CREATE TABLE dentalinsurance (
- DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY,
+ DATASTORE_IDENTITY INTEGER NOT NULL,
INSID INTEGER,
CARRIER VARCHAR(64) NOT NULL,
EMPLOYEE INTEGER REFERENCES fulltimeemployees,
Index: test/java/org/apache/jdo/tck/mapping/CompletenessTest.java
===================================================================
--- test/java/org/apache/jdo/tck/mapping/CompletenessTest.java (revision 354756)
+++ test/java/org/apache/jdo/tck/mapping/CompletenessTest.java (working copy)
@@ -16,21 +16,15 @@
package org.apache.jdo.tck.mapping;
-import java.lang.reflect.Constructor;
-
import java.util.ArrayList;
+import java.util.Collection;
import java.util.Iterator;
import java.util.List;
+import java.util.StringTokenizer;
-import javax.jdo.PersistenceManager;
-import javax.jdo.JDOException;
-
import org.apache.jdo.tck.JDO_Test;
-
-import org.apache.jdo.tck.pc.company.CompanyFactory;
import org.apache.jdo.tck.pc.company.CompanyFactoryRegistry;
import org.apache.jdo.tck.pc.company.CompanyModelReader;
-
import org.apache.jdo.tck.util.BatchTestRunner;
import org.apache.jdo.tck.util.DeepEquality;
import org.apache.jdo.tck.util.EqualityHelper;
@@ -66,64 +60,88 @@
public static void main(String[] args) {
BatchTestRunner.run(CompletenessTest.class);
}
+
+ private boolean isTestToBePerformed() {
+ boolean isTestToBePerformed = true;
+ String requiredOptions = System.getProperty("jdo.tck.requiredOptions");
+ Collection supportedOptions = getPMF().supportedOptions();
+ StringTokenizer tokenizer = new StringTokenizer(requiredOptions, " ,");
+ while (tokenizer.hasMoreTokens()) {
+ String token = tokenizer.nextToken();
+ if (!supportedOptions.contains(token)) {
+ isTestToBePerformed = false;
+ int index = getClass().getName().lastIndexOf('.');
+ String testName = index==-1 ?
+ getClass().getName() : getClass().getName().substring(index+1);
+ printUnsupportedOptionalFeatureNotTested(testName, token);
+ break;
+ }
+ }
+ if (!isTestToBePerformed) {
+ }
+ return isTestToBePerformed;
+ }
/**
* @see JDO_Test#localSetUp()
*/
protected void localSetUp() {
- getPM();
- CompanyFactoryRegistry.registerFactory(pm);
- CompanyModelReader reader = new CompanyModelReader(inputFilename);
- // persist test data
- pm.currentTransaction().begin();
- List rootList = reader.getRootList();
- pm.makePersistentAll(rootList);
- addTearDownClass(reader.getTearDownClasses());
- rootOids = new ArrayList();
- for (Iterator i = rootList.iterator(); i.hasNext(); ) {
- Object pc = i.next();
- rootOids.add(pm.getObjectId(pc));
+ if (isTestToBePerformed()) {
+ getPM();
+ CompanyFactoryRegistry.registerFactory(pm);
+ CompanyModelReader reader = new CompanyModelReader(inputFilename);
+ // persist test data
+ pm.currentTransaction().begin();
+ List rootList = reader.getRootList();
+ pm.makePersistentAll(rootList);
+ addTearDownClass(CompanyModelReader.getTearDownClasses());
+ rootOids = new ArrayList();
+ for (Iterator i = rootList.iterator(); i.hasNext(); ) {
+ Object pc = i.next();
+ rootOids.add(pm.getObjectId(pc));
+ }
+ pm.currentTransaction().commit();
+ cleanupPM();
}
- pm.currentTransaction().commit();
- cleanupPM();
}
/** */
public void test() {
-
- // register the default factory
- CompanyFactoryRegistry.registerFactory();
- // get new obj graph to compare persistent graph with
- CompanyModelReader reader = new CompanyModelReader(inputFilename);
- List rootList = reader.getRootList();
-
- getPM();
- pm.currentTransaction().begin();
- // compare persisted and new
- int size = rootList.size();
- StringBuffer msg = new StringBuffer();
- for (int i = 0; i < size; i++) {
- DeepEquality expected = (DeepEquality) rootList.get(i);
- Object oid = rootOids.get(i);
- Object persisted = pm.getObjectById(oid);
- EqualityHelper equalityHelper = new EqualityHelper();
- if (!expected.deepCompareFields(persisted, equalityHelper)) {
- if (msg.length() > 0) {
- msg.append("\n");
+ if (isTestToBePerformed()) {
+ // register the default factory
+ CompanyFactoryRegistry.registerFactory();
+ // get new obj graph to compare persistent graph with
+ CompanyModelReader reader = new CompanyModelReader(inputFilename);
+ List rootList = reader.getRootList();
+
+ getPM();
+ pm.currentTransaction().begin();
+ // compare persisted and new
+ int size = rootList.size();
+ StringBuffer msg = new StringBuffer();
+ for (int i = 0; i < size; i++) {
+ DeepEquality expected = (DeepEquality) rootList.get(i);
+ Object oid = rootOids.get(i);
+ Object persisted = pm.getObjectById(oid);
+ EqualityHelper equalityHelper = new EqualityHelper();
+ if (!expected.deepCompareFields(persisted, equalityHelper)) {
+ if (msg.length() > 0) {
+ msg.append("\n");
+ }
+ msg.append("Expected this instance:\n " +
+ expected + "\n" +
+ "Got persistent instance:" + "\n " +
+ persisted + "\n" +
+ "Detailed list of differences follows...\n");
+ msg.append(equalityHelper.getUnequalBuffer());
}
- msg.append("Expected this instance:\n " +
- expected + "\n" +
- "Got persistent instance:" + "\n " +
- persisted + "\n" +
- "Detailed list of differences follows...\n");
- msg.append(equalityHelper.getUnequalBuffer());
}
+ pm.currentTransaction().commit();
+ // fail test if at least one of the instances is not the expected one
+ if (msg.length() > 0) {
+ fail("CompletenessTest failed; see list of failures below:",
+ msg.toString());
+ }
}
- pm.currentTransaction().commit();
- // fail test if at least one of the instances is not the expected one
- if (msg.length() > 0) {
- fail("CompletenessTest failed; see list of failures below:",
- msg.toString());
- }
}
}
Index: test/conf/alltests.conf
===================================================================
--- test/conf/alltests.conf (revision 354756)
+++ test/conf/alltests.conf (working copy)
@@ -2,6 +2,7 @@
jdo.tck.testdata =
jdo.tck.standarddata =
jdo.tck.mapping = 0
+jdo.tck.requiredOptions =
jdo.tck.classes = \
org.apache.jdo.tck.api.instancecallbacks.AccessOtherInstancesInPrestore \
org.apache.jdo.tck.api.instancecallbacks.AccessingFieldsInPredelete \
Index: test/conf/datastoreidentity.conf
===================================================================
--- test/conf/datastoreidentity.conf (revision 354756)
+++ test/conf/datastoreidentity.conf (working copy)
@@ -2,3 +2,4 @@
jdo.tck.identitytype = datastoreidentity
jdo.tck.testclasses = ${jdo.tck.alltests}
jdo.tck.schema = schema2.sql
+jdo.tck.requiredOptions =
Index: test/conf/schemaAttributePackage.conf
===================================================================
--- test/conf/schemaAttributePackage.conf (revision 354756)
+++ test/conf/schemaAttributePackage.conf (working copy)
@@ -2,3 +2,4 @@
jdo.tck.classes = org.apache.jdo.tck.api.persistencemanager.lifecycle.MakePersistent
jdo.tck.testdata =
jdo.tck.mapping = 6
+jdo.tck.requiredOptions =
Index: test/conf/schemaAttributeOrm.conf
===================================================================
--- test/conf/schemaAttributeOrm.conf (revision 354756)
+++ test/conf/schemaAttributeOrm.conf (working copy)
@@ -2,3 +2,4 @@
jdo.tck.classes = org.apache.jdo.tck.api.persistencemanager.lifecycle.MakePersistent
jdo.tck.testdata =
jdo.tck.mapping = 5
+jdo.tck.requiredOptions =
Index: test/conf/companyAllRelationships.conf
===================================================================
--- test/conf/companyAllRelationships.conf (revision 354756)
+++ test/conf/companyAllRelationships.conf (working copy)
@@ -3,3 +3,4 @@
jdo.tck.classes = org.apache.jdo.tck.mapping.CompletenessTest
jdo.tck.testdata = org/apache/jdo/tck/pc/company/companyAllRelationships.xml
jdo.tck.mapping = 0
+jdo.tck.requiredOptions =
Index: test/conf/companyNoRelationships.conf
===================================================================
--- test/conf/companyNoRelationships.conf (revision 354756)
+++ test/conf/companyNoRelationships.conf (working copy)
@@ -2,3 +2,4 @@
jdo.tck.classes = org.apache.jdo.tck.mapping.CompletenessTest
jdo.tck.testdata = org/apache/jdo/tck/pc/company/companyNoRelationships.xml
jdo.tck.mapping = 0
+jdo.tck.requiredOptions =
Index: test/conf/inheritance1.conf
===================================================================
--- test/conf/inheritance1.conf (revision 354756)
+++ test/conf/inheritance1.conf (working copy)
@@ -3,5 +3,6 @@
Each table contains columns for the declared fields. \
Inheritance strategy: new-table for all classes.
jdo.tck.classes = org.apache.jdo.tck.mapping.CompletenessTest
-jdo.tck.testdata = org/apache/jdo/tck/pc/company/companyNoRelationships.xml
+jdo.tck.testdata = org/apache/jdo/tck/pc/company/companyAllRelationships.xml
jdo.tck.mapping = 1
+jdo.tck.requiredOptions =
Index: test/conf/schemaAttributeClass.conf
===================================================================
--- test/conf/schemaAttributeClass.conf (revision 354756)
+++ test/conf/schemaAttributeClass.conf (working copy)
@@ -2,3 +2,4 @@
jdo.tck.classes = org.apache.jdo.tck.api.persistencemanager.lifecycle.MakePersistent
jdo.tck.testdata =
jdo.tck.mapping = 7
+jdo.tck.requiredOptions =
Index: test/conf/inheritance2.conf
===================================================================
--- test/conf/inheritance2.conf (revision 354756)
+++ test/conf/inheritance2.conf (working copy)
@@ -10,5 +10,6 @@
and parttime employees. \
Inheritance strategy: new-table for all classes.
jdo.tck.classes = org.apache.jdo.tck.mapping.CompletenessTest
-jdo.tck.testdata = org/apache/jdo/tck/pc/company/companyNoRelationships.xml
+jdo.tck.testdata = org/apache/jdo/tck/pc/company/companyAllRelationships.xml
jdo.tck.mapping = 2
+jdo.tck.requiredOptions = javax.jdo.option.UnionJoin
Index: test/conf/inheritance3.conf
===================================================================
--- test/conf/inheritance3.conf (revision 354756)
+++ test/conf/inheritance3.conf (working copy)
@@ -5,5 +5,6 @@
Insurance has inheritance strategy "subclass-table". \
MedicalInsurance and DentalInsurance have inheritance strategy "new-table".
jdo.tck.classes = org.apache.jdo.tck.mapping.CompletenessTest
-jdo.tck.testdata = org/apache/jdo/tck/pc/company/companyNoRelationships.xml
+jdo.tck.testdata = org/apache/jdo/tck/pc/company/companyAllRelationships.xml
jdo.tck.mapping = 3
+jdo.tck.requiredOptions =
Index: test/conf/applicationidentity.conf
===================================================================
--- test/conf/applicationidentity.conf (revision 354756)
+++ test/conf/applicationidentity.conf (working copy)
@@ -2,3 +2,4 @@
jdo.tck.identitytype = applicationidentity
jdo.tck.testclasses = ${jdo.tck.alltests}
jdo.tck.schema = schema1.sql
+jdo.tck.requiredOptions =
Index: test/conf/inheritance4.conf
===================================================================
--- test/conf/inheritance4.conf (revision 354756)
+++ test/conf/inheritance4.conf (working copy)
@@ -3,5 +3,6 @@
PartTimeEmployee, FullTimeEmployee, MedicalInsurance, and DentalInsurance \
have inheritance strategy "superclass-table".
jdo.tck.classes = org.apache.jdo.tck.mapping.CompletenessTest
-jdo.tck.testdata = org/apache/jdo/tck/pc/company/companyNoRelationships.xml
+jdo.tck.testdata = org/apache/jdo/tck/pc/company/companyAllRelationships.xml
jdo.tck.mapping = 4
+jdo.tck.requiredOptions =
Index: test/conf/companyEmbedded.conf
===================================================================
--- test/conf/companyEmbedded.conf (revision 354756)
+++ test/conf/companyEmbedded.conf (working copy)
@@ -3,3 +3,4 @@
jdo.tck.classes = org.apache.jdo.tck.mapping.CompletenessTest
jdo.tck.testdata = org/apache/jdo/tck/pc/company/companyEmbedded.xml
jdo.tck.mapping = 0
+jdo.tck.requiredOptions =
Index: test/conf/companyM-MRelationships.conf
===================================================================
--- test/conf/companyM-MRelationships.conf (revision 354756)
+++ test/conf/companyM-MRelationships.conf (working copy)
@@ -2,3 +2,4 @@
jdo.tck.classes = org.apache.jdo.tck.mapping.CompletenessTest
jdo.tck.testdata = org/apache/jdo/tck/pc/company/companyM-MRelationships.xml
jdo.tck.mapping = 0
+jdo.tck.requiredOptions =
Index: test/conf/company1-MRelationships.conf
===================================================================
--- test/conf/company1-MRelationships.conf (revision 354756)
+++ test/conf/company1-MRelationships.conf (working copy)
@@ -2,3 +2,4 @@
jdo.tck.classes = org.apache.jdo.tck.mapping.CompletenessTest
jdo.tck.testdata = org/apache/jdo/tck/pc/company/company1-MRelationships.xml
jdo.tck.mapping = 0
+jdo.tck.requiredOptions =
Index: test/conf/detach.conf
===================================================================
--- test/conf/detach.conf (revision 354756)
+++ test/conf/detach.conf (working copy)
@@ -5,3 +5,4 @@
jdo.tck.classes = \
org.apache.jdo.tck.api.persistencemanager.detach.SetDetachAllOnCommit \
org.apache.jdo.tck.api.persistencemanager.detach.GetDetachAllOnCommit
+jdo.tck.requiredOptions =
Index: test/conf/company1-1Relationships.conf
===================================================================
--- test/conf/company1-1Relationships.conf (revision 354756)
+++ test/conf/company1-1Relationships.conf (working copy)
@@ -2,3 +2,4 @@
jdo.tck.classes = org.apache.jdo.tck.mapping.CompletenessTest
jdo.tck.testdata = org/apache/jdo/tck/pc/company/company1-1Relationships.xml
jdo.tck.mapping = 0
+jdo.tck.requiredOptions =
Index: test/orm/datastoreidentity/org/apache/jdo/tck/pc/company/package-derby2.orm
===================================================================
--- test/orm/datastoreidentity/org/apache/jdo/tck/pc/company/package-derby2.orm (revision 354756)
+++ test/orm/datastoreidentity/org/apache/jdo/tck/pc/company/package-derby2.orm (working copy)
@@ -50,7 +50,8 @@
-
+
@@ -103,7 +104,8 @@
-
+
@@ -160,7 +162,8 @@
-
+
@@ -188,7 +191,8 @@
-
+
@@ -199,7 +203,8 @@
-
+
@@ -227,5 +232,11 @@
+
+
+
+
Index: maven.xml
===================================================================
--- maven.xml (revision 354756)
+++ maven.xml (working copy)
@@ -317,6 +317,8 @@
value="${jdo.tck.log.directory}/${timestamp}"/>
+
@@ -365,7 +367,9 @@
+ value="${jdo.tck.cleanupaftertest}"/>
+