db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r942587 - in /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store: BootLockMinion.java BootLockTest.java
Date Sun, 09 May 2010 19:19:32 GMT
Author: dag
Date: Sun May  9 19:19:32 2010
New Revision: 942587

URL: http://svn.apache.org/viewvc?rev=942587&view=rev
Log:
DERBY-4179 bootLock.java fails with missing exception on z/OS with pmz3160sr2ifix-20081021_01(SR2+IZ32776+IZ33456),
and Windows Vista

Follow-up simplification patch, which replaces the home-grown system
property setup/teardown code with the standard
SystemPropertyTestSetup.


Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/BootLockMinion.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/BootLockTest.java

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/BootLockMinion.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/BootLockMinion.java?rev=942587&r1=942586&r2=942587&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/BootLockMinion.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/BootLockMinion.java
Sun May  9 19:19:32 2010
@@ -31,12 +31,9 @@ import org.apache.derby.jdbc.EmbeddedSim
  * Create and boot the supplied db argument. This auxiliary program is used by
  * {@code BootLockTest.java} to boot a db in a different jvm and subsequently
  * attempt a boot to from the original VM to detect dual boot attempt.
-* <p>
- * You can verify this subprogram by invoking it directly as:
- * </p>
- * <p>
- * {@code java org.apache.derbyTesting.functionTests.tests.store.BootLockMinion <dbname>}
- * </p>
+ * <p/>
+ * Started as:
+ * {@code java org.apache.derbyTesting.functionTests.tests.store.BootLockMinion <dbname>
<port>}
  */
 
 public class BootLockMinion {

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/BootLockTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/BootLockTest.java?rev=942587&r1=942586&r2=942587&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/BootLockTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/BootLockTest.java
Sun May  9 19:19:32 2010
@@ -29,6 +29,7 @@ import java.sql.SQLException;
 import java.net.SocketTimeoutException;
 import java.net.ServerSocket;
 import java.net.Socket;
+import java.util.Properties;
 
 import junit.framework.Test;
 import junit.framework.TestSuite;
@@ -38,7 +39,7 @@ import org.apache.derbyTesting.junit.Bas
 import org.apache.derbyTesting.junit.SecurityManagerSetup;
 import org.apache.derbyTesting.junit.TestConfiguration;
 import org.apache.derbyTesting.junit.JDBC;
-import org.apache.derbyTesting.junit.DatabasePropertyTestSetup;
+import org.apache.derbyTesting.junit.SystemPropertyTestSetup;
 
 import org.apache.derby.iapi.store.raw.data.DataFactory;
 
@@ -102,55 +103,17 @@ public class BootLockTest extends BaseJD
 
         Test test = new TestSuite(BootLockTest.class);
 
-        test = TestConfiguration.singleUseDatabaseDecorator(test, dbName);
-
-        test = SecurityManagerSetup.noSecurityManager(test);
-
-        return test;
-    }
-
-    String oldPropValue = null;
-
-    protected void setUp() throws Exception {
-
-        super.setUp();
-
-        // For phoneMe, we won't see DATA_MULTIPLE_JBMS_ON_DB, but instead we
-        // can check that we get DATA_MULTIPLE_JBMS_FORCE_LOCK if we set
-        // derby.database.forceDatabaseLock.
-
         if (JDBC.vmSupportsJSR169()) {
-            // Can't use the DatabasePropertyTestSetup.singleProperty, since
-            // that method sets a database property (not a system property),
-            // and the minion is the one creating the database here. An
-            // alternative would be to let minion set it.
-
-            oldPropValue =
-                System.getProperty("derby.database.forceDatabaseLock");
-            System.setProperty("derby.database.forceDatabaseLock", "true");
+            Properties props = new Properties();
+            props.setProperty("derby.database.forceDatabaseLock", "true");
+            test = new SystemPropertyTestSetup(test, props, true);
         }
-    }
-
-
-    protected void tearDown() throws Exception {
-
-        if (JDBC.vmSupportsJSR169()) {
-
-            if (oldPropValue != null) {
-                System.setProperty("derby.database.forceDatabaseLock",
-                                   oldPropValue);
-            } else {
-                // FIXME: Java 1.5 only: improve code when we move to that
-                // source level.
-                // System.clearProperty("derby.database.forceDatabaseLock");
-                System.setProperty("derby.database.forceDatabaseLock",
-                                   "false");
-            }
 
+        test = TestConfiguration.singleUseDatabaseDecorator(test, dbName);
 
-        }
+        test = SecurityManagerSetup.noSecurityManager(test);
 
-        super.tearDown();
+        return test;
     }
 
 



Mime
View raw message