KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > nanocontainer > ClassPathElementTestCase


1 package org.nanocontainer;
2
3 import java.io.FilePermission JavaDoc;
4 import java.net.URL JavaDoc;
5
6 import junit.framework.TestCase;
7
8 /**
9  *
10  * @author Mauro Talevi
11  */

12 public class ClassPathElementTestCase extends TestCase {
13
14     public void testGetUrl() throws Exception JavaDoc{
15         URL JavaDoc url = new URL JavaDoc("file:///usr/lib");
16         ClassPathElement element = new ClassPathElement(url);
17         assertEquals(url, element.getUrl());
18     }
19
20     public void testGrantPermission() throws Exception JavaDoc{
21         ClassPathElement element = new ClassPathElement(new URL JavaDoc("file:///usr/lib"));
22         element.grantPermission(new FilePermission JavaDoc("/usr/lib", "read"));
23         assertNotNull(element.getPermissionCollection());
24     }
25 }
26
Popular Tags