db-jdo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bra...@apache.org
Subject svn commit: r382739 - in /db/jdo/trunk/tck20/src: conf/ java/org/apache/jdo/tck/ java/org/apache/jdo/tck/api/persistencecapable/ java/org/apache/jdo/tck/api/persistencemanager/cache/ java/org/apache/jdo/tck/lifecycle/ java/org/apache/jdo/tck/lifecycle/...
Date Fri, 03 Mar 2006 09:40:44 GMT
Author: brazil
Date: Fri Mar  3 01:40:43 2006
New Revision: 382739

URL: http://svn.apache.org/viewcvs?rev=382739&view=rev
Log:
JDO-311: Inheritance3 : should check if the JDO implementation supports javax.jdo.option.mapping.RelationSubclassTable

Modified:
    db/jdo/trunk/tck20/src/conf/inheritance1.conf
    db/jdo/trunk/tck20/src/conf/inheritance2.conf
    db/jdo/trunk/tck20/src/conf/inheritance3.conf
    db/jdo/trunk/tck20/src/java/org/apache/jdo/tck/JDO_Test.java
    db/jdo/trunk/tck20/src/java/org/apache/jdo/tck/api/persistencecapable/AbstractPersistenceCapableTest.java
    db/jdo/trunk/tck20/src/java/org/apache/jdo/tck/api/persistencemanager/cache/EvictingWithRetainValuesFalse.java
    db/jdo/trunk/tck20/src/java/org/apache/jdo/tck/lifecycle/HollowInstanceMaintainsPK.java
    db/jdo/trunk/tck20/src/java/org/apache/jdo/tck/lifecycle/nontransactional/ModificationOfNontransactionalInstanceOutsideTransaction.java
    db/jdo/trunk/tck20/src/java/org/apache/jdo/tck/mapping/CompletenessTest.java

Modified: db/jdo/trunk/tck20/src/conf/inheritance1.conf
URL: http://svn.apache.org/viewcvs/db/jdo/trunk/tck20/src/conf/inheritance1.conf?rev=382739&r1=382738&r2=382739&view=diff
==============================================================================
--- db/jdo/trunk/tck20/src/conf/inheritance1.conf (original)
+++ db/jdo/trunk/tck20/src/conf/inheritance1.conf Fri Mar  3 01:40:43 2006
@@ -5,4 +5,4 @@
 jdo.tck.classes = org.apache.jdo.tck.mapping.CompletenessTest
 jdo.tck.testdata = org/apache/jdo/tck/pc/company/companyAllRelationships.xml
 jdo.tck.mapping = 1
-jdo.tck.requiredOptions = 
+jdo.tck.requiredOptions = javax.jdo.option.mapping.JoinedTablePerClass

Modified: db/jdo/trunk/tck20/src/conf/inheritance2.conf
URL: http://svn.apache.org/viewcvs/db/jdo/trunk/tck20/src/conf/inheritance2.conf?rev=382739&r1=382738&r2=382739&view=diff
==============================================================================
--- db/jdo/trunk/tck20/src/conf/inheritance2.conf (original)
+++ db/jdo/trunk/tck20/src/conf/inheritance2.conf Fri Mar  3 01:40:43 2006
@@ -12,4 +12,5 @@
 jdo.tck.classes = org.apache.jdo.tck.mapping.CompletenessTest
 jdo.tck.testdata = org/apache/jdo/tck/pc/company/companyAllRelationships.xml
 jdo.tck.mapping = 2
-jdo.tck.requiredOptions = javax.jdo.option.UnionJoin
+jdo.tck.requiredOptions = javax.jdo.option.mapping.NonJoinedTablePerConcreteClass \
+                          javax.jdo.option.mapping.RelationSubclassTable

Modified: db/jdo/trunk/tck20/src/conf/inheritance3.conf
URL: http://svn.apache.org/viewcvs/db/jdo/trunk/tck20/src/conf/inheritance3.conf?rev=382739&r1=382738&r2=382739&view=diff
==============================================================================
--- db/jdo/trunk/tck20/src/conf/inheritance3.conf (original)
+++ db/jdo/trunk/tck20/src/conf/inheritance3.conf Fri Mar  3 01:40:43 2006
@@ -7,4 +7,5 @@
 jdo.tck.classes = org.apache.jdo.tck.mapping.CompletenessTest
 jdo.tck.testdata = org/apache/jdo/tck/pc/company/companyAllRelationships.xml
 jdo.tck.mapping = 3
-jdo.tck.requiredOptions = 
+jdo.tck.requiredOptions = javax.jdo.option.mapping.JoinedTablePerConcreteClass \
+                          javax.jdo.option.mapping.RelationSubclassTable

