Package org.codehaus.plexus.util.cli

Examples of org.codehaus.plexus.util.cli.Commandline.execute()


            cli.createArgument().setValue( new File( binDirectory, "mvn" ).getAbsolutePath() );

            cli.createArgument().setValue( new File( binDirectory, "m2" ).getAbsolutePath() );

            cli.execute().waitFor();
        }
    }

    private void runMaven( File installation, File basedir, String[] args )
        throws Exception, InterruptedException
View Full Code Here


                // anything that requires an active server connection.
                try
                {
                    Commandline command = new Commandline();
                    command.setExecutable( "p4" );
                    Process proc = command.execute();
                    BufferedReader br = new BufferedReader( new InputStreamReader( proc.getInputStream() ) );
                    @SuppressWarnings( "unused" )
                    String line;
                    while ( ( line = br.readLine() ) != null )
                    {
View Full Code Here

                    cl = createCommandLine( prepo, workingDirectory, version, specname );
                    if ( getLogger().isDebugEnabled() )
                    {
                        getLogger().debug( "Executing: " + PerforceScmProvider.clean( cl.toString() ) );
                    }
                    Process proc = cl.execute();
                    BufferedReader br = new BufferedReader( new InputStreamReader( proc.getInputStream() ) );
                    String line;
                    while ( ( line = br.readLine() ) != null )
                    {
                        if ( getLogger().isDebugEnabled() )
View Full Code Here

                    cl.createArg().setValue( specname );
                    if ( getLogger().isInfoEnabled() )
                    {
                        getLogger().info( "Executing: " + PerforceScmProvider.clean( cl.toString() ) );
                    }
                    Process proc = cl.execute();
                    isReader = new InputStreamReader( proc.getInputStream() );
                    BufferedReader br = new BufferedReader( isReader );
                    String line;
                    while ( ( line = br.readLine() ) != null )
                    {
View Full Code Here

            command.createArg().setValue( "changes" );
            command.createArg().setValue( "-m1" );
            command.createArg().setValue( "-ssubmitted" );
            command.createArg().setValue( "//" + specname + "/..." );
            getLogger().debug( "Executing: " + PerforceScmProvider.clean( command.toString() ) );
            Process proc = command.execute();
            BufferedReader br = new BufferedReader( new InputStreamReader( proc.getInputStream() ) );
            String line;

            String lastChangelistStr = "";
            while ( ( line = br.readLine() ) != null )
View Full Code Here

        {
            if ( getLogger().isDebugEnabled() )
            {
                getLogger().debug( PerforceScmProvider.clean( "Executing: " + cl.toString() ) );
            }
            Process proc = cl.execute();
            OutputStream out = proc.getOutputStream();
            dos = new DataOutputStream( out );
            String label = createLabelSpecification( (PerforceScmProviderRepository) repo, tag, lock );
            if ( getLogger().isDebugEnabled() )
            {
View Full Code Here

        when( mockProcess.getErrorStream() ).thenReturn( mock( InputStream.class ) );
        when( mockProcess.getOutputStream() ).thenReturn( mock( OutputStream.class ) );
        when( mockProcess.waitFor() ).thenReturn( 0 );

        Commandline commandLineMock = mock( Commandline.class );
        when( commandLineMock.execute() ).thenReturn( mockProcess );

        Arg valueArgument = mock( Arg.class );
        when( commandLineMock.createArg() ).thenReturn( valueArgument );
       
        CommandLineFactory commandLineFactoryMock = mock( CommandLineFactory.class );
View Full Code Here

        when( mockProcess.getErrorStream() ).thenReturn( mock( InputStream.class ) );
        when( mockProcess.getOutputStream() ).thenReturn( mock( OutputStream.class ) );
        when( mockProcess.waitFor() ).thenReturn( 0 );
       
        Commandline commandLineMock = mock( Commandline.class );
        when( commandLineMock.execute() ).thenReturn( mockProcess );
       
        Arg argMock = mock( Arg.class );
        when( commandLineMock.createArg() ).thenReturn( argMock );
       
        CommandLineFactory commandLineFactoryMock = mock( CommandLineFactory.class );
View Full Code Here

        when( mockProcess.getErrorStream() ).thenReturn( mock( InputStream.class ) );
        when( mockProcess.getOutputStream() ).thenReturn( mock( OutputStream.class ) );
        when( mockProcess.waitFor() ).thenReturn( 0 );

        Commandline commandLineMock = mock( Commandline.class );
        when( commandLineMock.execute() ).thenReturn( mockProcess );
       
        Arg argMock = mock( Arg.class );
        when( commandLineMock.createArg() ).thenReturn( argMock );

        CommandLineFactory commandLineFactoryMock = mock( CommandLineFactory.class );
View Full Code Here

        when( mockProcess.getOutputStream() ).thenReturn( mock( OutputStream.class ) );
        when( mockProcess.waitFor() ).thenReturn( 1 );
        when( mockProcess.exitValue() ).thenReturn( 1 ); // why was this here in the original test?

        Commandline commandLineMock = mock( Commandline.class );
        when( commandLineMock.execute() ).thenReturn( mockProcess );
       
        Arg argMock = mock( Arg.class );
        when( commandLineMock.createArg() ).thenReturn( argMock );
       
        CommandLineFactory commandLineFactoryMock = mock( CommandLineFactory.class );
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.