Package org.apache.deltacloud.client

Examples of org.apache.deltacloud.client.DeltaCloudClientImpl


  private ExecutorService executor = Executors.newSingleThreadExecutor();

  public void setUp() throws IOException, DeltaCloudClientException {
    ensureDeltaCloudIsRunning();
    this.client = new DeltaCloudClientImpl(DELTACLOUD_URL, DELTACLOUD_USER, DELTACLOUD_PASSWORD);
    Image image = getFirstImage(client);
    this.testInstance = createTestInstance(image);
  }
View Full Code Here


    testSetup.tearDown();
  }

  @Test(expected = DeltaCloudClientException.class)
  public void cannotListIfNotAuthenticated() throws MalformedURLException, DeltaCloudClientException {
    DeltaCloudClientImpl client = new DeltaCloudClientImpl(MockIntegrationTestContext.DELTACLOUD_URL, "badUser", "badPassword");
    client.listImages();
  }
View Full Code Here

    assertTrue(publicAddresses.equals(instance.getPublicAddresses()));
  }

  @Test(expected = DeltaCloudClientException.class)
  public void cannotDestroyIfNotAuthenticated() throws MalformedURLException, DeltaCloudClientException {
    DeltaCloudClientImpl unauthenticatedClient = new DeltaCloudClientImpl(
        MockIntegrationTestContext.DELTACLOUD_URL,
        "badUser", "badPassword");
    Image image = testSetup.getFirstImage(unauthenticatedClient);
    unauthenticatedClient.createInstance(image.getId());
  }
View Full Code Here

            "<dummy></dummy>");
    serverFake.start();
    try {
      assertEquals(
          Driver.UNKNOWN,
          new DeltaCloudClientImpl(
              MockIntegrationTestContext.SERVERFAKE_URL, MockIntegrationTestContext.DELTACLOUD_USER,
              MockIntegrationTestContext.DELTACLOUD_PASSWORD).getServerType());
    } finally {
      serverFake.stop();
    }
View Full Code Here

    }
  }

  @Test(expected = DeltaCloudClientException.class)
  public void listImages_cannotListIfNotAuthenticated() throws MalformedURLException, DeltaCloudClientException {
    DeltaCloudClientImpl client = new DeltaCloudClientImpl(MockIntegrationTestContext.DELTACLOUD_URL, "badUser",
        "badPassword");
    client.listImages();
  }
View Full Code Here

  }

  @Test
  public void throwsDeltaCloudClientExceptionOnUnknownResource() {
    try {
      DeltaCloudClientImpl errorClient = new DeltaCloudClientImpl(MockIntegrationTestContext.DELTACLOUD_URL) {
        @Override
        public List<Image> listImages() throws DeltaCloudClientException {
          request(new DeltaCloudRequest() {

            @Override
            public URL getUrl() throws MalformedURLException {
              return new URL(MockIntegrationTestContext.DELTACLOUD_URL + "/DUMMY");
            }

            @Override
            public HttpMethod getHttpMethod() {
              return HttpMethod.GET;
            }

            @Override
            public String getUrlString() {
              return null;
            }
          }
          );
          return Collections.emptyList();
        }
      };
      errorClient.listImages();
      fail("no exception catched");
    } catch (Exception e) {
      assertEquals(DeltaCloudNotFoundClientException.class, e.getClass());
    }
  }
View Full Code Here

TOP

Related Classes of org.apache.deltacloud.client.DeltaCloudClientImpl

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.