1 18 19 package org.objectweb.kilim.repository; 20 21 import java.io.InputStream ; 22 23 import junit.framework.TestCase; 24 25 29 public class ClassLoaderResourceLoaderTest extends TestCase { 30 31 35 public ClassLoaderResourceLoaderTest(String arg0) { 36 super(arg0); 37 } 38 39 43 public void testLoadingException() throws ResourceNotFoundException { 44 ClassLoader classLoader = getClass().getClassLoader(); 45 ResourceLoader resLoader = new ClassLoaderResourceLoader(classLoader); 46 47 try { 48 InputStream is = resLoader.getResource("plouf.xml"); 49 fail("ResourceLoaderClassLoader should throw ResourceNotFoundException"); 50 } catch (ResourceNotFoundException rnfex) { 51 assertTrue(rnfex.getResourceName().equals("plouf.xml")); 52 } 53 } 54 55 } 56 | Popular Tags |