db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r633101 - in /db/derby/code/trunk/java/testing/org/apache/derbyTesting: functionTests/tests/tools/SysinfoLocaleTest.java junit/SecurityManagerSetup.java
Date Mon, 03 Mar 2008 14:39:41 GMT
Author: dyre
Date: Mon Mar  3 06:39:40 2008
New Revision: 633101

URL: http://svn.apache.org/viewvc?rev=633101&view=rev
Log:
DERBY-3445: Make it easier to use the EMMA tool to measure the code coverage of the Derby
testing
Allow SysinfoLocaleTest to run witout emma jars in the classpath.
 
Patch contributed by Vemund Østgaard
Patch file: 3445-SysinfoLocaleTest-diff

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/SecurityManagerSetup.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=633101&r1=633100&r2=633101&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
Mon Mar  3 06:39:40 2008
@@ -158,10 +158,14 @@
      */
     private static void runSysinfo() throws Exception {
         final String className = "org.apache.derby.tools.sysinfo";
-        URL[] urls = {
-            Class.forName(className).getProtectionDomain().
-                    getCodeSource().getLocation()
-        };
+        URL sysinfoURL = SecurityManagerSetup.getURL(className);
+        URL emmaURL = SecurityManagerSetup.getURL("com.vladium.emma.EMMAException");
+        URL[] urls = null;
+        if(emmaURL != null) {
+            urls = new URL[] { sysinfoURL, emmaURL };
+        } else {
+            urls = new URL[] { sysinfoURL };
+        }
         URLClassLoader loader = new URLClassLoader(urls, null);
 
         Class copy = Class.forName(className, true, loader);

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/SecurityManagerSetup.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/SecurityManagerSetup.java?rev=633101&r1=633100&r2=633101&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/SecurityManagerSetup.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/SecurityManagerSetup.java
Mon Mar  3 06:39:40 2008
@@ -336,7 +336,7 @@
      * Get the URL of the code base from a class name.
      * If the class cannot be loaded, null is returned.
      */
-    static URL getURL(String className) {
+    public static URL getURL(String className) {
         try {
             return getURL(Class.forName(className));
         } catch (ClassNotFoundException e) {



Mime
View raw message