commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From skitch...@apache.org
Subject svn commit: r427808 - /jakarta/commons/proper/logging/trunk/src/test/org/apache/commons/logging/jdk14/DefaultConfigTestCase.java
Date Wed, 02 Aug 2006 00:08:20 GMT
Author: skitching
Date: Tue Aug  1 17:08:20 2006
New Revision: 427808

URL: http://svn.apache.org/viewvc?rev=427808&view=rev
Log:
Have DefaultConfigTestCase explicitly set up its classpath. When run from ant, log4j is not
on the
classpath so using the default setup works; however when run from maven2 surefire, log4j is
on the
path. Explicitly controlling the test classpath works in both cases.

Modified:
    jakarta/commons/proper/logging/trunk/src/test/org/apache/commons/logging/jdk14/DefaultConfigTestCase.java

Modified: jakarta/commons/proper/logging/trunk/src/test/org/apache/commons/logging/jdk14/DefaultConfigTestCase.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/logging/trunk/src/test/org/apache/commons/logging/jdk14/DefaultConfigTestCase.java?rev=427808&r1=427807&r2=427808&view=diff
==============================================================================
--- jakarta/commons/proper/logging/trunk/src/test/org/apache/commons/logging/jdk14/DefaultConfigTestCase.java
(original)
+++ jakarta/commons/proper/logging/trunk/src/test/org/apache/commons/logging/jdk14/DefaultConfigTestCase.java
Tue Aug  1 17:08:20 2006
@@ -29,6 +29,8 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.commons.logging.PathableClassLoader;
+import org.apache.commons.logging.PathableTestSuite;
 
 
 /**
@@ -87,7 +89,13 @@
      * Return the tests included in this test suite.
      */
     public static Test suite() throws Exception {
-        return (new TestSuite(DefaultConfigTestCase.class));
+        PathableClassLoader loader = new PathableClassLoader(null);
+        loader.useExplicitLoader("junit.", Test.class.getClassLoader());
+        loader.addLogicalLib("testclasses");
+        loader.addLogicalLib("commons-logging");
+        
+        Class testClass = loader.loadClass(DefaultConfigTestCase.class.getName());
+        return new PathableTestSuite(testClass, loader);
     }
 
     /**



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message