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