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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to