Examples of UpdateScmResult


Examples of org.apache.maven.scm.command.update.UpdateScmResult

                + "'." );

            return;
        }

        UpdateScmResult result = scmManager.update( scmRepository, new ScmFileSet( workingDirectory ), version );

        if ( !result.isSuccess() )
        {
            showError( result );

            return;
        }

        List<ScmFile> updatedFiles = result.getUpdatedFiles();

        System.out.println( "Updated these files: " );

        for ( ScmFile file : updatedFiles )
        {
View Full Code Here

Examples of org.apache.maven.scm.command.update.UpdateScmResult

            int exitCode = StarteamCommandLineUtils.executeCommandline( cl, consumer, stderr, getLogger() );

            if ( exitCode != 0 )
            {
                return new UpdateScmResult( cl.toString(), "The starteam command failed.", stderr.getOutput(), false );
            }
            else
            {
                //hiden feature to allow Continuous Integration machine to
                // delete local files. It affectively remove all build ouput as well
                String doDeleteLocal = System.getProperty( "maven.scm.starteam.deleteLocal" );

                if ( "true".equalsIgnoreCase( doDeleteLocal ) )
                {
                    this.deleteLocal( repository, fileSet, version );
                }
            }
        }
        else
        {
            //update only interested files already on the local disk
            for ( int i = 0; i < updateFiles.size(); ++i )
            {
                File updateFile = (File) updateFiles.get( i );
                ScmFileSet scmFileSet = new ScmFileSet( fileSet.getBasedir(), updateFile );
                Commandline cl = createCommandLine( repository, scmFileSet, version );

                int exitCode = StarteamCommandLineUtils.executeCommandline( cl, consumer, stderr, getLogger() );

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

        return new UpdateScmResult( null, consumer.getCheckedOutFiles() );

    }
View Full Code Here

Examples of org.apache.maven.scm.command.update.UpdateScmResult

        // ----------------------------------------------------------------------

        ScmManager scmManager = getScmManager();
        Date lastUpdate = new Date( System.currentTimeMillis() );
        Thread.sleep( 1000 );
        UpdateScmResult result =
            scmManager.update( repository, new ScmFileSet( getUpdatingCopy() ), lastUpdate );

        assertNotNull( "The command returned a null result.", result );

        assertResultIsSuccess( result );

        List<ScmFile> updatedFiles = result.getUpdatedFiles();

        assertEquals( "Expected 1 files in the updated files list " + updatedFiles, 1, updatedFiles.size() );

        // ----------------------------------------------------------------------
        // Assert the files in the updated files list
View Full Code Here

Examples of org.apache.maven.scm.command.update.UpdateScmResult

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

Examples of org.apache.maven.scm.command.update.UpdateScmResult

        JazzScmCommand updateCmd = createAcceptCommand( repo, fileSet );
        int status = updateCmd.execute( updateConsumer, err );

        if ( status != 0 || err.hasBeenFed() )
        {
            return new UpdateScmResult( updateCmd.getCommandString(),
                                        "Error code for Jazz SCM update command - " + status, err.getOutput(), false );
        }

        if ( getLogger().isDebugEnabled() )
        {
            if ( !updateConsumer.getUpdatedFiles().isEmpty() )
            {
                getLogger().debug( "Iterating over \"Update\" results" );
                for ( ScmFile file : updateConsumer.getUpdatedFiles() )
                {
                    getLogger().debug( file.getPath() + " : " + file.getStatus() );
                }
            }
            else
            {
                getLogger().debug( "There are no updated files" );
            }
        }

        // Now, just (re)load the workspace into the sand box.
        // We can use the checkout directory for this.
        return new UpdateScmResult( updateCmd.getCommandString(), updateConsumer.getUpdatedFiles() );
    }
View Full Code Here

Examples of org.apache.maven.scm.command.update.UpdateScmResult

        setExportScmResult( new ExportScmResult( "", "", "", true ) );
        setRemoveScmResult( new RemoveScmResult( "", "", "", true ) );
        setStatusScmResult( new StatusScmResult( "", "", "", true ) );
        setTagScmResult( new TagScmResult( "", "", "", true ) );
        setUnEditScmResult( new UnEditScmResult( "", "", "", true ) );
        setUpdateScmResult( new UpdateScmResult( "", "", "", true ) );
        setBlameScmResult( new BlameScmResult( "", "", "", true ) );
        setMkdirScmResult( new MkdirScmResult( "", "", "", true ) );
    }
View Full Code Here

Examples of org.apache.maven.scm.command.update.UpdateScmResult

                                                              cl.getWorkingDirectory().getAbsolutePath(), logListener,
                                                              getLogger() );

            if ( !isSuccess )
            {
                return new UpdateScmResult( cl.toString(), "The cvs command failed.",
                                            logListener.getStderr().toString(), false );
            }
            BufferedReader stream = new BufferedReader(
                new InputStreamReader( new ByteArrayInputStream( logListener.getStdout().toString().getBytes() ) ) );

            String line;

            while ( ( line = stream.readLine() ) != null )
            {
                consumer.consumeLine( line );
            }
        }
        catch ( Exception e )
        {
            e.printStackTrace();
            return new UpdateScmResult( cl.toString(), "The cvs command failed.", logListener.getStderr().toString(),
                                        false );
        }

        return new UpdateScmResult( cl.toString(), consumer.getUpdatedFiles() );
    }
View Full Code Here

Examples of org.apache.maven.scm.command.update.UpdateScmResult

        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 );
        assertHasScmFile( result.getUpdatedFiles(), "new/file", ScmFileStatus.UPDATED );

    }
View Full Code Here

Examples of org.apache.maven.scm.command.update.UpdateScmResult

        AccuRevUpdateCommand command = new AccuRevUpdateCommand( getLogger() );

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

        assertThat( result.isSuccess(), is( true ) );
        assertThat( result, IsInstanceOf.instanceOf( AccuRevUpdateScmResult.class ) );
        AccuRevUpdateScmResult accuRevResult = (AccuRevUpdateScmResult) result;
        assertThat( accuRevResult.getFromRevision(), is( "theWorkSpace/123" ) );
        assertThat( accuRevResult.getToRevision(), is( "theWorkSpace/197" ) );
View Full Code Here

Examples of org.apache.maven.scm.command.update.UpdateScmResult

        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( false ) );
        assertThat( result.getProviderMessage(), notNullValue() );

    }
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.