You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by km...@apache.org on 2010/06/03 01:24:15 UTC

svn commit: r950818 - in /db/derby/code/trunk/java/testing/org/apache/derbyTesting: functionTests/tests/store/Derby151Test.java junit/BaseTestCase.java

Author: kmarsden
Date: Wed Jun  2 23:24:15 2010
New Revision: 950818

URL: http://svn.apache.org/viewvc?rev=950818&view=rev
Log:
DERBY-4667 BootLockTest.testBootLock() sometimes fails with connection refused.

Move the vm logic for Derby151Test outside of the fixture so network server won't start if no tests are run.  This may not correct the problem and even if it does may be a fragile fix, but it giving it a try to see if the prior test Derby151Test is interfering if no fixtures are run but network server is stopped and started.



Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/Derby151Test.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/Derby151Test.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/Derby151Test.java?rev=950818&r1=950817&r2=950818&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/Derby151Test.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/Derby151Test.java Wed Jun  2 23:24:15 2010
@@ -62,19 +62,9 @@ public class Derby151Test extends BaseJD
             // DriverManager connection to jdbc:default:connection;
             // DriverManager is not supported with JSR169.
 
-            if ("Sun Microsystems Inc.".equals(
-                        System.getProperty("java.vendor"))) {
-
-                suite.addTestSuite(Derby151Test.class);
+            suite.addTestSuite(Derby151Test.class);
                 return new CleanDatabaseTestSetup(
                     new TestSuite(Derby151Test.class, name));
-
-            } else {
-                // DERBY-4463 test fails on IBM VMs. Remove this
-                // exception when that issue is solved.
-                println("Test skipped for this VM, cf. DERBY-4463");
-                return suite;
-            }
         } else {
             return suite;
         }
@@ -83,7 +73,13 @@ public class Derby151Test extends BaseJD
     public static Test suite()
     {
         TestSuite suite = new TestSuite("Derby151Test");
-
+        if (! isSunJVM()) {
+            // DERBY-4463 test fails on IBM VMs. Remove this
+            // exception when that issue is solved.
+            println("Test skipped for this VM, cf. DERBY-4463");
+            return suite;            
+        }
+        
         suite.addTest(
             baseSuite("Derby151Test:embedded"));
 

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=950818&r1=950817&r2=950818&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 Jun  2 23:24:15 2010
@@ -558,6 +558,11 @@ public abstract class BaseTestCase
         return getSystemProperty("com.ibm.oti.vm.exe") != null;
     }
 
+    public static final boolean isSunJVM() {
+        return ("Sun Microsystems Inc.".equals(
+                getSystemProperty("java.vendor")));
+    }
+    
    /**
     * Reads output from a process and returns it as a string.
     * This will block until the process terminates.