1 package org.nanocontainer; 2 3 import java.io.FilePermission ; 4 import java.net.URL ; 5 6 import junit.framework.TestCase; 7 8 12 public class ClassPathElementTestCase extends TestCase { 13 14 public void testGetUrl() throws Exception { 15 URL url = new URL ("file:///usr/lib"); 16 ClassPathElement element = new ClassPathElement(url); 17 assertEquals(url, element.getUrl()); 18 } 19 20 public void testGrantPermission() throws Exception { 21 ClassPathElement element = new ClassPathElement(new URL ("file:///usr/lib")); 22 element.grantPermission(new FilePermission ("/usr/lib", "read")); 23 assertNotNull(element.getPermissionCollection()); 24 } 25 } 26 | Popular Tags |