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 mb...@apache.org on 2005/09/13 11:06:08 UTC

svn commit: r280521 - in /incubator/jdo/trunk/tck20: maven.xml project.properties test/java/org/apache/jdo/tck/JDO_Test.java

Author: mbo
Date: Tue Sep 13 02:05:50 2005
New Revision: 280521

URL: http://svn.apache.org/viewcvs?rev=280521&view=rev
Log:
Fix JDO-131: Added a system property to turn off clean-up after test.
Changes provided by Karan Malhi.

Modified:
    incubator/jdo/trunk/tck20/maven.xml
    incubator/jdo/trunk/tck20/project.properties
    incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/JDO_Test.java

Modified: incubator/jdo/trunk/tck20/maven.xml
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/maven.xml?rev=280521&r1=280520&r2=280521&view=diff
==============================================================================
--- incubator/jdo/trunk/tck20/maven.xml (original)
+++ incubator/jdo/trunk/tck20/maven.xml Tue Sep 13 02:05:50 2005
@@ -42,6 +42,7 @@
         <echo>  -Djdo.tck.cfglist=xxx - a list of configuration files (must be in test/conf)</echo>
         <echo>  -Djdo.tck.dblist=xxx - a list of databases</echo>
         <echo>  -Djdo.tck.identitytypes=xxx - a list of identity types (applicationidentity, datastoreidentity)</echo>
+        <echo>  -Djdo.tck.cleanupaftertest=xxx - true/false. Setting it to false will retain data in database after test. This will allow inspection of data after test is run. Default is true</echo>
         <echo></echo>
         <echo>Examples:</echo>
         <echo>  maven -Djdo.tck.identitytypes=datastoreidentity installSchema</echo>
@@ -314,6 +315,8 @@
                          value="${jdo.tck.exclude}"/>
             <sysproperty key="jdo.tck.log.directory"
                          value="${jdo.tck.log.directory}/${timestamp}"/>
+            <sysproperty key="jdo.tck.cleanupaftertest"
+                         value="${jdo.tck.cleanupaftertest}"/>             
             <jvmarg line="${database.runtck.sysproperties}"/>
             <jvmarg line="${iut.runtck.sysproperties}"/>
             <arg line="${jdo.tck.classes}"/>
@@ -361,6 +364,8 @@
                          value="${jdo.tck.exclude}"/>
             <sysproperty key="jdo.tck.log.directory"
                          value="${jdo.tck.log.directory}/${timestamp}"/>
+            <sysproperty key="jdo.tck.cleanupaftertest"
+                         value="${jdo.tck.cleanupaftertest}"/>                         
             <jvmarg line="${database.runtck.sysproperties}"/>
             <jvmarg line="${jdo.runtck.sysproperties}"/>
             <arg line="${jdo.tck.classes}"/>

Modified: incubator/jdo/trunk/tck20/project.properties
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/project.properties?rev=280521&r1=280520&r2=280521&view=diff
==============================================================================
--- incubator/jdo/trunk/tck20/project.properties (original)
+++ incubator/jdo/trunk/tck20/project.properties Tue Sep 13 02:05:50 2005
@@ -44,6 +44,8 @@
 PMFProperties = jdori.properties
 
 # JDO TCK settings
+# Setting this property to false will turn off cleanup of data from database to inspect database contents after test run
+jdo.tck.cleanupaftertest = true
 jdo.tck.dblist=derby
 jdo.tck.identitytypes=applicationidentity datastoreidentity
 jdo.tck.testclasses.dir = ${maven.build.dir}/classes

Modified: incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/JDO_Test.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/JDO_Test.java?rev=280521&r1=280520&r2=280521&view=diff
==============================================================================
--- incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/JDO_Test.java (original)
+++ incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/JDO_Test.java Tue Sep 13 02:05:50 2005
@@ -134,9 +134,16 @@
      */
     protected final String identitytype = System.getProperty("jdo.tck.identitytype");
 
-    /** Name of the file contaninig the properties for the PMF. */
+    /** Name of the file containing the properties for the PMF. */
     protected static String PMFProperties = System.getProperty("PMFProperties");
 
+    /** Flag indicating whether to clean up data after tests or not.
+     * If false then test will not clean up data from database.
+     * The default value is true.
+     */
+    protected static boolean cleanupData = 
+       System.getProperty("jdo.tck.cleanupaftertest", "true").equalsIgnoreCase("true");
+    
     /** The Properties object for the PersistenceManagerFactory. */
     protected static Properties PMFPropertiesObject;
 
@@ -260,7 +267,9 @@
             pmf = null;
         
         try {
-            localTearDown();
+            if (cleanupData) {
+                localTearDown();
+            }
         } 
         catch (Throwable t) {
             setTearDownThrowable("localTearDown", t);