db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From krist...@apache.org
Subject svn commit: r1394250 - /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/compatibility/_Suite.java
Date Thu, 04 Oct 2012 20:28:27 GMT
Author: kristwaa
Date: Thu Oct  4 20:28:27 2012
New Revision: 1394250

URL: http://svn.apache.org/viewvc?rev=1394250&view=rev
Log:
DERBY-5889: tests.compatibility._Suite has AccessControlException errors on Windows

Relaxed the criteria casuing the test to be disabled on Windows such that it
will only be disabled if at least one of the releases is located on an UNC path.

Patch file: derby-5889-1b-disable_test_relaxed.diff

Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/compatibility/_Suite.java

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/compatibility/_Suite.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/compatibility/_Suite.java?rev=1394250&r1=1394249&r2=1394250&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/compatibility/_Suite.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/compatibility/_Suite.java
Thu Oct  4 20:28:27 2012
@@ -29,6 +29,7 @@ import junit.framework.TestSuite;
 
 import org.apache.derbyTesting.junit.BaseJDBCTestCase;
 import org.apache.derbyTesting.junit.Derby;
+import org.apache.derbyTesting.junit.DerbyDistribution;
 import org.apache.derbyTesting.junit.DerbyVersion;
 import org.apache.derbyTesting.junit.SecurityManagerSetup;
 import org.apache.derbyTesting.junit.ServerSetup;
@@ -118,10 +119,13 @@ public class _Suite
      * @return A default suite of compatibility tests.
      */
     public static Test suite() {
-        // DERBY-5889: Disabling tests on Windonws while investigating.
-        if (isWindowsPlatform()) {
-            return new TestSuite(
-                    "tests.compatibility disabled on Windows, see DERBY-5889");
+        // DERBY-5889: Disabling tests on Windows where the old releases are
+        // run off of UNC paths (network drives).
+        if (suffersFromDerby5889()) {
+            String msg = ("tests.compatibility disabled on Windows " +
+                    "with UNC paths, see DERBY-5889");
+            println(msg);
+            return new TestSuite(msg);
         }
         if (!Derby.hasClient() || !Derby.hasServer()) {
             return new TestSuite("Compatibility tests skipped because " +
@@ -138,4 +142,24 @@ public class _Suite
                     replaceAll("\\.", "/") + ".policy",
                 true);
     }
+
+    /**
+     * Tells if we are running in an environment that suffers from DERBY-5889.
+     * <p>
+     * Description: operating system is Windows and the old Derby releases are
+     * residing on an UNC path (network drive).
+     */
+    public static boolean suffersFromDerby5889() {
+        if (!isWindowsPlatform()) {
+            return false;
+        }
+        DerbyDistribution[] dists =
+                TestConfiguration.getReleaseRepository().getDistributions();
+        for (int i=0; i < dists.length; i++) {
+            if (dists[i].getDerbyEngineJarPath().startsWith("\\\\")) {
+                return true;
+            }
+        }
+        return false;
+    }
 }



Mime
View raw message