fixed bad assertion in delete rrpool in ultradns

This commit is contained in:
adriancole 2013-03-22 11:22:55 -07:00
parent c76c599f77
commit e7bdfa65f9
4 changed files with 22 additions and 21 deletions

View File

@ -25,7 +25,7 @@ import org.jclouds.http.HttpResponse;
import org.jclouds.ultradns.ws.UltraDNSWSApi; import org.jclouds.ultradns.ws.UltraDNSWSApi;
import org.jclouds.ultradns.ws.UltraDNSWSExceptions.ResourceAlreadyExistsException; import org.jclouds.ultradns.ws.UltraDNSWSExceptions.ResourceAlreadyExistsException;
import org.jclouds.ultradns.ws.internal.BaseUltraDNSWSApiExpectTest; import org.jclouds.ultradns.ws.internal.BaseUltraDNSWSApiExpectTest;
import org.jclouds.ultradns.ws.parse.GetLoadBalancingPoolsByZoneResponseTest; import org.jclouds.ultradns.ws.parse.GetRRLoadBalancingPoolsByZoneResponseTest;
import org.jclouds.ultradns.ws.parse.GetResourceRecordsOfResourceRecordResponseTest; import org.jclouds.ultradns.ws.parse.GetResourceRecordsOfResourceRecordResponseTest;
import org.testng.annotations.Test; import org.testng.annotations.Test;
@ -79,7 +79,7 @@ public class RoundRobinPoolApiExpectTest extends BaseUltraDNSWSApiExpectTest {
assertEquals( assertEquals(
success.getRoundRobinPoolApiForZone("jclouds.org.").list().toString(), success.getRoundRobinPoolApiForZone("jclouds.org.").list().toString(),
new GetLoadBalancingPoolsByZoneResponseTest().expected().toString()); new GetRRLoadBalancingPoolsByZoneResponseTest().expected().toString());
} }
HttpRequest listRecords = HttpRequest.builder().method("POST") HttpRequest listRecords = HttpRequest.builder().method("POST")
@ -108,7 +108,7 @@ public class RoundRobinPoolApiExpectTest extends BaseUltraDNSWSApiExpectTest {
public void testDeleteWhenResponseIs2xx() { public void testDeleteWhenResponseIs2xx() {
UltraDNSWSApi success = requestSendsResponse(delete, deleteResponse); UltraDNSWSApi success = requestSendsResponse(delete, deleteResponse);
success.getZoneApi().delete("04053D8E57C7931F"); success.getRoundRobinPoolApiForZone("jclouds.org.").delete("04053D8E57C7931F");
} }
HttpResponse poolDoesntExist = HttpResponse.builder().message("Server Epoolor").statusCode(500) HttpResponse poolDoesntExist = HttpResponse.builder().message("Server Epoolor").statusCode(500)
@ -116,6 +116,6 @@ public class RoundRobinPoolApiExpectTest extends BaseUltraDNSWSApiExpectTest {
public void testDeleteWhenResponseRRNotFound() { public void testDeleteWhenResponseRRNotFound() {
UltraDNSWSApi notFound = requestSendsResponse(delete, poolDoesntExist); UltraDNSWSApi notFound = requestSendsResponse(delete, poolDoesntExist);
notFound.getZoneApi().delete("04053D8E57C7931F"); notFound.getRoundRobinPoolApiForZone("jclouds.org.").delete("04053D8E57C7931F");
} }
} }

View File

