You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jdo-commits@db.apache.org by mc...@apache.org on 2005/05/12 23:03:46 UTC

svn commit: r169885 - in /incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager: ./ cache/ close/ extent/ getobject/ lifecycle/

Author: mcaisse
Date: Thu May 12 14:03:45 2005
New Revision: 169885

URL: http://svn.apache.org/viewcvs?rev=169885&view=rev
Log:
JDO-40, JDO-41: several failure to cleanup problems

Modified:
    incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/ConcurrentPersistenceManagersSameClasses.java
    incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/ObjectIdUniqueAmongInstances.java
    incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/OneInstanceOfObjectPerPersistenceManager.java
    incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/PersistenceManagerTest.java
    incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/cache/EvictingWithRestoreValuesFalse.java
    incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/cache/EvictingWithRetainValuesFalse.java
    incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/cache/RefreshAllWithNoParameters.java
    incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/cache/Retrieve.java
    incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/close/CloseThrowsExceptionWhenActiveTx.java
    incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/extent/GetExtentWithInstancesMadePersistentViaReachability.java
    incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/extent/GetExtentWithSubclasses.java
    incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/getobject/GetObjectByIdWithValidationInstanceNotInCacheNotInDatastore.java
    incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/lifecycle/MakePersistentAndInstancesNotReachable.java

Modified: incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/ConcurrentPersistenceManagersSameClasses.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/ConcurrentPersistenceManagersSameClasses.java?rev=169885&r1=169884&r2=169885&view=diff
==============================================================================
--- incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/ConcurrentPersistenceManagersSameClasses.java (original)
+++ incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/ConcurrentPersistenceManagersSameClasses.java Thu May 12 14:03:45 2005
@@ -27,7 +27,6 @@
 import javax.jdo.Query;
 import javax.jdo.Transaction;
 
-import org.apache.jdo.tck.JDO_Test;
 import org.apache.jdo.tck.pc.mylib.PCPoint;
 import org.apache.jdo.tck.pc.mylib.PCRect;
 import org.apache.jdo.tck.util.BatchTestRunner;
@@ -45,7 +44,7 @@
 
  */
 
