Change test now that computeService.listImages() returns a set that refreshes itself - record the before set *size*, rather than the set itself, because the set's contents and size may change

This commit is contained in:
Richard Downer 2012-01-09 10:15:13 +02:00
parent 0ab8ea1bee
commit 3f6997361d
1 changed files with 2 additions and 2 deletions

View File

@ -171,7 +171,7 @@ public class AMIClientLiveTest extends BaseVersionedServiceLiveTest {
Snapshot snapshot = createSnapshot(computeService);
// List of images before...
Set<? extends org.jclouds.compute.domain.Image> before = computeService.listImages();
int sizeBefore = computeService.listImages().size();
// Register a new image...
final String imageRegisteredId = client.registerUnixImageBackedByEbsInRegion(null, "jcloudstest1", snapshot.getId());
@ -184,7 +184,7 @@ public class AMIClientLiveTest extends BaseVersionedServiceLiveTest {
// List of images after - should be one larger than before
Set<? extends org.jclouds.compute.domain.Image> after = computeService.listImages();
assertEquals(after.size(), before.size() + 1);
assertEquals(after.size(), sizeBefore + 1);
// Detailed check: filter for the AMI ID
Iterable<? extends org.jclouds.compute.domain.Image> filtered = Iterables.filter(after,