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