Examples of CloudFoundryLoginHandler


Examples of org.cloudfoundry.ide.eclipse.server.core.internal.CloudFoundryLoginHandler

    CredentialProperties credentials = getTestFixture().getCredentials();
    CloudCredentials cloudCredentials = new CloudCredentials(credentials.userEmail, credentials.password);

    CloudFoundryOperations client = createClient(cloudCredentials,
        CloudFoundryTestFixture.CF_PIVOTAL_SERVER_URL_HTTP);
    CloudFoundryLoginHandler operationsHandler = new CloudFoundryLoginHandler(client);

    try {
      operationsHandler.login(new NullProgressMonitor());
    }
    catch (CoreException e) {
      fail("Failed to log in due to: " + e.getMessage());
    }
View Full Code Here

Examples of org.cloudfoundry.ide.eclipse.server.core.internal.CloudFoundryLoginHandler

    String invalidPassword = "invalid password";

    CloudFoundryOperations client = createClient(new CloudCredentials(credentials.userEmail, invalidPassword),
        CloudFoundryTestFixture.CF_PIVOTAL_SERVER_URL_HTTP);

    CloudFoundryLoginHandler operationsHandler = new CloudFoundryLoginHandler(client);
    CoreException error = null;

    try {
      operationsHandler.login(new NullProgressMonitor());
    }
    catch (CoreException e) {
      error = e;
    }
View Full Code Here

Examples of org.cloudfoundry.ide.eclipse.server.core.internal.CloudFoundryLoginHandler

    String invalidUsername = "invalid username";

    CloudFoundryOperations client = createClient(new CloudCredentials(invalidUsername, credentials.password),
        CloudFoundryTestFixture.CF_PIVOTAL_SERVER_URL_HTTP);

    CloudFoundryLoginHandler operationsHandler = new CloudFoundryLoginHandler(client);
    CoreException error = null;

    try {
      operationsHandler.login(new NullProgressMonitor());
    }
    catch (CoreException e) {
      error = e;
    }
View Full Code Here

Examples of org.cloudfoundry.ide.eclipse.server.core.internal.CloudFoundryLoginHandler

    String invalidUsername = "invalid username";

    CloudFoundryOperations client = createClient(new CloudCredentials(invalidUsername, credentials.password),
        CloudFoundryTestFixture.CF_PIVOTAL_SERVER_URL_HTTP);

    CloudFoundryLoginHandler operationsHandler = new CloudFoundryLoginHandler(client);
    CoreException error = null;

    try {
      operationsHandler.login(new NullProgressMonitor());
    }
    catch (CoreException e) {
      error = e;
    }

    assertError(error);

    // CREATE a separate client to test valid connection. the purpose here
    // is to ensure that the server does not retain the incorrect
    // credentials

    client = createClient(new CloudCredentials(credentials.userEmail, credentials.password),
        CloudFoundryTestFixture.CF_PIVOTAL_SERVER_URL_HTTP);

    operationsHandler = new CloudFoundryLoginHandler(client);

    try {
      operationsHandler.login(new NullProgressMonitor());
    }
    catch (CoreException e) {
      fail("Failed to log in due to: " + e.getMessage());
    }
  }
View Full Code Here

Examples of org.cloudfoundry.ide.eclipse.server.core.internal.CloudFoundryLoginHandler

      new ClientRequest<Void>(Messages.VALIDATING_CREDENTIALS) {

        @Override
        protected Void doRun(CloudFoundryOperations client, SubMonitor progress) throws CoreException {
          CloudFoundryLoginHandler operationsHandler = new CloudFoundryLoginHandler(client);
          int attempts = 5;
          operationsHandler.login(progress, attempts, CloudOperationsConstants.LOGIN_INTERVAL);
          return null;
        }

        @Override
        protected CloudFoundryOperations getClient(IProgressMonitor monitor) throws CoreException {
View Full Code Here

Examples of org.cloudfoundry.ide.eclipse.server.core.internal.CloudFoundryLoginHandler

    try {
      return super.runAndWait(client, subProgress);
    }
    catch (CoreException ce) {
      CloudFoundryLoginHandler handler = new CloudFoundryLoginHandler(client);
      if (handler.shouldAttemptClientLogin(ce)) {
        int attempts = 3;
        handler.login(subProgress, attempts, CloudOperationsConstants.LOGIN_INTERVAL);
        return runAndWait(client, subProgress);
      }
      throw ce;
    }
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.