Package org.apache.maven.archiva.transaction

Examples of org.apache.maven.archiva.transaction.CopyFileEvent


    }

    public void testCopyCommitRollback()
        throws Exception
    {
        CopyFileEvent event = new CopyFileEvent( testSource, testDest, digesters );

        assertFalse( "Test that the destination is not yet created", testDest.exists() );

        event.commit();

        assertTrue( "Test that the destination is created", testDest.exists() );

        assertChecksumCommit( testDest );

        String target = readFile( testDest );

        assertTrue( "Test that the destination contents are copied correctly", source.equals( target ) );

        event.rollback();

        assertFalse( "Test that the destination file has been deleted", testDest.exists() );

        assertChecksumRollback( testDest );
    }
View Full Code Here


        writeFile( testDest, "overwritten contents" );

        assertTrue( "Test that the destination exists", testDest.exists() );

        CopyFileEvent event = new CopyFileEvent( testSource, testDest, digesters );

        String target = readFile( testDest );

        assertTrue( "Test that the destination contents have not changed", target.equals( "overwritten contents" ) );

        event.commit();

        target = readFile( testDest );

        assertTrue( "Test that the destination contents are copied correctly", source.equals( target ) );

        assertChecksumCommit( testDest );

        event.rollback();

        target = readFile( testDest );

        assertTrue( "Test the destination file contents have been restored", target.equals( "overwritten contents" ) );
View Full Code Here

    }

    public void testCreateRollbackCommit()
        throws Exception
    {
        CopyFileEvent event = new CopyFileEvent( testSource, testDest, digesters );

        assertFalse( "Test that the destination is not yet created", testDest.exists() );

        event.rollback();

        assertFalse( "Test that the destination file is not yet created", testDest.exists() );

        event.commit();

        assertTrue( "Test that the destination is created", testDest.exists() );

        assertChecksumCommit( testDest );
View Full Code Here

TOP

Related Classes of org.apache.maven.archiva.transaction.CopyFileEvent

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.