Package org.drools.guvnor.client.rpc

Examples of org.drools.guvnor.client.rpc.MavenArtifact.toURL()


    @Test
    public void testDownloadRemoteRepository() throws IOException {
        final String jbossReleaseRepo = "http://repository.jboss.org/nexus/content/repositories/releases/";
        final MavenArtifact artifact = new MavenArtifact( "org.drools:knowledge-api:jar:5.3.1.Final:compile" );

        final HttpURLConnection connection = (HttpURLConnection) new URL( artifact.toURL( jbossReleaseRepo ) ).openConnection();
        connection.setRequestMethod( "HEAD" );
        try {
            final int responseCode = connection.getResponseCode();
            if ( responseCode != 200 ) {
                //won't fail if you can't get access to external resource
View Full Code Here


            //won't fail if you can't reach jboss repo
            return;
        }

        final String finalFileName = System.getProperty( "java.io.tmpdir" ) + "/" + artifact.toFileName();
        final File result = downloadFile( artifact.toURL( jbossReleaseRepo ),
                                          finalFileName );

        assertNotNull( result );
        assertEquals( "47c645f0f605790b5d505c7d2f27b745",
                      md5Hex( getBytes( result ) ) );
View Full Code Here

        final String localMavenRepo = getURLtoLocalUserMavenRepo();
        final MavenArtifact artifact = new MavenArtifact( "org.antlr:antlr-runtime:jar:3.3:compile" );

        final String finalFileName = System.getProperty( "java.io.tmpdir" ) + "/" + artifact.toFileName();

        final File result = downloadFile( artifact.toURL( localMavenRepo ),
                                          finalFileName );

        assertNotNull( result );
        assertEquals( "ccd65b08cbc9b7e90b9facd4d125a133c6f87228",
                      shaHex( getBytes( result ) ) );
View Full Code Here

        final String localMavenRepo = getURLtoLocalUserMavenRepo();
        final MavenArtifact artifact = new MavenArtifact( "org.antlr:antlr-some:jar:3.3:compile" );

        final String finalFileName = System.getProperty( "java.io.tmpdir" ) + "/" + artifact.toFileName();

        final File result = downloadFile( artifact.toURL( localMavenRepo ),
                                          finalFileName );

        assertNull( result );
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.