db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kmars...@apache.org
Subject svn commit: r1161208 - in /db/derby/code/trunk/java/testing/org/apache/derbyTesting: functionTests/tests/store/BootLockTest.java functionTests/tests/store/RecoveryTest.java junit/BaseTestCase.java
Date Wed, 24 Aug 2011 17:30:23 GMT
Author: kmarsden
Date: Wed Aug 24 17:30:23 2011
New Revision: 1161208

URL: http://svn.apache.org/viewvc?rev=1161208&view=rev
Log:
DERBY-4647 BaseTestCase.execJavaCmd() does not work with weme 6.2

Fix execJavaCmd to pass  -jcl:foun11. Enable BootLockTest and RecoveryTest  with weme. Changed
BootLockTest to only force the database lock with PhoneME, not weme (j9)



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

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=1161208&r1=1161207&r2=1161208&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
Wed Aug 24 17:30:23 2011
@@ -93,12 +93,6 @@ public class BootLockTest extends BaseJD
      */
     public static Test suite() {
         TestSuite suite = new TestSuite("BootLockTest");
-
-        if (BaseTestCase.isJ9Platform()) {
-            // forking currently not working, cf. DERBY-4179.
-            return suite;
-        }
-
         suite.addTest(decorateTest());
         return suite;
     }
@@ -113,7 +107,8 @@ public class BootLockTest extends BaseJD
 
         Test test = new TestSuite(BootLockTest.class);
 
-        if (JDBC.vmSupportsJSR169()) {
+        if (JDBC.vmSupportsJSR169() && !isJ9Platform()) {
+            // PhoneME requires forceDatabaseLock
             Properties props = new Properties();
             props.setProperty("derby.database.forceDatabaseLock", "true");
             test = new SystemPropertyTestSetup(test, props, true);
@@ -140,7 +135,8 @@ public class BootLockTest extends BaseJD
             Connection c = getConnection();
             fail("Dual boot not detected: check BootLockMinion.log");
         } catch (SQLException e) {
-            if (JDBC.vmSupportsJSR169()) {
+            if (JDBC.vmSupportsJSR169() && !isJ9Platform()) {
+                // For PhoneME force database lock required
                 assertSQLState(
                         "Dual boot not detected: check BootLockMinion.log",
                         DATA_MULTIPLE_JBMS_FORCE_LOCK,

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/RecoveryTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/RecoveryTest.java?rev=1161208&r1=1161207&r2=1161208&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/RecoveryTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/RecoveryTest.java
Wed Aug 24 17:30:23 2011
@@ -51,9 +51,6 @@ public final class RecoveryTest extends 
     {
         // Add the test case into the test suite
         TestSuite suite = new TestSuite("RecoveryTest");
-        //DERBY-4647 exec does not work on weme
-        if (BaseTestCase.isJ9Platform())
-            return suite;
         suite.addTest(decorateTest());
         return suite;
     }

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/BaseTestCase.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/BaseTestCase.java?rev=1161208&r1=1161207&r2=1161208&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/BaseTestCase.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/BaseTestCase.java Wed Aug
24 17:30:23 2011
@@ -46,6 +46,7 @@ import java.security.PrivilegedAction;
 import java.security.PrivilegedExceptionAction;
 
 import java.security.PrivilegedActionException;
+import java.util.ArrayList;
 
 
 /**
@@ -537,15 +538,16 @@ public abstract class BaseTestCase
 	 * @throws IOException
 	 */
 	public static Process execJavaCmd(String[] cmd) throws IOException {
-	    int totalSize = 3 + cmd.length;
-	    String[] tcmd = new String[totalSize];
-	    tcmd[0] = getJavaExecutableName();
-	    tcmd[1] = "-classpath";
-	    tcmd[2] = BaseTestCase.getSystemProperty("java.class.path");
-
-	    System.arraycopy(cmd, 0, tcmd, 3, cmd.length);
-
-	    final String[] command = tcmd;
+	    ArrayList cmdlist = new ArrayList();
+	    cmdlist.add(getJavaExecutableName());
+	    if (isJ9Platform())
+	        cmdlist.add("-jcl:foun11");
+	    cmdlist.add("-classpath");
+	    cmdlist.add(getSystemProperty("java.class.path"));
+	    for (int i =0; i < cmd.length;i++) {
+	        cmdlist.add(cmd[i]);
+	    }
+	    final String[] command = (String[]) cmdlist.toArray(cmd);
 	    println("execute java command:");
 	    for (int i = 0; i < command.length; i++) {
 	        println("command[" + i + "]" + command[i]);



Mime
View raw message