Package org.apache.deltacloud.client

Examples of org.apache.deltacloud.client.DeltaCloudClient.listInstances()


   */

  @Test
  public void listContainsTestInstance() throws DeltaCloudClientException {
    DeltaCloudClient client = testSetup.getClient();
    List<Instance> instances = client.listInstances();
    assertTrue(instances.size() > 0);
    Instance testInstance = testSetup.getTestInstance();
    assertNotNull(testSetup.getInstanceById(testInstance.getId(), client));
  }

View Full Code Here


    Image image = testSetup.getFirstImage(testSetup.getClient());
    DeltaCloudClient client = testSetup.getClient();
    Instance instance = client.createInstance(image.getId());
    instance.stop(client);
    instance.destroy(client);
    client.listInstances(instance.getId());
  }

  @Test(expected = DeltaCloudClientException.class)
  public void destroyThrowsExceptionOnUnknowInstanceId() throws DeltaCloudClientException, IllegalArgumentException,
      InstantiationException, IllegalAccessException, InvocationTargetException, SecurityException,
View Full Code Here

  @Test
  public void canShutdownInstance() throws DeltaCloudClientException {
    Instance testInstance = testSetup.getTestInstance();
    DeltaCloudClient client = testSetup.getClient();
    testInstance.stop(client);
    testInstance = client.listInstances(testInstance.getId()); // reload!
    assertEquals(State.STOPPED, testInstance.getState());
  }

  @Test
  public void canStartInstance() throws DeltaCloudClientException {
View Full Code Here

    DeltaCloudClient client = testSetup.getClient();
    if (testInstance.getState() == State.RUNNING) {
      testInstance.stop(client);
    }
    testInstance.start(client);
    testInstance = client.listInstances(testInstance.getId()); // reload!
    assertEquals(State.RUNNING, testInstance.getState());
  }

  @Test
  public void canStartInstanceByAction() throws DeltaCloudClientException {
View Full Code Here

    DeltaCloudClient client = testSetup.getClient();
    if (testInstance.getState() == State.RUNNING) {
      testInstance.stop(client);
    }
    assertTrue(testInstance.start(client));
    testInstance = client.listInstances(testInstance.getId()); // reload!
    assertEquals(State.RUNNING, testInstance.getState());
  }

  @Test
  public void cannotStartRunningInstance() throws DeltaCloudClientException {
View Full Code Here

  @Test
  public void cannotDestroyRunningInstance() throws DeltaCloudClientException {
    Instance testInstance = testSetup.getTestInstance();
    DeltaCloudClient client = testSetup.getClient();
    testInstance = client.listInstances(testInstance.getId()); // reload
    assertTrue(testInstance.getState() == State.RUNNING);
    assertFalse(testInstance.destroy(client));
  }

  @Test
View Full Code Here

      ExecutionException {
    Instance testInstance = testSetup.getTestInstance();
    DeltaCloudClient client = testSetup.getClient();
    try {
      testInstance.stop(client);
      testInstance = client.listInstances(testInstance.getId()); // reload
      assertTrue(testInstance.getState() == State.STOPPED);
      assertFalse(testInstance.reboot(client));
    } finally {
      testInstance.start(client);
      client.listInstances(testInstance.getId()); // reload
View Full Code Here

      testInstance = client.listInstances(testInstance.getId()); // reload
      assertTrue(testInstance.getState() == State.STOPPED);
      assertFalse(testInstance.reboot(client));
    } finally {
      testInstance.start(client);
      client.listInstances(testInstance.getId()); // reload
    }
  }
}
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.