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:
@@ -29,6 +29,8 @@ import junit.framework.TestSuite;
|
||||
|
||||
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 @@ public class DefaultConfigTestCase extends TestCase {
|
||||
* 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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user