Modified: db/jdo/trunk/tck20/src/java/org/apache/jdo/tck/JDO_Test.java
URL: http://svn.apache.org/viewcvs/db/jdo/trunk/tck20/src/java/org/apache/jdo/tck/JDO_Test.java?rev=382739&r1=382738&r2=382739&view=diff
==============================================================================
--- db/jdo/trunk/tck20/src/java/org/apache/jdo/tck/JDO_Test.java (original)
+++ db/jdo/trunk/tck20/src/java/org/apache/jdo/tck/JDO_Test.java Fri Mar  3 01:40:43 2006
@@ -33,6 +33,7 @@
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Properties;
+import java.util.StringTokenizer;
 import java.util.Vector;
 
 import javax.jdo.Extent;
@@ -875,5 +876,32 @@
      */
     protected String getPMFProperty(String key) {
         return PMFPropertiesObject.getProperty(key);
+    }
+
+    /**
+     * Returns <code>true</code> if the implementation under test
+     * supports all JDO options contained in system property
+     * <code>jdo.tck.requiredOptions</code>.
+     * @return <code>true</code> if the implementation under test
+     * supports all JDO options contained in system property
+     * <code>jdo.tck.requiredOptions</code>
+     */
+    protected boolean isTestToBePerformed() {
+        boolean isTestToBePerformed = true;
+        String requiredOptions = System.getProperty("jdo.tck.requiredOptions");
+        Collection supportedOptions = getPMF().supportedOptions();
+        StringTokenizer tokenizer = new StringTokenizer(
+                requiredOptions, " ,;\n\r\t");
+        while (tokenizer.hasMoreTokens()) {
+            String requiredOption = tokenizer.nextToken();
+            logger.debug("Required option: " + requiredOption);
+            if (!requiredOption.equals("") &&
+                !supportedOptions.contains(requiredOption)) {
+                isTestToBePerformed = false;
+                printUnsupportedOptionalFeatureNotTested(
+                        getClass().getName(), requiredOption);
+            }
+        }
+        return isTestToBePerformed;
     }
 }

