Package org.apache.maven.scm.command.add

Examples of org.apache.maven.scm.command.add.AddScmResult


        // command line can be too long for windows so add files individually (see SCM-697)
        if ( Os.isFamily( Os.FAMILY_WINDOWS ) )
        {
            for ( File file : files )
            {
                AddScmResult result = executeAddFiles( workingDirectory, Collections.singletonList( file ) );

                if ( result != null )
                {
                    return result;
                }
            }
        }
        else
        {
            AddScmResult result = executeAddFiles( workingDirectory, files );

            if ( result != null )
            {
                return result;
            }
View Full Code Here


        int exitCode = GitCommandLineUtils.execute( cl, stdout, stderr, getLogger() );

        if ( exitCode != 0 )
        {
            return new AddScmResult( cl.toString(), "The git-add command failed.", stderr.getOutput(), false );
        }

        return null;
    }
View Full Code Here

        createBarJava( barJava );

        changeReadmeTxt( readmeTxt );

        AddScmResult addResult = getScmManager().add( getScmRepository(),
                                                      new ScmFileSet( getWorkingCopy(), "src/main/java/Foo.java",
                                                                      null ) );

        assertResultIsSuccess( addResult );
View Full Code Here

        createBarJava( barJava );

        changeReadmeTxt( readmeTxt );

        AddScmResult addResult =
            getScmManager().getProviderByUrl( getScmUrl() ).add( getScmRepository(),
                                                                 new ScmFileSet( getWorkingCopy(),
                                                                                 "src/main/java/Foo.java", null ) );

        assertResultIsSuccess( addResult );
View Full Code Here

        ErrorStreamConsumer err = new ErrorStreamConsumer();

        int status = command.execute( fileConsumer, err );
        if ( status != 0 || err.hasBeenFed() )
        {
            return new AddScmResult( command.getCommandString(), "Error code for TFS add command - " + status,
                                     err.getOutput(), false );
        }
       
        return new AddScmResult( command.getCommandString(), fileConsumer.getFiles() );
    }
View Full Code Here

     * Create a new ScmProviderStub with bogus (not null) attributes
     */
    public ScmProviderStub()
    {
        setScmSpecificFilename( "" );
        setAddScmResult( new AddScmResult( "", Collections.<ScmFile>emptyList() ) );
        setBranchScmResult( new BranchScmResult( "", Collections.<ScmFile>emptyList() ) );
        setChangeLogScmResult( new ChangeLogScmResult( "", "", "", true ) );
        setCheckInScmResult( new CheckInScmResult( "", "", "", true ) );
        setCheckOutScmResult( new CheckOutScmResult( "", "", "", true ) );
        setDiffScmResult( new DiffScmResult( "", "", "", true ) );
View Full Code Here

            MavenProject rootProject = ReleaseUtil.getRootProject( reactorProjects );
            ScmFileSet scmFileSet = new ScmFileSet( rootProject.getFile().getParentFile(), releasePoms );

            try
            {
                AddScmResult scmResult = scmProvider.add( scmRepository, scmFileSet );

                if ( !scmResult.isSuccess() )
                {
                    throw new ReleaseScmCommandException( "Cannot add release POM to SCM", scmResult );
                }
            }
            catch ( ScmException exception )
View Full Code Here

            MavenProject rootProject = ReleaseUtil.getRootProject( reactorProjects );
            ScmFileSet scmFileSet = new ScmFileSet( rootProject.getFile().getParentFile(), releasePoms );

            try
            {
                AddScmResult scmResult = scmProvider.add( scmRepository, scmFileSet );

                if ( !scmResult.isSuccess() )
                {
                    throw new ReleaseScmCommandException( "Cannot add release POM to SCM", scmResult );
                }
            }
            catch ( ScmException exception )
View Full Code Here

        MavenProject rootProject = ReleaseUtil.getRootProject( reactorProjects );
        ScmFileSet fileSet = new ScmFileSet( rootProject.getFile().getParentFile(), releasePoms );

        when( scmProviderMock.add( isA( ScmRepository.class ),
                                   argThat( new IsScmFileSetEquals( fileSet ) ) ) ).
                                       thenReturn( new AddScmResult( "...",
                                                                     Collections.singletonList( new ScmFile( Maven.RELEASE_POMv4, ScmFileStatus.ADDED ) ) ) );
       
       
        ScmManagerStub stub = (ScmManagerStub) lookup( ScmManager.ROLE );
        stub.setScmProvider( scmProviderMock );
View Full Code Here

     */
    protected void addToWorkingTree( File workingDirectory, File file, ScmRepository repository )
        throws Exception
    {
        ScmProvider provider = getScmManager().getProviderByUrl( getScmUrl() );
        AddScmResult result = provider.add( repository, new ScmFileSet( workingDirectory, file ) );

        assertTrue( "Check result was successful, output: " + result.getCommandOutput(), result.isSuccess() );

        List<ScmFile> addedFiles = result.getAddedFiles();

        if ( new File( workingDirectory, file.getPath() ).isFile() )
        {
            // Don't check directory add because some SCM tools ignore it
            assertEquals( "Expected 1 file in the added files list " + addedFiles, 1, addedFiles.size() );
View Full Code Here

TOP

Related Classes of org.apache.maven.scm.command.add.AddScmResult

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.