private void assertSame(VolumeSnapshot a, VolumeSnapshot b) { assertNotNull(a); assertNotNull(b); assertEquals(a.getId(), b.getId()); assertEquals(a.getDescription(), b.getDescription()); assertEquals(a.getName(), b.getName()); assertEquals(a.getVolumeId(), b.getVolumeId()); }
@Test(dependsOnMethods = "testCreateSnapshot") public void testListSnapshots() { if (volumeOption.isPresent()) { Set<? extends VolumeSnapshot> snapshots = volumeOption.get().listSnapshots().toSet(); assertNotNull(snapshots); boolean foundIt = false; for (VolumeSnapshot snap : snapshots) { VolumeSnapshot details = volumeOption.get().getSnapshot(snap.getId()); if (Objects.equal(snap.getVolumeId(), testVolume.getId())) { foundIt = true; } assertNotNull(details); assertEquals(details.getId(), snap.getId()); assertEquals(details.getVolumeId(), snap.getVolumeId()); } assertTrue(foundIt, "Failed to find the snapshot we previously created in listSnapshots() response"); } }
private void assertSame(VolumeSnapshot a, VolumeSnapshot b) { assertNotNull(a); assertNotNull(b); assertEquals(a.getId(), b.getId()); assertEquals(a.getDescription(), b.getDescription()); assertEquals(a.getName(), b.getName()); assertEquals(a.getVolumeId(), b.getVolumeId()); }
@Test(dependsOnMethods = "testCreateSnapshot") public void testListSnapshots() { if (volumeOption.isPresent()) { Set<? extends VolumeSnapshot> snapshots = volumeOption.get().listSnapshots().toSet(); assertNotNull(snapshots); boolean foundIt = false; for (VolumeSnapshot snap : snapshots) { VolumeSnapshot details = volumeOption.get().getSnapshot(snap.getId()); if (Objects.equal(snap.getVolumeId(), testVolume.getId())) { foundIt = true; } assertNotNull(details); assertEquals(details.getId(), snap.getId()); assertEquals(details.getVolumeId(), snap.getVolumeId()); } assertTrue(foundIt, "Failed to find the snapshot we previously created in listSnapshots() response"); } }
@Test(dependsOnMethods = "testCreateSnapshot") public void testListSnapshotsInDetail() { if (volumeOption.isPresent()) { Set<? extends VolumeSnapshot> snapshots = volumeOption.get().listSnapshotsInDetail().toSet(); assertNotNull(snapshots); boolean foundIt = false; for (VolumeSnapshot snap : snapshots) { VolumeSnapshot details = volumeOption.get().getSnapshot(snap.getId()); if (Objects.equal(snap.getVolumeId(), testVolume.getId())) { foundIt = true; assertSame(details, testSnapshot); } assertSame(details, snap); } assertTrue(foundIt, "Failed to find the snapshot we created in listSnapshotsInDetail() response"); } }
@Test(dependsOnMethods = "testCreateSnapshot") public void testListSnapshotsInDetail() { if (volumeOption.isPresent()) { Set<? extends VolumeSnapshot> snapshots = volumeOption.get().listSnapshotsInDetail().toSet(); assertNotNull(snapshots); boolean foundIt = false; for (VolumeSnapshot snap : snapshots) { VolumeSnapshot details = volumeOption.get().getSnapshot(snap.getId()); if (Objects.equal(snap.getVolumeId(), testVolume.getId())) { foundIt = true; assertSame(details, testSnapshot); } assertSame(details, snap); } assertTrue(foundIt, "Failed to find the snapshot we created in listSnapshotsInDetail() response"); } }
public void testListSnapshotsInDetail() { URI endpoint = URI.create("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v1.1/3456/os-snapshots/detail"); VolumeApi api = requestsSendResponses( keystoneAuthWithUsernameAndPasswordAndTenantName, responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse, authenticatedGET().endpoint(endpoint).build(), HttpResponse.builder().statusCode(200).payload(payloadFromResource("/snapshot_list_detail.json")).build() ).getVolumeExtensionForZone("az-1.region-a.geo-1").get(); Set<? extends VolumeSnapshot> snapshots = api.listSnapshotsInDetail().toSet(); assertEquals(snapshots, ImmutableSet.of(testSnapshot())); // double-check individual fields VolumeSnapshot snappy = Iterables.getOnlyElement(snapshots); assertEquals(snappy.getId(), "7"); assertEquals(snappy.getVolumeId(), "9"); assertEquals(snappy.getStatus(), Volume.Status.AVAILABLE); assertEquals(snappy.getDescription(), "jclouds live test snapshot"); assertEquals(snappy.getName(), "jclouds-live-test"); assertEquals(snappy.getSize(), 1); }
public void testListSnapshotsInDetail() { URI endpoint = URI.create("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v2/3456/os-snapshots/detail"); VolumeApi api = requestsSendResponses( keystoneAuthWithUsernameAndPasswordAndTenantName, responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse, authenticatedGET().endpoint(endpoint).build(), HttpResponse.builder().statusCode(200).payload(payloadFromResource("/snapshot_list_detail.json")).build() ).getVolumeApi("az-1.region-a.geo-1").get(); Set<? extends VolumeSnapshot> snapshots = api.listSnapshotsInDetail().toSet(); assertEquals(snapshots, ImmutableSet.of(testSnapshot())); // double-check individual fields VolumeSnapshot snappy = Iterables.getOnlyElement(snapshots); assertEquals(snappy.getId(), "7"); assertEquals(snappy.getVolumeId(), "9"); assertEquals(snappy.getStatus(), Volume.Status.AVAILABLE); assertEquals(snappy.getDescription(), "jclouds live test snapshot"); assertEquals(snappy.getName(), "jclouds-live-test"); assertEquals(snappy.getSize(), 1); }
public T fromVolumeSnapshot(VolumeSnapshot in) { return this .id(in.getId()) .volumeId(in.getVolumeId()) .status(in.getStatus()) .size(in.getSize()) .created(in.getCreated()) .name(in.getName()) .description(in.getDescription()); } }
public T fromVolumeSnapshot(VolumeSnapshot in) { return this .id(in.getId()) .volumeId(in.getVolumeId()) .status(in.getStatus()) .size(in.getSize()) .created(in.getCreated()) .name(in.getName()) .description(in.getDescription()); } }
public T fromVolumeSnapshot(VolumeSnapshot in) { return this .id(in.getId()) .volumeId(in.getVolumeId()) .status(in.getStatus()) .size(in.getSize()) .created(in.getCreated()) .name(in.getName()) .description(in.getDescription()); } }
public T fromVolumeSnapshot(VolumeSnapshot in) { return this .id(in.getId()) .volumeId(in.getVolumeId()) .status(in.getStatus()) .size(in.getSize()) .created(in.getCreated()) .name(in.getName()) .description(in.getDescription()); } }
public T fromVolumeSnapshot(VolumeSnapshot in) { return this .id(in.getId()) .volumeId(in.getVolumeId()) .status(in.getStatus()) .size(in.getSize()) .created(in.getCreated()) .name(in.getName()) .description(in.getDescription()); } }
public T fromVolumeSnapshot(VolumeSnapshot in) { return this .id(in.getId()) .volumeId(in.getVolumeId()) .status(in.getStatus()) .size(in.getSize()) .created(in.getCreated()) .name(in.getName()) .description(in.getDescription()); } }