Package com.gargoylesoftware.htmlunit

Examples of com.gargoylesoftware.htmlunit.WebRequest


        throws Exception
    {
        new File( repoRootInternal, "org/apache/archiva/artifactId/1.0" ).mkdirs();
        new File( repoRootInternal, "org/apache/archiva/artifactId/1.0/artifactId-1.0.jar" ).createNewFile();

        WebRequest request =
            new GetMethodWebRequest( "http://machine.com/repository/internal/org/apache/archiva/artifactId" );
        WebResponse response = getServletUnitClient().getResponse( request, true );
        assertEquals( "1st Response", HttpServletResponse.SC_OK, response.getStatusCode() );

        request = new GetMethodWebRequest( "http://machine.com/repository/internal/org/apache/archiva/artifactId/" );
View Full Code Here


        File artifactFile = new File( repoRootInternal, commonsLangJar );
        artifactFile.getParentFile().mkdirs();

        FileUtils.writeStringToFile( artifactFile, expectedArtifactContents, Charset.defaultCharset()  );

        WebRequest request = new GetMethodWebRequest(
            "http://machine.com/repository/internal/" + "commons-lang/jars/commons-lang-2.1-20050821.023400-1.jar" );
        WebResponse response = getServletUnitClient().getResponse( request );
        assertResponseOK( response );

        assertEquals( "Expected file contents", expectedArtifactContents, response.getContentAsString() );
View Full Code Here

        File checksumFile = new File( repoRootInternal, dualExtensionPath );
        checksumFile.getParentFile().mkdirs();

        FileUtils.writeStringToFile( checksumFile, expectedContents, Charset.defaultCharset()  );

        WebRequest request = new GetMethodWebRequest( "http://machine.com/repository/internal/" + dualExtensionPath );
        WebResponse response = getServletUnitClient().getResponse( request );
        assertResponseOK( response );

        assertEquals( "Expected file contents", expectedContents, response.getContentAsString() );
    }
View Full Code Here

        File checksumFile = new File( repoRootInternal, dualExtensionPath );
        checksumFile.getParentFile().mkdirs();

        FileUtils.writeStringToFile( checksumFile, expectedContents, Charset.defaultCharset()  );

        WebRequest request = new GetMethodWebRequest(
            "http://machine.com/repository/internal/" + "org.project/distributions/example-presentation-3.2.zip" );
        WebResponse response = getServletUnitClient().getResponse( request );
        assertResponseOK( response );

        assertEquals( "Expected file contents", expectedContents, response.getContentAsString() );
View Full Code Here

        File checksumFile = new File( repoRootLegacy, "commons-lang/jars/commons-lang-2.1.jar.sha1" );
        checksumFile.getParentFile().mkdirs();

        FileUtils.writeStringToFile( checksumFile, "dummy-checksum", Charset.defaultCharset()  );

        WebRequest request = new GetMethodWebRequest( "http://machine.com/repository/legacy/" + commonsLangSha1 );
        WebResponse response = getServletUnitClient().getResponse( request );
        assertResponseOK( response );

        assertEquals( "Expected file contents", "dummy-checksum", response.getContentAsString() );
    }
View Full Code Here

        File checksumFile = new File( repoRootLegacy, commonsLangSha1 );
        checksumFile.getParentFile().mkdirs();

        FileUtils.writeStringToFile( checksumFile, "dummy-checksum", Charset.defaultCharset()  );

        WebRequest request = new GetMethodWebRequest( "http://machine.com/repository/legacy/" + commonsLangSha1 );
        WebResponse response = getServletUnitClient().getResponse( request );
        assertResponseOK( response );

        assertEquals( "Expected file contents", "dummy-checksum", response.getContentAsString() );
    }
View Full Code Here

        File metadataFile = new File( repoRootLegacy, commonsLangMetadata );
        metadataFile.getParentFile().mkdirs();

        FileUtils.writeStringToFile( metadataFile, expectedMetadataContents, Charset.defaultCharset()  );

        WebRequest request = new GetMethodWebRequest( "http://machine.com/repository/legacy/" + commonsLangMetadata );
        WebResponse response = getServletUnitClient().getResponse( request );
        assertResponseOK( response );

        assertEquals( "Expected file contents", expectedMetadataContents, response.getContentAsString() );
    }
View Full Code Here

        File metadataFile = new File( repoRootLegacy, commonsLangMetadata );
        metadataFile.getParentFile().mkdirs();

        FileUtils.writeStringToFile( metadataFile, expectedMetadataContents, Charset.defaultCharset()  );

        WebRequest request = new GetMethodWebRequest( "http://machine.com/repository/legacy/" + commonsLangMetadata );
        WebResponse response = getServletUnitClient().getResponse( request );
        assertResponseOK( response );

        assertEquals( "Expected file contents", expectedMetadataContents, response.getContentAsString() );
    }
View Full Code Here

        File metadataFile = new File( repoRootLegacy, commonsLangMetadata );
        metadataFile.getParentFile().mkdirs();

        FileUtils.writeStringToFile( metadataFile, expectedMetadataContents, Charset.defaultCharset()  );

        WebRequest request = new GetMethodWebRequest( "http://machine.com/repository/legacy/" + commonsLangMetadata );
        WebResponse response = getServletUnitClient().getResponse( request );
        assertResponseOK( response );

        assertEquals( "Expected file contents", expectedMetadataContents, response.getContentAsString() );
    }
View Full Code Here

        File artifactFile = new File( repoRootLegacy, "commons-lang/jars/commons-lang-2.1.jar" );
        artifactFile.getParentFile().mkdirs();

        FileUtils.writeStringToFile( artifactFile, expectedArtifactContents, Charset.defaultCharset()  );

        WebRequest request = new GetMethodWebRequest( "http://machine.com/repository/legacy/" + commonsLangJar );
        WebResponse response = getServletUnitClient().getResponse( request );
        assertResponseOK( response );

        assertEquals( "Expected file contents", expectedArtifactContents, response.getContentAsString() );
    }
View Full Code Here

TOP

Related Classes of com.gargoylesoftware.htmlunit.WebRequest

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.