Package org.apache.maven.archiva.transaction

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


    public void testCreateCommitRollback()
        throws Exception
    {
        File testFile = new File( testDir, "test-file.txt" );

        CreateFileEvent event = new CreateFileEvent( "file contents", testFile, digesters );

        assertFalse( "Test file is not yet created", testFile.exists() );

        event.commit();

        assertTrue( "Test file has been created", testFile.exists() );

        assertChecksumCommit( testFile );

        event.rollback();

        assertFalse( "Test file is has been deleted after rollback", testFile.exists() );

        assertChecksumRollback( testFile );
View Full Code Here


        testFile.createNewFile();

        writeFile( testFile, "original contents" );

        CreateFileEvent event = new CreateFileEvent( "modified contents", testFile, digesters );

        String contents = readFile( testFile );

        assertEquals( "Test contents have not changed", "original contents", contents );

        event.commit();

        contents = readFile( testFile );

        assertEquals( "Test contents have not changed", "modified contents", contents );

        assertChecksumCommit( testFile );

        event.rollback();

        contents = readFile( testFile );

        assertEquals( "Test contents have not changed", "original contents", contents );
View Full Code Here

    public void testCreateRollbackCommit()
        throws Exception
    {
        File testFile = new File( testDir, "test-file.txt" );

        CreateFileEvent event = new CreateFileEvent( "file contents", testFile, digesters );

        assertFalse( "Test file is not yet created", testFile.exists() );

        event.rollback();

        assertFalse( "Test file is not yet created", testFile.exists() );

        event.commit();

        assertTrue( "Test file is not yet created", testFile.exists() );

        assertChecksumCommit( testFile );
    }
View Full Code Here

TOP

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

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.