1
0

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.


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/logging/trunk@427808 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Simon Kitching
2006-08-02 00:08:20 +00:00
parent c340a77d5b
commit ff8a0111c0

View File

@@ -29,6 +29,8 @@ import junit.framework.TestSuite;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import org.apache.commons.logging.PathableClassLoader;
import org.apache.commons.logging.PathableTestSuite;
/** /**
@@ -87,7 +89,13 @@ public class DefaultConfigTestCase extends TestCase {
* Return the tests included in this test suite. * Return the tests included in this test suite.
*/ */
public static Test suite() throws Exception { 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);
} }
/** /**