Package org.apache.maven.wagon

Examples of org.apache.maven.wagon.Wagon


    {
        Exception thrown = null;

        try
        {
            Wagon wagon = getWagon();
            wagon.setReadTimeout( 1000 );

            Repository testRepository = new Repository();
            testRepository.setUrl( "http://localhost:" + httpServerPort );

            wagon.connect( testRepository );

            File destFile = FileTestUtils.createUniqueFile( getName(), getName() );
            destFile.deleteOnExit();

            wagon.get( "/timeoutfile", destFile );

            wagon.disconnect();
        }
        catch ( Exception e )
        {
            thrown = e;
        }
View Full Code Here


    {
        Exception thrown = null;

        try
        {
            Wagon wagon = getWagon();
            wagon.setReadTimeout( 1000 );

            Repository testRepository = new Repository();
            testRepository.setUrl( "http://localhost:" + httpServerPort );

            wagon.connect( testRepository );

            wagon.resourceExists( "/timeoutfile" );

            wagon.disconnect();
        }
        catch ( Exception e )
        {
            thrown = e;
        }
View Full Code Here

    {
        Exception thrown = null;

        try
        {
            Wagon wagon = getWagon();
            wagon.setReadTimeout( 1000 );

            Repository testRepository = new Repository();
            testRepository.setUrl( "http://localhost:" + httpServerPort );

            wagon.connect( testRepository );

            wagon.getFileList( "/timeoutfile" );

            wagon.disconnect();
        }
        catch ( Exception e )
        {
            thrown = e;
        }
View Full Code Here

    {
        Exception thrown = null;

        try
        {
            Wagon wagon = getWagon();
            wagon.setReadTimeout( 1000 );

            Repository testRepository = new Repository();
            testRepository.setUrl( "http://localhost:" + httpServerPort );

            wagon.connect( testRepository );

            File destFile = File.createTempFile( "Hello", null );
            destFile.deleteOnExit();

            wagon.put( destFile, "/timeoutfile" );

            wagon.disconnect();
        }
        catch ( Exception e )
        {
            thrown = e;
        }
View Full Code Here

    {
        Exception thrown = null;

        try
        {
            Wagon wagon = getWagon();

            Repository testRepository = new Repository();
            testRepository.setUrl( "http://localhost:" + httpServerPort );

            wagon.connect( testRepository );

            File destFile = FileTestUtils.createUniqueFile( getName(), getName() );
            destFile.deleteOnExit();

            wagon.get( "/401", destFile );

            wagon.disconnect();
        }
        catch ( Exception e )
        {
            thrown = e;
        }
View Full Code Here

    {
        Exception thrown = null;

        try
        {
            Wagon wagon = getWagon();

            Repository testRepository = new Repository();
            testRepository.setUrl( "http://localhost:" + httpServerPort );

            wagon.connect( testRepository );

            File destFile = FileTestUtils.createUniqueFile( getName(), getName() );
            destFile.deleteOnExit();

            wagon.get( "/403", destFile );

            wagon.disconnect();
        }
        catch ( Exception e )
        {
            thrown = e;
        }
View Full Code Here

    {
        Exception thrown = null;

        try
        {
            Wagon wagon = getWagon();

            Repository testRepository = new Repository();
            testRepository.setUrl( "http://localhost:" + httpServerPort );

            wagon.connect( testRepository );

            File destFile = FileTestUtils.createUniqueFile( getName(), getName() );
            destFile.deleteOnExit();

            wagon.get( "/407", destFile );

            wagon.disconnect();
        }
        catch ( Exception e )
        {
            thrown = e;
        }
View Full Code Here

    {
        Exception thrown = null;

        try
        {
            Wagon wagon = getWagon();

            Repository testRepository = new Repository();
            testRepository.setUrl( "http://localhost:" + httpServerPort );

            wagon.connect( testRepository );

            File destFile = FileTestUtils.createUniqueFile( getName(), getName() );
            destFile.deleteOnExit();

            wagon.get( "/500", destFile );

            wagon.disconnect();
        }
        catch ( Exception e )
        {
            thrown = e;
        }
View Full Code Here

    {
        setupRepositories();

        setupWagonTestingFixtures();

        Wagon wagon = getWagon();

        if ( wagon.supportsDirectoryCopy() )
        {
            // do the cleanup first
            File destDir = new File( getRepositoryDirectory(), "dirExists" );
            FileUtils.deleteDirectory(destDir);
            destDir.mkdirs();
            destDir = new File( destDir, "not_yet_existing/also_not" );

            File sourceDir = new File( getRepositoryDirectory(), "testDirectory" );

            FileUtils.deleteDirectory(sourceDir);
            sourceDir.mkdir();

            File testRes = new File( sourceDir, "test-resource-1.txt" );
            testRes.createNewFile();

            // This is the difference to our normal use case:
            // the directory specified in the repo string doesn't yet exist!

            testRepository.setUrl( testRepository.getUrl() + "/dirExists/not_yet_existing/also_not" );

            wagon.connect( testRepository, getAuthInfo() );

            wagon.putDirectory( sourceDir, "testDirectory" );

            destFile = FileTestUtils.createUniqueFile(getName(), getName());

            destFile.deleteOnExit();

            wagon.get( "testDirectory/test-resource-1.txt", destFile );

            wagon.disconnect();
        }

        tearDownWagonTestingFixtures();

View Full Code Here

        File dummy = new File( "src/test/resources/dummy.txt" );
        FileUtils.copyFileToDirectory( dummy, sub );

        String url = getTestRepositoryUrl() + "/" + dir;
        Repository repo = new Repository( "foo", url );
        Wagon wagon = getWagon();
        wagon.connect( repo, getAuthInfo() );
        List<String> files = wagon.getFileList( subDir );
        assertNotNull( files );
        assertEquals( 1, files.size() );
        assertTrue( files.contains( "dummy.txt" ) );

        wagon.put( new File( "src/test/resources/dummy.txt" ), subDir + "/newdummy.txt" );

        files = wagon.getFileList( subDir );
        assertNotNull( files );
        assertEquals( 2, files.size() );
        assertTrue( files.contains( "dummy.txt" ) );
        assertTrue( files.contains( "newdummy.txt" ) );

        File sourceWithSpace = new File( "target/directory with spaces" );
        if ( sourceWithSpace.exists() )
        {
            FileUtils.deleteDirectory( sourceWithSpace );
        }
        File resources = new File( "src/test/resources" );

        FileUtils.copyDirectory( resources, sourceWithSpace );

        wagon.putDirectory( sourceWithSpace, "target with spaces" );

        files = wagon.getFileList( "target with spaces" );

        assertNotNull( files );
        assertTrue( files.contains( "dummy.txt" ) );
        assertFalse( files.contains( "newdummy.txt" ) );
        assertTrue( files.contains( "log4j.xml" ) );
View Full Code Here

TOP

Related Classes of org.apache.maven.wagon.Wagon

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.