1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.commons.logging.log4j.log4j12;
18
19 import junit.framework.Test;
20
21 import org.apache.commons.logging.PathableClassLoader;
22 import org.apache.commons.logging.PathableTestSuite;
23
24
25 /***
26 * Tests for Log4J logging that emulate a webapp running within
27 * a container where the commons-logging-api jar file is in
28 * the parent classpath and commons-logging.jar is in the child.
29 */
30
31 public class ApiClasspathStandardTestCase {
32
33 /***
34 * Return the tests included in this test suite.
35 */
36 public static Test suite() throws Exception {
37 PathableClassLoader parent = new PathableClassLoader(null);
38 parent.useSystemLoader("junit.");
39 parent.addLogicalLib("commons-logging-api");
40
41 PathableClassLoader child = new PathableClassLoader(parent);
42 child.addLogicalLib("log4j12");
43 child.addLogicalLib("commons-logging");
44 child.addLogicalLib("testclasses");
45
46 Class testClass = child.loadClass(
47 "org.apache.commons.logging.log4j.log4j12.Log4j12StandardTests");
48 return new PathableTestSuite(testClass, child);
49 }
50 }