db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kahat...@apache.org
Subject svn commit: r1350134 - in /db/derby/code/trunk/java/testing/org/apache/derbyTesting: functionTests/tests/tools/SysinfoLocaleTest.java junit/BaseTestCase.java
Date Thu, 14 Jun 2012 08:56:26 GMT
Author: kahatlen
Date: Thu Jun 14 08:56:25 2012
New Revision: 1350134

URL: http://svn.apache.org/viewvc?rev=1350134&view=rev
Log:
DERBY-5810: Include emma.jar on classpath when running compatibility test with instrumented
jars

Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/SysinfoLocaleTest.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/tools/SysinfoLocaleTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/SysinfoLocaleTest.java?rev=1350134&r1=1350133&r2=1350134&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/SysinfoLocaleTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/SysinfoLocaleTest.java
Thu Jun 14 08:56:25 2012
@@ -159,7 +159,7 @@ public class SysinfoLocaleTest extends B
     private static void runSysinfo() throws Exception {
         final String className = "org.apache.derby.tools.sysinfo";
         URL sysinfoURL = SecurityManagerSetup.getURL(className);
-        URL emmaURL = SecurityManagerSetup.getURL("com.vladium.emma.EMMAException");
+        URL emmaURL = getEmmaJar();
         URL[] urls = null;
         if(emmaURL != null) {
             urls = new URL[] { sysinfoURL, emmaURL };

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=1350134&r1=1350133&r2=1350134&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 Thu Jun
14 08:56:25 2012
@@ -570,6 +570,15 @@ public abstract class BaseTestCase
             // end up corrupted. Let each process have its own file to which
             // it writes coverage data.
             cmdlist.add("-Demma.coverage.out.file=" + getEmmaOutFile());
+
+            // DERBY-5810: Make sure that emma.jar is included on the
+            // classpath of the sub-process. (Only needed if a specific
+            // classpath has been specified. Otherwise, the sub-process
+            // inherits the classpath from the parent process, which
+            // already includes emma.jar.)
+            if (cp != null) {
+                cp += File.pathSeparator + getEmmaJar().getPath();
+            }
         }
 
 	    cmdlist.add("-classpath");
@@ -756,6 +765,15 @@ public abstract class BaseTestCase
     }
 
     /**
+     * Get a URL pointing to {@code emma.jar}, if the tests are running
+     * with EMMA code coverage. The method returns {@code null} if the
+     * tests are not running with EMMA.
+     */
+    public static URL getEmmaJar() {
+        return SecurityManagerSetup.getURL("com.vladium.emma.EMMAException");
+    }
+
+    /**
      * Returns the major version of the class specification version supported
      * by the running JVM.
      * <ul>



Mime
View raw message