Examples of AddScmResult


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

            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

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

            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

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

        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

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

        String includes = Sandbox.formatFilePatterns( fileSet.getIncludes() );
        String msg = ( ( null == message || message.length() == 0 ) ? System.getProperty( "message" ) : message );
        List<ScmFile> addedFiles = siSandbox.addNonMembers( excludes, includes, msg );
        if ( siSandbox.getOverallAddSuccess() )
        {
            return new AddScmResult( "si add", addedFiles );
        }
        else
        {
            return new AddScmResult( addedFiles,
                                     new ScmResult( "si add", "There was a problem adding files to the repository", "",
                                                    false ) );
        }
    }
View Full Code Here

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

        File workingDir = fileSet.getBasedir();
        HgAddConsumer consumer = new HgAddConsumer( getLogger(), workingDir );
        ScmResult result = HgUtils.execute( consumer, getLogger(), workingDir, addCmd );

        AddScmResult addScmResult = new AddScmResult( consumer.getAddedFiles(), result );

        // add in bogus 'added' results for empty directories.  only need to do this because the maven scm unit test
        // framework seems to think that this is the way we should behave.  it's pretty hacky. -rwd
        for ( File workingFile : fileSet.getFileList() )
        {
            File file = new File( workingDir + "/" + workingFile.getPath() );
            if ( file.isDirectory() && file.listFiles().length == 0 )
            {
                addScmResult.getAddedFiles().add( new ScmFile( workingFile.getPath(), ScmFileStatus.ADDED ) );
            }
        }

        return addScmResult;
    }
View Full Code Here

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

        createBarJava( barJava );

        changeReadmeTxt( readmeTxt );

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

        assertResultIsSuccess( addResult );
View Full Code Here

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

        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

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

            throw new ScmException( "Error while executing command.", ex );
        }

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

        return new AddScmResult( cl.toString(), consumer.getAddedFiles() );
    }
View Full Code Here

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

        ScmProvider provider = getScmManager().getProviderByUrl( getScmUrl() );

        CommandParameters commandParameters = new CommandParameters();
        commandParameters.setString( CommandParameter.FORCE_ADD, Boolean.TRUE.toString() );

        AddScmResult result = provider.add( repository, new ScmFileSet( workingDirectory, file ), commandParameters );

        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

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

        }

        // TODO: actually it may have partially succeeded - should we cvs update the files and parse "A " responses?
        if ( exitCode != 0 )
        {
            return new AddScmResult( cl.toString(), "The cvs command failed.", stderr.getOutput(), false );
        }

        return new AddScmResult( cl.toString(), addedFiles );
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.