1 22 package org.objectweb.petals.classloader; 23 24 import java.net.URL ; 25 import java.util.ArrayList ; 26 import junit.framework.TestCase; 27 import org.objectweb.petals.PetalsException; 28 import org.objectweb.petals.util.LoggingUtil; 29 30 35 public class LoaderManagerImplTest extends TestCase { 36 37 LoaderManagerImpl loaderManagerImpl =null; 38 39 public void setUp(){ 40 loaderManagerImpl = new LoaderManagerImpl(); 41 loaderManagerImpl.log = new LoggingUtil(null); 42 } 43 44 public void testContainsClassLoader() { 45 assertFalse(loaderManagerImpl.containsClassLoader("foo")); 46 } 47 48 public void testCreateClassLoader() throws PetalsException { 49 assertNotNull(loaderManagerImpl.createClassLoader(new URL [0], 50 new ArrayList <String >(), true)); 51 } 52 53 public void testCreateComponentClassLoader() throws PetalsException { 54 assertNotNull(loaderManagerImpl.createComponentClassLoader("foo", 55 new URL [0], new ArrayList <String >(), true, new ArrayList <String >())); 56 } 57 58 public void testCreateSharedLibraryClassLoader() throws PetalsException { 59 assertNotNull(loaderManagerImpl.createSharedLibraryClassLoader("foo", 60 new URL [0], new ArrayList <String >(), true)); 61 } 62 63 public void testDeleteClassLoader() throws PetalsException { 64 assertFalse(loaderManagerImpl.containsClassLoader("bar")); 65 loaderManagerImpl.createComponentClassLoader("bar", 66 new URL [0], new ArrayList <String >(), true, new ArrayList <String >()); 67 assertTrue(loaderManagerImpl.containsClassLoader("bar")); 68 loaderManagerImpl.deleteClassLoader("bar"); 69 assertFalse(loaderManagerImpl.containsClassLoader("bar")); 70 } 71 72 } 73 | Popular Tags |