Package org.apache.maven.scm

Examples of org.apache.maven.scm.CommandParameters


    public MkdirScmResult mkdir( ScmRepository repository, ScmFileSet fileSet, String message, boolean createInLocal )
        throws ScmException
    {
        login( repository, fileSet );

        CommandParameters parameters = new CommandParameters();

        if ( message == null )
        {
            message = "";
            if ( !createInLocal )
            {
                getLogger().warn( "Commit message is empty!" );
            }
        }

        parameters.setString( CommandParameter.MESSAGE, message );

        parameters.setString( CommandParameter.SCM_MKDIR_CREATE_IN_LOCAL, Boolean.toString( createInLocal ) );

        return mkdir( repository.getProviderRepository(), fileSet, parameters );
    }
View Full Code Here


    }

    private void login( ScmRepository repository, ScmFileSet fileSet )
        throws ScmException
    {
        LoginScmResult result = login( repository.getProviderRepository(), fileSet, new CommandParameters() );

        if ( !result.isSuccess() )
        {
            throw new ScmException( "Can't login.\n" + result.getCommandOutput() );
        }
View Full Code Here

    public RemoveScmResult remove( ScmRepository repository, ScmFileSet fileSet, String message )
        throws ScmException
    {
        login( repository, fileSet );

        CommandParameters parameters = new CommandParameters();

        parameters.setString( CommandParameter.MESSAGE, message == null ? "" : message );

        return remove( repository.getProviderRepository(), fileSet, parameters );
    }
View Full Code Here

        logger = new PlexusLogger( loggerManager.getLoggerForComponent( ScmManager.ROLE ) );
        // Construct the SCM Repository and initialize our command execution variables
        ScmRepository repo = scmManager.makeScmRepository( testScmURL );
        iRepo = (IntegrityScmProviderRepository) repo.getProviderRepository();
        fileSet = new ScmFileSet( getTestFile( "target/test-execution" ) );
        parameters = new CommandParameters();
        // Set the tag name for our tag and branch commands
        parameters.setString( CommandParameter.TAG_NAME,
                              "Maven-${new java.text.SimpleDateFormat(\"yyyyMMddHHmmssSSS\").format(new Date())}" );
        // Connect to the MKS Integrity Server
        IntegrityLoginCommand login = new IntegrityLoginCommand();
View Full Code Here

    {
        final ScmFileSet testFileSet = new ScmFileSet( new File( basedir, "project/dir" ) );

        AccuRevChangeLogCommand command = new AccuRevChangeLogCommand( getLogger() );

        CommandParameters params = new CommandParameters();
        params.setScmVersion( CommandParameter.START_SCM_VERSION, new ScmRevision( "aStream/12" ) );
        params.setScmVersion( CommandParameter.END_SCM_VERSION, new ScmRevision( "anotherStream/20" ) );

        try
        {
            command.changelog( repo, testFileSet, params );
            fail( "Expected accurev exception" );
View Full Code Here

        List<Transaction> noTransactions = Collections.emptyList();
        when( accurev.history( "aStream", "13", "42", 0, false, false ) ).thenReturn( noTransactions );

        AccuRevChangeLogCommand command = new AccuRevChangeLogCommand( getLogger() );
        CommandParameters params = new CommandParameters();
        params.setScmVersion( CommandParameter.START_SCM_VERSION, new ScmRevision( "aStream/12" ) );

        assertThat( command.changelog( repo, testFileSet, params ), not( nullValue() ) );

    }
View Full Code Here

        when( accurev.history( "myStream", "36", "42", 0, false, false ) ).thenReturn( Arrays.asList( promoteOne,
                                                                                                      promoteTwo ) );

        AccuRevChangeLogCommand command = new AccuRevChangeLogCommand( getLogger() );

        CommandParameters commandParameters = new CommandParameters();
        commandParameters.setString( CommandParameter.MESSAGE, "A commit message" );
        commandParameters.setDate( CommandParameter.START_DATE, dateFrom );
        commandParameters.setDate( CommandParameter.END_DATE, dateTo );
        ChangeLogScmResult result = command.changelog( repo, testFileSet, commandParameters );

        assertThat( result.isSuccess(), is( true ) );
        List<ChangeSet> changeSets = result.getChangeLog().getChangeSets();
        assertThat( changeSets.size(), is( 3 ) );
View Full Code Here

        when( accurev.history( "workspace5", "36", "42", 0, false, false ) ).thenReturn( Collections
                                                                                             .singletonList( keepWS5 ) );

        AccuRevChangeLogCommand command = new AccuRevChangeLogCommand( getLogger() );

        CommandParameters commandParameters = new CommandParameters();
        commandParameters.setScmVersion( CommandParameter.START_SCM_VERSION, new ScmRevision( "workspace5/35" ) );
        commandParameters.setScmVersion( CommandParameter.END_SCM_VERSION, new ScmRevision( "workspace5/42" ) );
        ChangeLogScmResult result = command.changelog( repo, testFileSet, commandParameters );

        assertThat( result.isSuccess(), is( true ) );
        ChangeLogSet changelog = result.getChangeLog();
        assertThat( changelog.getStartVersion().getName(), is( "workspace5/35" ) );
View Full Code Here

              accurev.history( eq( "myStream" ), any( String.class ), any( String.class ), eq( 0 ), eq( false ),
                               eq( false ) ) ).thenReturn( null );

        AccuRevChangeLogCommand command = new AccuRevChangeLogCommand( getLogger() );

        CommandParameters commandParameters = new CommandParameters();
        commandParameters.setString( CommandParameter.MESSAGE, "A commit message" );
        commandParameters.setDate( CommandParameter.START_DATE, dateFrom );
        commandParameters.setDate( CommandParameter.END_DATE, dateTo );
        ChangeLogScmResult result = command.changelog( repo, testFileSet, commandParameters );

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

        ScmProvider provider = getScmManager().getProviderByUrl( getScmUrl() );
        ScmProviderRepository repository = provider.makeProviderScmRepository( getRepositoryRoot() );
        assertNotNull( repository );
        InfoScmResult result =
            provider.info( repository, new ScmFileSet( getRepositoryRoot() ), new CommandParameters() );
        assertNotNull( result );
        assertEquals( "cd3c0dfacb65955e6fbb35c56cc5b1bf8ce4f767", result.getInfoItems().get( 0 ).getRevision() );
        //
    }
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.