Package org.codehaus.classworlds.uberjar.protocol.jar

Examples of org.codehaus.classworlds.uberjar.protocol.jar.JarUrlConnection


        throws Exception
    {
        URL url = buildUrl( "nested.jar",
                            "!/lib/a.jar!/a/A.class" );

        JarUrlConnection connection = new JarUrlConnection( url );

        String[] segments = connection.getSegments();

        assertEquals( 2,
                      segments.length );

        assertEquals( "/lib/a.jar",
                      segments[0] );

        assertEquals( "/a/A.class",
                      segments[1] );

        URL baseResource = connection.getBaseResource();

        assertTrue( baseResource.toExternalForm().startsWith( "file:" ) );
        assertTrue( baseResource.toExternalForm().endsWith( "nested.jar" ) );
    }
View Full Code Here


    public void testConnect_Simple()
        throws Exception
    {
        URL url = buildUrl( "nested.jar", "" );

        JarUrlConnection connection = new JarUrlConnection( url );

        connection.connect();
    }
View Full Code Here

   
    public void testConstructionMalformed(String expected, String input, Class exception) throws Exception {
        String method = "JarUrlConnection.normaliseURL(" + input + ")";
        try {
            new JarUrlConnection(new URL(input));
            if (exception != null) {
                fail(method + " should have thrown exception - " + exception.getName());
            }
        } catch (Exception e) {
            if (exception != null && exception.isInstance(e)) {
View Full Code Here

TOP

Related Classes of org.codehaus.classworlds.uberjar.protocol.jar.JarUrlConnection

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.