001package org.picocontainer.classname;
002
003import static org.junit.Assert.assertEquals;
004import static org.junit.Assert.assertNotNull;
005
006import java.io.FilePermission;
007import java.net.URL;
008
009import org.junit.Test;
010import org.picocontainer.classname.ClassPathElement;
011
012/**
013 * 
014 * @author Mauro Talevi
015 */
016public class ClassPathElementTestCase {
017
018    @Test public void testGetUrl() throws Exception{
019        URL url = new URL("file:///usr/lib");
020        ClassPathElement element = new ClassPathElement(url);
021        assertEquals(url, element.getUrl());
022    }
023
024    @Test public void testGrantPermission() throws Exception{
025        ClassPathElement element = new ClassPathElement(new URL("file:///usr/lib"));
026        element.grantPermission(new FilePermission("/usr/lib", "read"));
027        assertNotNull(element.getPermissionCollection());
028    }
029}