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
parent ee0bade6ad
commit 979d9ba046
1 changed files with 4 additions and 6 deletions

View File

@ -218,12 +218,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)