Package org.apache.maven.scm

Examples of org.apache.maven.scm.CommandParameters


        List<File> updatedFiles = Collections.singletonList( new File( "updated/file" ) );
        when( accurev.update( basedir, null ) ).thenReturn( updatedFiles );

        AccuRevCheckOutCommand command = new AccuRevCheckOutCommand( getLogger() );

        CommandParameters params = new CommandParameters();
        params.setScmVersion( CommandParameter.SCM_VERSION, new ScmTag( "mySnapShot" ) );

        CheckOutScmResult result = command.checkout( repo, new ScmFileSet( basedir ), params );

        verify( accurev ).chws( basedir, "someOldStream_someUser", "mySnapShot" );
View Full Code Here


        info.setBasis( "myStream" );
        info.setTop( basedir.getParentFile().getAbsolutePath() );

        AccuRevCheckOutCommand command = new AccuRevCheckOutCommand( getLogger() );

        CommandParameters params = new CommandParameters();
        params.setScmVersion( CommandParameter.SCM_VERSION, new ScmTag( "mySnapShot" ) );

        command.checkout( repo, new ScmFileSet( basedir ), params );
        fail( "Expected exception" );

    }
View Full Code Here

        List<File> updatedFiles = Collections.singletonList( new File( "updated/file" ) );
        when( accurev.update( basedir, "now" ) ).thenReturn( updatedFiles );

        AccuRevCheckOutCommand command = new AccuRevCheckOutCommand( getLogger() );

        CommandParameters parameters = new CommandParameters();
        parameters.setScmVersion( CommandParameter.SCM_VERSION, new ScmRevision( "anotherStream/12" ) );
       
        CheckOutScmResult result = command.checkout( repo, new ScmFileSet( basedir ), parameters );

        assertThat( result.isSuccess(), is( true ) );
        assertThat( result.getCheckedOutFiles().size(), is( 1 ) );
View Full Code Here

        List<File> updatedFiles = Collections.singletonList( new File( "updated/file" ) );
        when( accurev.update( basedir, "12" ) ).thenReturn( updatedFiles );

        AccuRevCheckOutCommand command = new AccuRevCheckOutCommand( getLogger() );

        CommandParameters parameters = new CommandParameters();
        parameters.setScmVersion( CommandParameter.SCM_VERSION, new ScmRevision( "myStream/12" ) );
        CheckOutScmResult result = command.checkout( repo, new ScmFileSet( basedir ), parameters );

        verify( accurev ).pop( basedir, null );

        assertThat( result.isSuccess(), is( true ) );
View Full Code Here

        when( accurev.annotate( basedir, file ) ).thenReturn( Collections.singletonList( blameLine ) );

        AccuRevBlameCommand command = new AccuRevBlameCommand( getLogger() );

        CommandParameters commandParameters = new CommandParameters();
        commandParameters.setString( CommandParameter.FILE, file.getPath() );
        BlameScmResult result = command.blame( repo, testFileSet, commandParameters );

        assertThat( result.isSuccess(), is( true ) );
        assertThat( result.getLines().size(), is( 1 ) );
        assertThat( ( (BlameLine) result.getLines().get( 0 ) ), is( blameLine ) );
View Full Code Here

        List<File> promotedFiles = Arrays.asList( new File( "kept/file" ), new File( "promoted/file" ) );
        when( accurev.promoteAll( basedir, "A commit message" ) ).thenReturn( promotedFiles );

        AccuRevCheckInCommand command = new AccuRevCheckInCommand( getLogger() );

        CommandParameters commandParameters = new CommandParameters();
        commandParameters.setString( CommandParameter.MESSAGE, "A commit message" );
        CheckInScmResult result = command.checkIn( repo, testFileSet, commandParameters );

        assertThat( result.isSuccess(), is( true ) );
        assertThat( result.getCheckedInFiles().size(), is( 2 ) );
        assertHasScmFile( result.getCheckedInFiles(), "kept/file", ScmFileStatus.CHECKED_IN );
View Full Code Here

        when( accurev.promoteAll( basedir, "A commit message" ) ).thenReturn( null );

        AccuRevCheckInCommand command = new AccuRevCheckInCommand( getLogger() );

        CommandParameters commandParameters = new CommandParameters();
        commandParameters.setString( CommandParameter.MESSAGE, "A commit message" );
        CheckInScmResult result = command.checkIn( repo, testFileSet, commandParameters );

        assertThat( result.isSuccess(), is( false ) );
        assertThat( result.getProviderMessage(), notNullValue() );
    }
View Full Code Here

        // TODO test basedir is top + project path. is OK.
        when( accurev.info( basedir ) ).thenReturn( info );

        AccuRevCheckInCommand command = new AccuRevCheckInCommand( getLogger() );

        CommandParameters commandParameters = new CommandParameters();
        commandParameters.setString( CommandParameter.MESSAGE, "Commit message" );
        command.checkIn( repo, testFileSet, commandParameters );
        fail( "Expected ScmException" );
    }
View Full Code Here

        when( accurev.promote( basedir, files, "A commit message" ) ).thenReturn( files );

        AccuRevCheckInCommand command = new AccuRevCheckInCommand( getLogger() );

        CommandParameters commandParameters = new CommandParameters();
        commandParameters.setString( CommandParameter.MESSAGE, "A commit message" );
        CheckInScmResult result = command.checkIn( repo, testFileSet, commandParameters );

        assertThat( result.isSuccess(), is( true ) );
        assertThat( result.getCheckedInFiles().size(), is( 2 ) );
        assertHasScmFile( result.getCheckedInFiles(), "project/dir/pom.xml", ScmFileStatus.CHECKED_IN );
View Full Code Here

        when( accurev.update( eq( basedir ), any( String.class ) ) ).thenReturn( files );

        AccuRevUpdateCommand command = new AccuRevUpdateCommand( getLogger() );

        CommandParameters commandParameters = new CommandParameters();
        commandParameters.setString( CommandParameter.RUN_CHANGELOG_WITH_UPDATE, Boolean.toString( false ) );
        UpdateScmResult result = command.update( repo, testFileSet, commandParameters );

        assertThat( result.isSuccess(), is( true ) );
        assertThat( result.getUpdatedFiles().size(), is( 2 ) );
        assertHasScmFile( result.getUpdatedFiles(), "updated/file", ScmFileStatus.UPDATED );
View Full Code Here

TOP

Related Classes of org.apache.maven.scm.CommandParameters

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.