Package org.apache.maven.scm.command.login

Examples of org.apache.maven.scm.command.login.LoginScmResult


    }

    private void login( ScmRepository repository, ScmFileSet fileSet )
        throws ScmException
    {
        LoginScmResult result = login( repository.getProviderRepository(), fileSet, new CommandParameters() );

        if ( !result.isSuccess() )
        {
            throw new ScmException( "Can't login.\n" + result.getCommandOutput() );
        }
    }
View Full Code Here


    }

    protected LoginScmResult login( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters )
        throws ScmException
    {
        return new LoginScmResult( null, null, null, true );
    }
View Full Code Here

        catch ( CommandLineException e )
        {
            throw new ScmException( e.getMessage(), e );
        }

        return new LoginScmResult( cl.toString(), isSuccess ? "Login successful" : "Login failed",
                                   consumer.getOutput(), isSuccess );
    }
View Full Code Here

    }

    private void login( ScmRepository repository, ScmFileSet fileSet )
        throws ScmException
    {
        LoginScmResult result = login( repository.getProviderRepository(), fileSet, new CommandParameters() );

        if ( !result.isSuccess() )
        {
            throw new ScmException( "Can't login.\n" + result.getCommandOutput() );
        }
    }
View Full Code Here

    }

    protected LoginScmResult login( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters )
        throws ScmException
    {
        return new LoginScmResult( null, null, null, true );
    }
View Full Code Here

    }

    private void login( ScmRepository repository, ScmFileSet fileSet )
        throws ScmException
    {
        LoginScmResult result = login( repository.getProviderRepository(), fileSet, new CommandParameters() );

        if ( !result.isSuccess() )
        {
            throw new ScmException( "Can't login.\n" + result.getCommandOutput() );
        }
    }
View Full Code Here

    }

    protected LoginScmResult login( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters )
        throws ScmException
    {
        return new LoginScmResult( null, null, null, true );
    }
View Full Code Here

    public LoginScmResult executeLoginCommand( ScmProviderRepository repository, ScmFileSet fileSet,
                                               CommandParameters params )
        throws ScmException
    {
        getLogger().info( "Attempting to connect with the MKS Integrity Server" );
        LoginScmResult result;
        IntegrityScmProviderRepository iRepo = (IntegrityScmProviderRepository) repository;
        APISession api = iRepo.getAPISession();
        try
        {
            // First we will establish a connection to the MKS Integrity Server
            Response res = api.connect( iRepo.getHost(), iRepo.getPort(), iRepo.getUser(), iRepo.getPassword() );
            int exitCode = res.getExitCode();
            boolean success = ( exitCode == 0 ? true : false );
            result = new LoginScmResult( res.getCommandString(), "", "Exit Code: " + exitCode, success );

            // Next we will prepare the Project and Sandbox for the other commands
            Project siProject = new Project( api, iRepo.getConfigruationPath() );
            Sandbox siSandbox = new Sandbox( api, siProject, fileSet.getBasedir().getAbsolutePath() );
            iRepo.setProject( siProject );
            iRepo.setSandbox( siSandbox );
        }
        catch ( APIException aex )
        {
            ExceptionHandler eh = new ExceptionHandler( aex );
            getLogger().error( "MKS API Exception: " + eh.getMessage() );
            getLogger().info( eh.getCommand() + " exited with return code " + eh.getExitCode() );
            result = new LoginScmResult( eh.getCommand(), eh.getMessage(), "Exit Code: " + eh.getExitCode(), false );
        }

        return result;
    }
View Full Code Here

            result = info.isLoggedIn();
            providerMessage = result ? ( "Logged in externally as " + info.getUser() ) : "Not logged in";
        }

        getLogger().debug( providerMessage );
        return new LoginScmResult( accurev.getCommandLines(), providerMessage, accurev.getErrorOutput(), result );

    }
View Full Code Here

        info.setUser( "(not logged in)" );
        when( accurev.info( any( File.class ) ) ).thenReturn( info );
        when( accurev.login( "myUser", "aPassword" ) ).thenReturn( true );
        AccuRevLoginCommand command = new AccuRevLoginCommand( getLogger() );

        LoginScmResult result = command.login( repo, new ScmFileSet( basedir ), new CommandParameters() );

        assertThat( result.isSuccess(), is( true ) );
        verify( accurev ).login( "myUser", "aPassword" );

    }
View Full Code Here

TOP

Related Classes of org.apache.maven.scm.command.login.LoginScmResult

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.