Package org.cloudfoundry.client.lib

Examples of org.cloudfoundry.client.lib.CloudCredentials


    HttpProxyConfiguration proxyConfiguration = getProxy(url);
    return new CloudFoundryClient(url, proxyConfiguration);
  }

  protected static CloudCredentials getCredentials(String userName, String password) {
    return new CloudCredentials(userName, password);
  }
View Full Code Here


  }

  public void testValidPasswordOperationHandler() throws Exception {

    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);
View Full Code Here

    CredentialProperties credentials = getTestFixture().getCredentials();

    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;
View Full Code Here

    CredentialProperties credentials = getTestFixture().getCredentials();

    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;
View Full Code Here

  public void testInvalidAndValidCredentials() throws Exception {
    CredentialProperties credentials = getTestFixture().getCredentials();

    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 {
View Full Code Here

   * @param username
   * @param password
   * @throws CoreException
   */
  protected void connectClient(String username, String password) throws CoreException {
    CloudCredentials credentials = new CloudCredentials(username, password);
    connectClient(credentials);
  }
View Full Code Here

    if (password == null) {
      // lost the password, start with an empty one to avoid assertion
      // error
      password = ""; //$NON-NLS-1$
    }
    return createClient(serverURL, new CloudCredentials(userName, password), cloudSpace, selfSigned);
  }
View Full Code Here

    try {
      CloudFoundryServer cloudServer = (CloudFoundryServer) server.loadAdapter(CloudFoundryServer.class, null);

      String userName = cloudServer.getUsername();
      CloudCredentials credentials = new CloudCredentials(userName, "invalid-password");
      connectClient(credentials);

      assertDeployApplicationStartMode(prefix);

      fail("Expected CoreException due to invalid password");
View Full Code Here

    // Now create a separate external standalone client (external to the WST
    // CF Server instance) to delete the app
    URL url = new URL(getTestFixture().getUrl());
    CloudFoundryOperations client = CloudFoundryPlugin.getCloudFoundryClientFactory().getCloudFoundryOperations(
        new CloudCredentials(getTestFixture().getCredentials().userEmail,
            getTestFixture().getCredentials().password), url, false);
    client.login();
    client.deleteApplication(appName);

    // Now check if the app is indeed deleted through the server behaviour
View Full Code Here

    // Now create an external client to independently check that the
    // application remains deployed and in started mode
    URL url = new URL(getTestFixture().getUrl());
    CloudFoundryOperations client = CloudFoundryPlugin.getCloudFoundryClientFactory().getCloudFoundryOperations(
        new CloudCredentials(getTestFixture().getCredentials().userEmail,
            getTestFixture().getCredentials().password), url, false);
    client.login();
    List<CloudApplication> deployedApplications = client.getApplications();
    assertTrue("Expected one cloud application for " + appPrefix + " but got: " + deployedApplications.size(),
        deployedApplications.size() == 1);
View Full Code Here

TOP

Related Classes of org.cloudfoundry.client.lib.CloudCredentials

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.