The describeAddressesInRegion call returns empty set on not found, not exception

This commit is contained in:
Andrew Donald Kennedy 2011-12-21 11:13:46 +00:00 committed by Adrian Cole
parent be2d85fb81
commit 85288326c8

View File

@ -217,12 +217,10 @@ public class EC2ComputeServiceLiveTest extends BaseComputeServiceLiveTest {
context.getComputeService().destroyNodesMatching(NodePredicates.inGroup(group));
// check that the ip is deallocated
try {
ec2.getElasticIPAddressServices().describeAddressesInRegion(region, ipidpair.getPublicIp());
fail("address has not been deallocated");
} catch (HttpResponseException e) {
// do nothing ... this is expected to fail
}
Set<PublicIpInstanceIdPair> ipidcheck =
ec2.getElasticIPAddressServices().describeAddressesInRegion(region, ipidpair.getPublicIp());
assertTrue(Iterables.isEmpty(ipidcheck), String.format("there should be no address pairs (%s)",
Iterables.toString(ipidcheck)));
} finally {
context.getComputeService().destroyNodesMatching(NodePredicates.inGroup(group));
if (context != null)