Package org.apache.maven.scm

Examples of org.apache.maven.scm.CommandParameters


        GitScmTestUtils.initRepo( "src/test/resources/git/info", getRepositoryRoot(), getWorkingCopy() );

        ScmProvider provider = getScmManager().getProviderByUrl( getScmUrl() );
        ScmProviderRepository repository = provider.makeProviderScmRepository( getRepositoryRoot() );
        assertNotNull( repository );
        CommandParameters commandParameters = new CommandParameters();
        commandParameters.setInt( CommandParameter.SCM_SHORT_REVISION_LENGTH, 6 );
        InfoScmResult result = provider.info( repository, new ScmFileSet( getRepositoryRoot() ), commandParameters );
        assertNotNull( result );
        assertEquals( "revision must be short, exactly 6 digits ", "cd3c0d",
                      result.getInfoItems().get( 0 ).getRevision() );
    }
View Full Code Here


        GitScmTestUtils.initRepo( "src/test/resources/git/info", getRepositoryRoot(), getWorkingCopy() );

        ScmProvider provider = getScmManager().getProviderByUrl( getScmUrl() );
        ScmProviderRepository repository = provider.makeProviderScmRepository( getRepositoryRoot() );
        assertNotNull( repository );
        CommandParameters commandParameters = new CommandParameters();
        commandParameters.setInt( CommandParameter.SCM_SHORT_REVISION_LENGTH, GitInfoCommand.NO_REVISION_LENGTH );
        InfoScmResult result = provider.info( repository, new ScmFileSet( getRepositoryRoot() ), commandParameters );
        assertNotNull( result );
        assertEquals( "revision should not be short", "cd3c0dfacb65955e6fbb35c56cc5b1bf8ce4f767",
                      result.getInfoItems().get( 0 ).getRevision() );
    }
View Full Code Here

        GitScmTestUtils.initRepo( "src/test/resources/git/info", getRepositoryRoot(), getWorkingCopy() );

        ScmProvider provider = getScmManager().getProviderByUrl( getScmUrl() );
        ScmProviderRepository repository = provider.makeProviderScmRepository( getRepositoryRoot() );
        assertNotNull( repository );
        CommandParameters commandParameters = new CommandParameters();
        commandParameters.setInt( CommandParameter.SCM_SHORT_REVISION_LENGTH, 0 );
        InfoScmResult result = provider.info( repository, new ScmFileSet( getRepositoryRoot() ), commandParameters );
        assertNotNull( result );
        assertTrue( "revision should be not empty, minimum 4 (see git help rev-parse --short)",
                    result.getInfoItems().get( 0 ).getRevision().length() >= 4 );
    }
View Full Code Here

        {
            // add the directory, but not commit
            LocalAddCommand addCmd = new LocalAddCommand();
            addCmd.setLogger( getLogger() );

            CommandParameters parameters = new CommandParameters();
            parameters.setString( CommandParameter.MESSAGE, message );
            parameters.setString( CommandParameter.BINARY, "false" );

            String path = ( (File) fileSet.getFileList().get( 0 ) ).getPath();
            if ( repo.isFileAdded( path ) )
            {
                return new MkdirScmResult( null, "Directory already exists!", "Directory already exists.", false );
View Full Code Here

     */
    public BlameScmResult executeBlameCommand( ScmProviderRepository repo, ScmFileSet workingDirectory,
                                               String filename )
        throws ScmException
    {
        CommandParameters commandParameters = new CommandParameters();
        commandParameters.setString( CommandParameter.FILE, filename );
        commandParameters.setString( CommandParameter.IGNORE_WHITESPACE, Boolean.FALSE.toString() );
        return (BlameScmResult) execute( repo, workingDirectory, commandParameters );
    }
View Full Code Here

                                   (Collection<File>) argThat( hasItem( new File( "/./project/dir" ) ) ) ) ).thenReturn(
                                                                                                                         poppedFiles );

        AccuRevExportCommand command = new AccuRevExportCommand( getLogger() );

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

        ExportScmResult result = command.export( repo, new ScmFileSet( basedir ), params );

        assertTrue( result.isSuccess() );
        assertHasScmFile( result.getExportedFiles(), "exported/file", ScmFileStatus.CHECKED_OUT );
View Full Code Here

                                   (Collection<File>) argThat( hasItem( new File( "/./project/dir" ) ) ) ) ).thenReturn(
                                                                                                                         poppedFiles );

        AccuRevExportCommand command = new AccuRevExportCommand( getLogger() );

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

        ExportScmResult result = command.export( repo, new ScmFileSet( basedir ), params );

        assertTrue( result.isSuccess() );
        assertHasScmFile( result.getExportedFiles(), "exported/file", ScmFileStatus.CHECKED_OUT );
View Full Code Here

                                   (Collection<File>) argThat( hasItem( new File( "/./project/dir" ) ) ) ) ).thenReturn(
                                                                                                                         poppedFiles );

        AccuRevExportCommand command = new AccuRevExportCommand( getLogger() );

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

        ExportScmResult result = command.export( repo, new ScmFileSet( basedir ), params );

        assertTrue( result.isSuccess() );
        assertHasScmFile( result.getExportedFiles(), "exported/file", ScmFileStatus.CHECKED_OUT );
View Full Code Here

                                   (Collection<File>) argThat( hasItem( new File( "/./project/dir" ) ) ) ) ).thenReturn(
                                                                                                                         null );

        AccuRevExportCommand command = new AccuRevExportCommand( getLogger() );

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

        ExportScmResult result = command.export( repo, new ScmFileSet( basedir ), params );

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

        repo.setPersistCheckout( true );

        AccuRevExportCommand command = new AccuRevExportCommand( getLogger() );

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

        ExportScmResult result = command.export( repo, new ScmFileSet( basedir ), params );

        verify( accurev ).rmws( "myStream_me" );
        verify( accurev ).reactivate( "myStream_me" );
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.