1 16 17 package org.apache.commons.logging.log4j.log4j12; 18 19 import junit.framework.Test; 20 import junit.framework.TestCase; 21 22 import org.apache.commons.logging.PathableClassLoader; 23 import org.apache.commons.logging.PathableTestSuite; 24 import org.apache.commons.logging.impl.ServletContextCleaner; 25 26 27 30 31 public class BasicServletTestCase extends TestCase { 32 33 36 public static Test suite() throws Exception { 37 45 PathableClassLoader parent = new PathableClassLoader(null); 46 parent.useSystemLoader("junit."); 47 parent.addLogicalLib("commons-logging"); 48 parent.addLogicalLib("servletapi"); 49 50 PathableClassLoader child = new PathableClassLoader(parent); 51 child.setParentFirst(false); 52 child.addLogicalLib("commons-logging"); 53 child.addLogicalLib("testclasses"); 54 55 PathableClassLoader tccl = new PathableClassLoader(child); 56 tccl.setParentFirst(false); 57 tccl.addLogicalLib("commons-logging"); 58 59 Class testClass = child.loadClass(BasicServletTestCase.class.getName()); 60 return new PathableTestSuite(testClass, tccl); 61 } 62 63 67 public void testBasics() { 68 ServletContextCleaner scc = new ServletContextCleaner(); 69 scc.contextDestroyed(null); 70 } 71 } 72 | Popular Tags |