-public class ConcurrentPersistenceManagersSameClasses extends JDO_Test {
+public class ConcurrentPersistenceManagersSameClasses extends PersistenceManagerTest {
 
     /** */
     private static final String ASSERTION_FAILED = 

Modified: incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/ObjectIdUniqueAmongInstances.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/ObjectIdUniqueAmongInstances.java?rev=169885&r1=169884&r2=169885&view=diff
==============================================================================
--- incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/ObjectIdUniqueAmongInstances.java (original)
+++ incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/ObjectIdUniqueAmongInstances.java Thu May 12 14:03:45 2005
@@ -22,7 +22,6 @@
 
 import javax.jdo.Transaction;
 
-import org.apache.jdo.tck.JDO_Test;
 import org.apache.jdo.tck.pc.mylib.PCPoint;
 import org.apache.jdo.tck.util.BatchTestRunner;
 
@@ -41,7 +40,7 @@
 
  */
 
-public class ObjectIdUniqueAmongInstances extends JDO_Test {
+public class ObjectIdUniqueAmongInstances extends PersistenceManagerTest {
     
     /** */
     private static final String ASSERTION_FAILED = 

Modified: incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/OneInstanceOfObjectPerPersistenceManager.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/OneInstanceOfObjectPerPersistenceManager.java?rev=169885&r1=169884&r2=169885&view=diff
==============================================================================
--- incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/OneInstanceOfObjectPerPersistenceManager.java (original)
+++ incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/OneInstanceOfObjectPerPersistenceManager.java Thu May 12 14:03:45 2005
@@ -23,7 +23,6 @@
 import javax.jdo.Query;
 import javax.jdo.Transaction;
 
-import org.apache.jdo.tck.JDO_Test;
 import org.apache.jdo.tck.pc.mylib.PCPoint;
 import org.apache.jdo.tck.pc.mylib.PCRect;
 import org.apache.jdo.tck.util.BatchTestRunner;
@@ -43,7 +42,7 @@
 
  */
 
-public class OneInstanceOfObjectPerPersistenceManager extends JDO_Test {
+public class OneInstanceOfObjectPerPersistenceManager extends PersistenceManagerTest {
     
     /** */
     private static final String ASSERTION_FAILED = 

Modified: incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/PersistenceManagerTest.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/PersistenceManagerTest.java?rev=169885&r1=169884&r2=169885&view=diff
==============================================================================
--- incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/PersistenceManagerTest.java (original)
+++ incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/PersistenceManagerTest.java Thu May 12 14:03:45 2005
@@ -25,6 +25,8 @@
 import javax.jdo.Transaction;
 
 import org.apache.jdo.tck.JDO_Test;
+import org.apache.jdo.tck.pc.company.Company;
+import org.apache.jdo.tck.pc.company.Department;
 import org.apache.jdo.tck.pc.mylib.PCPoint;
 import org.apache.jdo.tck.pc.mylib.PCPoint2;
 import org.apache.jdo.tck.pc.mylib.PCRect;
@@ -40,6 +42,7 @@
         try {
             cleanup();
             cleanupMylib();
+            cleanupCompany();
         }
         catch (Throwable ex) {
             cleanupFailure = ex;
@@ -69,6 +72,28 @@
             Collection c = getAllObjects(pm, PCRect.class);
             pm.deletePersistentAll(c);
             c = getAllObjects(pm, PCPoint.class);
+            pm.deletePersistentAll(c);
+            tx.commit();
+        }
+        finally {
+            if ((tx != null) && tx.isActive())
+                tx.rollback();
+            if ((pm != null) && pm.isClosed())
+                pm.close();
+        }
+  }
+
+     /** */
+    protected void cleanupCompany() {
+        PersistenceManager pm = getPM();
+        Transaction tx = null;
+        try {
+            pm = pmf.getPersistenceManager();
+            tx = pm.currentTransaction();
+            tx.begin();
+            Collection c = getAllObjects(pm, Department.class);
+            pm.deletePersistentAll(c);
+            c = getAllObjects(pm, Company.class);
             pm.deletePersistentAll(c);
             tx.commit();
         }

Modified: incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/cache/EvictingWithRestoreValuesFalse.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/cache/EvictingWithRestoreValuesFalse.java?rev=169885&r1=169884&r2=169885&view=diff
==============================================================================
--- incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/cache/EvictingWithRestoreValuesFalse.java (original)
+++ incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/cache/EvictingWithRestoreValuesFalse.java Thu May 12 14:03:45 2005
@@ -21,7 +21,6 @@
 import javax.jdo.Transaction;
 
 import org.apache.jdo.tck.api.persistencemanager.PersistenceManagerTest;
-import org.apache.jdo.tck.JDO_Test;
 import org.apache.jdo.tck.pc.mylib.PCPoint2;
 import org.apache.jdo.tck.util.BatchTestRunner;
 
@@ -46,7 +45,7 @@
 
  */
 
-public class EvictingWithRestoreValuesFalse extends JDO_Test {
+public class EvictingWithRestoreValuesFalse extends PersistenceManagerTest {
 
     /** */
     private static final String ASSERTION_FAILED = 

Modified: incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/cache/EvictingWithRetainValuesFalse.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/cache/EvictingWithRetainValuesFalse.java?rev=169885&r1=169884&r2=169885&view=diff
==============================================================================
--- incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/cache/EvictingWithRetainValuesFalse.java (original)
+++ incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/cache/EvictingWithRetainValuesFalse.java Thu May 12 14:03:45 2005
@@ -20,7 +20,7 @@
 import javax.jdo.PersistenceManager;
 import javax.jdo.Transaction;
 
-import org.apache.jdo.tck.JDO_Test;
+import org.apache.jdo.tck.api.persistencemanager.PersistenceManagerTest;
 import org.apache.jdo.tck.pc.mylib.PCPoint2;
 import org.apache.jdo.tck.util.BatchTestRunner;
 
@@ -45,7 +45,7 @@
 
  */
 
-public class EvictingWithRetainValuesFalse extends JDO_Test {
+public class EvictingWithRetainValuesFalse extends PersistenceManagerTest {
 
     /** */
     private static final String ASSERTION_FAILED = 

Modified: incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/cache/RefreshAllWithNoParameters.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/cache/RefreshAllWithNoParameters.java?rev=169885&r1=169884&r2=169885&view=diff
==============================================================================
--- incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/cache/RefreshAllWithNoParameters.java (original)
+++ incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/cache/RefreshAllWithNoParameters.java Thu May 12 14:03:45 2005
@@ -20,7 +20,7 @@
 import javax.jdo.PersistenceManager;
 import javax.jdo.Transaction;
 
-import org.apache.jdo.tck.JDO_Test;
+import org.apache.jdo.tck.api.persistencemanager.PersistenceManagerTest;
 import org.apache.jdo.tck.pc.mylib.PCPoint;
 import org.apache.jdo.tck.util.BatchTestRunner;
 
@@ -47,7 +47,7 @@
 
  */
 
-public class RefreshAllWithNoParameters extends JDO_Test {
+public class RefreshAllWithNoParameters extends PersistenceManagerTest {
     
     /** */
     private static final String ASSERTION_FAILED = 

Modified: incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/cache/Retrieve.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/cache/Retrieve.java?rev=169885&r1=169884&r2=169885&view=diff
==============================================================================
--- incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/cache/Retrieve.java (original)
+++ incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/cache/Retrieve.java Thu May 12 14:03:45 2005
@@ -23,7 +23,7 @@
 import javax.jdo.PersistenceManager;
 import javax.jdo.Transaction;
 
-import org.apache.jdo.tck.JDO_Test;
+import org.apache.jdo.tck.api.persistencemanager.PersistenceManagerTest;
 
 import org.apache.jdo.tck.pc.mylib.PCPoint;
 import org.apache.jdo.tck.pc.mylib.PCPoint2;
@@ -48,7 +48,7 @@
 and if the class of the instance implements InstanceCallbacks calls jdoPostLoad.
  */
 
-public class Retrieve extends JDO_Test {
+public class Retrieve extends PersistenceManagerTest {
 
     /** */
     private static final String ASSERTION_FAILED = 

Modified: incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/close/CloseThrowsExceptionWhenActiveTx.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/close/CloseThrowsExceptionWhenActiveTx.java?rev=169885&r1=169884&r2=169885&view=diff
==============================================================================
--- incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/close/CloseThrowsExceptionWhenActiveTx.java (original)
+++ incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/close/CloseThrowsExceptionWhenActiveTx.java Thu May 12 14:03:45 2005
@@ -20,7 +20,7 @@
 import javax.jdo.PersistenceManager;
 import javax.jdo.Transaction;
 
-import org.apache.jdo.tck.JDO_Test;
+import org.apache.jdo.tck.api.persistencemanager.PersistenceManagerTest;
 import org.apache.jdo.tck.util.BatchTestRunner;
 
 /**
@@ -34,7 +34,7 @@
 In a non-managed environment, if the current transaction is active, close throws JDOUserException.
  */
 
-public class CloseThrowsExceptionWhenActiveTx extends JDO_Test {
+public class CloseThrowsExceptionWhenActiveTx extends PersistenceManagerTest {
     
     /** */
     private static final String ASSERTION_FAILED = 

Modified: incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/extent/GetExtentWithInstancesMadePersistentViaReachability.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/extent/GetExtentWithInstancesMadePersistentViaReachability.java?rev=169885&r1=169884&r2=169885&view=diff
==============================================================================
--- incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/extent/GetExtentWithInstancesMadePersistentViaReachability.java (original)
+++ incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/extent/GetExtentWithInstancesMadePersistentViaReachability.java Thu May 12 14:03:45 2005
@@ -23,7 +23,7 @@
 import javax.jdo.PersistenceManager;
 import javax.jdo.Transaction;
 
-import org.apache.jdo.tck.JDO_Test;
+import org.apache.jdo.tck.api.persistencemanager.PersistenceManagerTest;
 
 import org.apache.jdo.tck.pc.company.Company;
 import org.apache.jdo.tck.pc.company.Department;
@@ -42,7 +42,7 @@
 If an instance of a class or interface that has a managed extent is made persistent via reachability, the instance is put into the extent implicitly.
  */
 
-public class GetExtentWithInstancesMadePersistentViaReachability extends JDO_Test {
+public class GetExtentWithInstancesMadePersistentViaReachability extends PersistenceManagerTest {
 
     /** */
     private static final String ASSERTION_FAILED = 

Modified: incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/extent/GetExtentWithSubclasses.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/extent/GetExtentWithSubclasses.java?rev=169885&r1=169884&r2=169885&view=diff
==============================================================================
--- incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/extent/GetExtentWithSubclasses.java (original)
+++ incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/extent/GetExtentWithSubclasses.java Thu May 12 14:03:45 2005
@@ -23,7 +23,7 @@
 import javax.jdo.PersistenceManager;
 import javax.jdo.Transaction;
 
-import org.apache.jdo.tck.JDO_Test;
+import org.apache.jdo.tck.api.persistencemanager.PersistenceManagerTest;
 
 import org.apache.jdo.tck.pc.company.Person;
 import org.apache.jdo.tck.pc.company.Employee;
@@ -43,7 +43,7 @@
 The getExtent method returns an Extent that contains all of the instances in the parameter class or interface, and if the subclasses flag is true, all of the instances of the parameter class and its subclasses.
  */
 
-public class GetExtentWithSubclasses extends JDO_Test {
+public class GetExtentWithSubclasses extends PersistenceManagerTest {
 
     /** */
     private static final String ASSERTION_FAILED = 

Modified: incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/getobject/GetObjectByIdWithValidationInstanceNotInCacheNotInDatastore.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/getobject/GetObjectByIdWithValidationInstanceNotInCacheNotInDatastore.java?rev=169885&r1=169884&r2=169885&view=diff
==============================================================================
--- incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/getobject/GetObjectByIdWithValidationInstanceNotInCacheNotInDatastore.java (original)
+++ incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/getobject/GetObjectByIdWithValidationInstanceNotInCacheNotInDatastore.java Thu May 12 14:03:45 2005
@@ -20,7 +20,7 @@
 import javax.jdo.PersistenceManager;
 import javax.jdo.Transaction;
 
-import org.apache.jdo.tck.JDO_Test;
+import org.apache.jdo.tck.api.persistencemanager.PersistenceManagerTest;
 import org.apache.jdo.tck.pc.mylib.PCPoint;
 import org.apache.jdo.tck.util.BatchTestRunner;
 
@@ -35,7 +35,7 @@
 Object getObjectById (Object oid, boolean validate) with validate==true. If the instance does not exist in the datastore, then a JDOObjectNotFoundException is thrown.
  */
 
-public class GetObjectByIdWithValidationInstanceNotInCacheNotInDatastore extends JDO_Test {
+public class GetObjectByIdWithValidationInstanceNotInCacheNotInDatastore extends PersistenceManagerTest {
 
     /** */
     private static final String ASSERTION_FAILED = 

Modified: incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/lifecycle/MakePersistentAndInstancesNotReachable.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/lifecycle/MakePersistentAndInstancesNotReachable.java?rev=169885&r1=169884&r2=169885&view=diff
==============================================================================
--- incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/lifecycle/MakePersistentAndInstancesNotReachable.java (original)
+++ incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/lifecycle/MakePersistentAndInstancesNotReachable.java Thu May 12 14:03:45 2005
@@ -23,8 +23,6 @@
 import javax.jdo.PersistenceManager;
 import javax.jdo.Transaction;
 
-import org.apache.jdo.tck.JDO_Test;
-
 import org.apache.jdo.tck.pc.company.Company;
 import org.apache.jdo.tck.pc.company.Department;
 import org.apache.jdo.tck.pc.company.Address;
@@ -49,7 +47,7 @@
 currently reachable from persistent instances will revert to transient.
  */
 
-public class MakePersistentAndInstancesNotReachable extends JDO_Test {
+public class MakePersistentAndInstancesNotReachable extends PersistenceManagerTest {
 
     /** */
     private static final String ASSERTION_FAILED =