Package org.apache.maven.wagon

Examples of org.apache.maven.wagon.ResourceDoesNotExistException


        wagonMock.get( path, new File( expectedFile.getParentFile(), expectedFile.getName() + ".tmp" ) );

        wagonMockControl.setMatcher( customWagonGetMatcher );

        wagonMockControl.setThrowable( new ResourceDoesNotExistException( "resource does not exist." ), 2 );

        wagonMockControl.replay();

        File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact );
View Full Code Here


                       SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO, false );

        wagonMock.get( path, new File( expectedFile.getParentFile(), expectedFile.getName() + ".tmp" ) );

        wagonMockControl.setMatcher( customWagonGetMatcher );
        wagonMockControl.setThrowable( new ResourceDoesNotExistException( "resource does not exist." ), 2 );

        wagonMockControl.replay();

        File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact );

        wagonMockControl.verify();

        // Second attempt to download same artifact DOES NOT use cache
        wagonMockControl.reset();
        wagonMock.get( path, new File( expectedFile.getParentFile(), expectedFile.getName() + ".tmp" ) );

        wagonMockControl.setMatcher( customWagonGetMatcher );
        wagonMockControl.setThrowable( new ResourceDoesNotExistException( "resource does not exist." ), 2 );
        wagonMockControl.replay();

        downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact );

        wagonMockControl.verify();
View Full Code Here

        return new TransferFailedException( "test download exception" );
    }

    private static ResourceDoesNotExistException createResourceNotFoundException()
    {
        return new ResourceDoesNotExistException( "test download not found" );
    }
View Full Code Here

        }

        // if it already exists locally we were just trying to force it - ignore the update
        if ( !successful && !artifact.getFile().exists() )
        {
            throw new ResourceDoesNotExistException( "Unable to download the artifact from any repository" );
        }
    }
View Full Code Here

        if ( downloaded )
        {
            if ( !temp.exists() )
            {
                throw new ResourceDoesNotExistException( "Downloaded file does not exist: " + temp );
            }

            // The temporary file is named destination + ".tmp" and is done this way to ensure
            // that the temporary file is in the same file system as the destination because the
            // File.renameTo operation doesn't really work across file systems.
View Full Code Here

            FileUtils.copyFile( new File( sourceFile ), file );
            assert( file.exists() );
        }
        catch( IOException e )
        {
            throw new ResourceDoesNotExistException( e.getMessage() );           
        }
    }
View Full Code Here

        saveConnector( ID_DEFAULT_MANAGED, "badproxied2", ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS,
                       SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.YES, false );

        wagonMock.get( EasyMock.eq( path ), EasyMock.anyObject( File.class ));

        EasyMock.expectLastCall().andThrow( new ResourceDoesNotExistException( "resource does not exist." ) ).times( 2 );


        wagonMockControl.replay();

        File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact );
View Full Code Here

                       SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO, false );
        saveConnector( ID_DEFAULT_MANAGED, "badproxied2", ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS,
                       SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO, false );

        wagonMock.get( EasyMock.eq( path ), EasyMock.anyObject( File.class ));
        EasyMock.expectLastCall().andThrow( new ResourceDoesNotExistException( "resource does not exist." ) ).times( 2 );

        wagonMockControl.replay();

        File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact );

        wagonMockControl.verify();

        // Second attempt to download same artifact DOES NOT use cache
        wagonMockControl.reset();

        wagonMock.get( EasyMock.eq( path ), EasyMock.anyObject( File.class ));
        EasyMock.expectLastCall().andThrow( new ResourceDoesNotExistException( "resource does not exist." ) ).times( 2 );

        wagonMockControl.replay();

        downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact );
View Full Code Here

        wagonMock.get( EasyMock.eq( path + ".sha1" ), EasyMock.anyObject( File.class ));
        EasyMock.expectLastCall().once();

        wagonMock.get( EasyMock.eq( path + ".md5" ), EasyMock.anyObject( File.class ));
        EasyMock.expectLastCall().andThrow( new ResourceDoesNotExistException( "Resource does not exist." ) ).once();

        wagonMockControl.replay();

        File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact );
View Full Code Here

        return new TransferFailedException( "test download exception" );
    }

    private static ResourceDoesNotExistException createResourceNotFoundException()
    {
        return new ResourceDoesNotExistException( "test download not found" );
    }
View Full Code Here

TOP

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

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.