KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > hudson > remoting > DummyClassLoaderTest


1 package hudson.remoting;
2
3 import junit.framework.TestCase;
4
5 /**
6  * @author Kohsuke Kawaguchi
7  */

8 public class DummyClassLoaderTest extends TestCase {
9     public void testLoad() throws Throwable JavaDoc {
10         DummyClassLoader cl = new DummyClassLoader(this.getClass().getClassLoader());
11         Callable c = (Callable) cl.loadClass("hudson.remoting.test.TestCallable").newInstance();
12         System.out.println(c.call());
13         // make sure that the returned class is loaded from the dummy classloader
14
assertTrue(((Object JavaDoc[])c.call())[0].toString().startsWith(DummyClassLoader.class.getName()));
15     }
16 }
17
Popular Tags