Package org.apache.deltacloud.client

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


  @Test
  public void canCreateKey() throws DeltaCloudClientException {
    String id = "test" + System.currentTimeMillis();
    DeltaCloudClient client = testSetup.getClient();
    try {
      Key key = client.createKey(id);
      assertNotNull(key);
      assertEquals(id, key.getId());
    } finally {
      quietlyDeleteKey(id);
    }
View Full Code Here


  @Test(expected = DeltaCloudClientException.class)
  public void createDuplicateKeyThrowsException() throws DeltaCloudClientException {
    String id = "test" + System.currentTimeMillis();
    DeltaCloudClient client = testSetup.getClient();
    try {
      client.createKey(id);
      client.createKey(id);
    } finally {
      quietlyDeleteKey(id);
    }
  }
View Full Code Here

  public void createDuplicateKeyThrowsException() throws DeltaCloudClientException {
    String id = "test" + System.currentTimeMillis();
    DeltaCloudClient client = testSetup.getClient();
    try {
      client.createKey(id);
      client.createKey(id);
    } finally {
      quietlyDeleteKey(id);
    }
  }
View Full Code Here

   */
  @Test(expected = DeltaCloudNotFoundClientException.class)
  public void canDeleteKey() throws DeltaCloudClientException {
    String id = "test" + System.currentTimeMillis();
    DeltaCloudClient client = testSetup.getClient();
    Key key = client.createKey(id);
    assertNotNull(key);
    assertEquals(id, key.getId());
    key.destroy(client);
    client.listKey(key.getId());
  }
View Full Code Here

  @Test
  public void canListKey() throws DeltaCloudClientException {
    String id = String.valueOf(System.currentTimeMillis());
    DeltaCloudClient client = testSetup.getClient();
    try {
      Key createdKey = client.createKey(id);
      Key listedKey = client.listKey(id);
      assertEquals(createdKey.getId(), listedKey.getId());
    } finally {
      quietlyDeleteKey(id);
    }
View Full Code Here

  @Test
  public void canListKeys() throws DeltaCloudClientException {
    String id = String.valueOf(System.currentTimeMillis());
    DeltaCloudClient client = testSetup.getClient();
    try {
      final Key createdKey = client.createKey(id);
      List<Key> keys = client.listKeys();
      assertNotNull(keys);
      assertThat(keys, hasItem(new BaseMatcher<Key>() {

        @Override
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.