Package org.apache.deltacloud.client

Examples of org.apache.deltacloud.client.DeltaCloudClient


  }

  @Test
  public void canStartInstance() throws DeltaCloudClientException {
    Instance testInstance = testSetup.getTestInstance();
    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());
  }
View Full Code Here


  }

  @Test
  public void canStartInstanceByAction() throws DeltaCloudClientException {
    Instance testInstance = testSetup.getTestInstance();
    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());
  }
View Full Code Here

  }

  @Test
  public void cannotStartRunningInstance() throws DeltaCloudClientException {
    Instance testInstance = testSetup.getTestInstance();
    DeltaCloudClient client = testSetup.getClient();
    testInstance.start(client);
    assertFalse(testInstance.start(client));
  }
View Full Code Here

  }

  @Test
  public void cannotStopStoppedInstance() throws DeltaCloudClientException {
    Instance testInstance = testSetup.getTestInstance();
    DeltaCloudClient client = testSetup.getClient();
    try {
      testInstance.stop(client);
      assertFalse(testInstance.stop(client));
    } finally {
      testInstance.start(client);
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));
  }
View Full Code Here

  @Test
  public void cannotRebootStoppedInstance() throws DeltaCloudClientException, InterruptedException,
      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

TOP

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

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.