1 package org.sapia.clazzy; 2 import java.io.File ; 3 4 import org.sapia.clazzy.FileSystemClassLoader; 5 import org.sapia.clazzy.test.Printable; 6 7 import junit.framework.TestCase; 8 9 10 19 public class FileSystemClassLoaderTest extends TestCase{ 20 21 public FileSystemClassLoaderTest(String name){ 22 super(name); 23 } 24 25 public void testLoadClass() throws Exception { 26 FileSystemClassLoader loader = new FileSystemClassLoader(new File ("etc/test/classes")); 27 Printable p = (Printable)loader.loadClass("test.FileSystemClass").newInstance(); 28 super.assertTrue(p.getClass().getPackage() != null); 29 try{ 30 loader.loadClass("test.None"); 31 fail("ClassNotFoundException should have been thrown"); 32 }catch(ClassNotFoundException e){ 33 } 35 } 36 37 } 38 | Popular Tags |