@ -61,17 +61,18 @@ public class RoundRobinPoolApiLiveTest extends BaseUltraDNSWSApiLiveTest {
context.getApi().getZoneApi().createInAccount(zoneName, account.getId()); context.getApi().getZoneApi().createInAccount(zoneName, account.getId());
} }
private void checkLBPool(RoundRobinPool pool) { private void checkRRPool(RoundRobinPool pool) {
checkNotNull(pool.getZoneId(), "ZoneId cannot be null for a RoundRobinPool %s", pool); checkNotNull(pool.getZoneId(), "ZoneId cannot be null for a RoundRobinPool %s", pool);
checkNotNull(pool.getId(), "Id cannot be null for a RoundRobinPool %s", pool); checkNotNull(pool.getId(), "Id cannot be null for a RoundRobinPool %s", pool);
checkNotNull(pool.getName(), "Name cannot be null for a RoundRobinPool %s", pool); checkNotNull(pool.getName(), "Name cannot be null for a RoundRobinPool %s", pool);
checkNotNull(pool.getDName(), "DName cannot be null for a RoundRobinPool %s", pool);
} }
@Test @Test
public void testListRRPools() { public void testListRRPools() {
for (Zone zone : context.getApi().getZoneApi().listByAccount(account.getId())) { for (Zone zone : context.getApi().getZoneApi().listByAccount(account.getId())) {
for (RoundRobinPool pool : api(zone.getName()).list()) { for (RoundRobinPool pool : api(zone.getName()).list()) {
checkLBPool(pool); checkRRPool(pool);
} }
} }
} }

View File

@ -33,8 +33,8 @@ import com.google.common.collect.ImmutableList;
/** /**
* @author Adrian Cole * @author Adrian Cole
*/ */
@Test(testName = "GetLoadBalancingPoolsByZoneResponseTest") @Test(testName = "GetRRLoadBalancingPoolsByZoneResponseTest")
public class GetLoadBalancingPoolsByZoneResponseTest extends BaseHandlerTest { public class GetRRLoadBalancingPoolsByZoneResponseTest extends BaseHandlerTest {
public void test() { public void test() {
InputStream is = getClass().getResourceAsStream("/rrpools.xml"); InputStream is = getClass().getResourceAsStream("/rrpools.xml");
@ -50,19 +50,19 @@ public class GetLoadBalancingPoolsByZoneResponseTest extends BaseHandlerTest {
public FluentIterable<RoundRobinPool> expected() { public FluentIterable<RoundRobinPool> expected() {
return FluentIterable.from(ImmutableList.<RoundRobinPool> builder() return FluentIterable.from(ImmutableList.<RoundRobinPool> builder()
.add(RoundRobinPool.builder() .add(RoundRobinPool.builder()
.zoneId("0000000000000001") .zoneId("0000000000000001")
.id("000000000000002") .id("000000000000002")
.name("app-uswest1.jclouds.org.") .name("app-uswest1.jclouds.org.")
.dname("app-uswest1.jclouds.org.").build()) .dname("app-uswest1.jclouds.org.").build())
.add(RoundRobinPool.builder() .add(RoundRobinPool.builder()
.zoneId("0000000000000001") .zoneId("0000000000000001")
.id("000000000000003") .id("000000000000003")
.name("app-uswest2.jclouds.org.") .name("app-uswest2.jclouds.org.")
.dname("app-uswest2.jclouds.org.").build()) .dname("app-uswest2.jclouds.org.").build())
.add(RoundRobinPool.builder() .add(RoundRobinPool.builder()
.zoneId("0000000000000001") .zoneId("0000000000000001")
.id("000000000000004") .id("000000000000004")
.name("app-euwest.jclouds.org.") .name("app-euwest.jclouds.org.")
.dname("app-euwest.jclouds.org.").build()).build()); .dname("app-euwest.jclouds.org.").build()).build());
} }
} }

View File

@ -1 +1 @@
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v01="http://webservice.api.ultra.neustar.com/v01/"><soapenv:Header><wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"><wsse:UsernameToken><wsse:Username>identity</wsse:Username><wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">credential</wsse:Password></wsse:UsernameToken></wsse:Security></soapenv:Header><soapenv:Body><v01:deleteZone><transactionID /><zoneName>04053D8E57C7931F</zoneName></v01:deleteZone></soapenv:Body></soapenv:Envelope> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v01="http://webservice.api.ultra.neustar.com/v01/"><soapenv:Header><wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"><wsse:UsernameToken><wsse:Username>identity</wsse:Username><wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">credential</wsse:Password></wsse:UsernameToken></wsse:Security></soapenv:Header><soapenv:Body><v01:deleteLBPool><transactionID /><lbPoolID>04053D8E57C7931F</lbPoolID><DeleteAll>Yes</DeleteAll><retainRecordId /></v01:deleteLBPool></soapenv:Body></soapenv:Envelope>