Modified: db/jdo/trunk/tck20/src/java/org/apache/jdo/tck/api/persistencecapable/AbstractPersistenceCapableTest.java
URL: http://svn.apache.org/viewcvs/db/jdo/trunk/tck20/src/java/org/apache/jdo/tck/api/persistencecapable/AbstractPersistenceCapableTest.java?rev=382739&r1=382738&r2=382739&view=diff
==============================================================================
--- db/jdo/trunk/tck20/src/java/org/apache/jdo/tck/api/persistencecapable/AbstractPersistenceCapableTest.java
(original)
+++ db/jdo/trunk/tck20/src/java/org/apache/jdo/tck/api/persistencecapable/AbstractPersistenceCapableTest.java
Fri Mar  3 01:40:43 2006
@@ -46,9 +46,7 @@
     }
     
     protected boolean isTestToBePerformed() {
-        int index = getClass().getName().lastIndexOf('.');
-        String testName = index==-1 ? 
-                getClass().getName() : getClass().getName().substring(index+1);
+        String testName = getClass().getName();
         if (!isBinaryCompatibilitySupported()) {
             printUnsupportedOptionalFeatureNotTested(
                     testName, "javax.jdo.option.BinaryCompatibility");

Modified: db/jdo/trunk/tck20/src/java/org/apache/jdo/tck/api/persistencemanager/cache/EvictingWithRetainValuesFalse.java
URL: http://svn.apache.org/viewcvs/db/jdo/trunk/tck20/src/java/org/apache/jdo/tck/api/persistencemanager/cache/EvictingWithRetainValuesFalse.java?rev=382739&r1=382738&r2=382739&view=diff
==============================================================================
--- db/jdo/trunk/tck20/src/java/org/apache/jdo/tck/api/persistencemanager/cache/EvictingWithRetainValuesFalse.java
(original)
+++ db/jdo/trunk/tck20/src/java/org/apache/jdo/tck/api/persistencemanager/cache/EvictingWithRetainValuesFalse.java
Fri Mar  3 01:40:43 2006
@@ -72,7 +72,8 @@
     public void test() {
 
 	    if (!isRetainValuesSupported()) {
-    		printUnsupportedOptionalFeatureNotTested("EvictingWithRetainValuesFalse", "javax.jdo.option.RetainValues");
+    		printUnsupportedOptionalFeatureNotTested(
+                    getClass().getName(), "javax.jdo.option.RetainValues");
 	    }
 		else
 		{

Modified: db/jdo/trunk/tck20/src/java/org/apache/jdo/tck/lifecycle/HollowInstanceMaintainsPK.java
URL: http://svn.apache.org/viewcvs/db/jdo/trunk/tck20/src/java/org/apache/jdo/tck/lifecycle/HollowInstanceMaintainsPK.java?rev=382739&r1=382738&r2=382739&view=diff
==============================================================================
--- db/jdo/trunk/tck20/src/java/org/apache/jdo/tck/lifecycle/HollowInstanceMaintainsPK.java
(original)
+++ db/jdo/trunk/tck20/src/java/org/apache/jdo/tck/lifecycle/HollowInstanceMaintainsPK.java
Fri Mar  3 01:40:43 2006
@@ -59,11 +59,11 @@
     public void test() {
         if (!isApplicationIdentitySupported()) {
             printUnsupportedOptionalFeatureNotTested(
-                    "HollowInstanceMaintainsPK", 
+                    getClass().getName(), 
                     "javax.jdo.option.ApplicationIdentity");
         } else if (!runsWithApplicationIdentity()) {
             printNonApplicableIdentityType(
-                    "HollowInstanceMaintainsPK", 
+                    getClass().getName(), 
                     "javax.jdo.option.ApplicationIdentity");
         }
         else {

Modified: db/jdo/trunk/tck20/src/java/org/apache/jdo/tck/lifecycle/nontransactional/ModificationOfNontransactionalInstanceOutsideTransaction.java
URL: http://svn.apache.org/viewcvs/db/jdo/trunk/tck20/src/java/org/apache/jdo/tck/lifecycle/nontransactional/ModificationOfNontransactionalInstanceOutsideTransaction.java?rev=382739&r1=382738&r2=382739&view=diff
==============================================================================
--- db/jdo/trunk/tck20/src/java/org/apache/jdo/tck/lifecycle/nontransactional/ModificationOfNontransactionalInstanceOutsideTransaction.java
(original)
+++ db/jdo/trunk/tck20/src/java/org/apache/jdo/tck/lifecycle/nontransactional/ModificationOfNontransactionalInstanceOutsideTransaction.java
Fri Mar  3 01:40:43 2006
@@ -81,7 +81,8 @@
     public void testDifferentPM() {
         if (!isNontransactionalWriteSupported()) {
             printUnsupportedOptionalFeatureNotTested(
-                "NontransactionalWrite", "testDifferentPM");
+                    getClass().getName(), 
+                    "javax.jdo.option.NontransactionalWrite");
         }
         else {
             pm = getPM();
@@ -128,7 +129,8 @@
     public void testSameInstance() {
         if (!isNontransactionalWriteSupported()) {
             printUnsupportedOptionalFeatureNotTested(
-                "NontransactionalWrite", "testDifferentPM");
+                    getClass().getName(), 
+                    "javax.jdo.option.NontransactionalWrite");
         }
         else {
             pm = getPM();
@@ -151,7 +153,8 @@
     public void testIterateExtent() {
         if (!isNontransactionalWriteSupported()) {
             printUnsupportedOptionalFeatureNotTested(
-                "NontransactionalWrite", "testDifferentPM");
+                    getClass().getName(), 
+                    "javax.jdo.option.NontransactionalWrite");
         }
         else {
             pm = getPM();

Modified: db/jdo/trunk/tck20/src/java/org/apache/jdo/tck/mapping/CompletenessTest.java
URL: http://svn.apache.org/viewcvs/db/jdo/trunk/tck20/src/java/org/apache/jdo/tck/mapping/CompletenessTest.java?rev=382739&r1=382738&r2=382739&view=diff
==============================================================================
--- db/jdo/trunk/tck20/src/java/org/apache/jdo/tck/mapping/CompletenessTest.java (original)
+++ db/jdo/trunk/tck20/src/java/org/apache/jdo/tck/mapping/CompletenessTest.java Fri Mar 
3 01:40:43 2006
@@ -17,10 +17,8 @@
 package org.apache.jdo.tck.mapping;
 
 import java.util.ArrayList;
-import java.util.Collection;
 import java.util.Iterator;
 import java.util.List;
-import java.util.StringTokenizer;
 
 import org.apache.jdo.tck.JDO_Test;
 import org.apache.jdo.tck.pc.company.CompanyFactoryRegistry;
@@ -48,9 +46,13 @@
         "Assertion A18-[not identified] failed: ";
     
     /** */
+    private final boolean isTestToBePerformed = isTestToBePerformed();
+    
+    /** */
     protected List rootOids;
     
-    protected String inputFilename = System.getProperty("jdo.tck.testdata");
+    /** */
+    protected final String inputFilename = System.getProperty("jdo.tck.testdata");
     
     /**
      * The <code>main</code> is called when the class
@@ -61,31 +63,11 @@
         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 (!token.equals("") &&
-                !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;
-            }
-        }
-        return isTestToBePerformed;
-    }
-    
     /**
      * @see JDO_Test#localSetUp()
      */
     protected void localSetUp() {
-        if (isTestToBePerformed()) {
+        if (isTestToBePerformed) {
             addTearDownClass(CompanyModelReader.getTearDownClasses());
             getPM();
             CompanyFactoryRegistry.registerFactory(pm);
@@ -106,7 +88,7 @@
 
     /** */
     public void test() {
-        if (isTestToBePerformed()) {
+        if (isTestToBePerformed) {
             // register the default factory
             CompanyFactoryRegistry.registerFactory();
             // get new obj graph to compare persistent graph with



Mime
View raw message