mirror of https://github.com/apache/jclouds.git
Issue 493:bad http syntax deleting cloudsigma resources
This commit is contained in:
parent
c1637ba740
commit
6543f3af7a
|
@ -203,7 +203,7 @@ public interface CloudSigmaAsyncClient {
|
||||||
/**
|
/**
|
||||||
* @see CloudSigmaClient#destroyServer
|
* @see CloudSigmaClient#destroyServer
|
||||||
*/
|
*/
|
||||||
@POST
|
@GET
|
||||||
@Path("/servers/{uuid}/destroy")
|
@Path("/servers/{uuid}/destroy")
|
||||||
@ExceptionParser(ReturnVoidOnNotFoundOr404.class)
|
@ExceptionParser(ReturnVoidOnNotFoundOr404.class)
|
||||||
ListenableFuture<Void> destroyServer(@PathParam("uuid") String uuid);
|
ListenableFuture<Void> destroyServer(@PathParam("uuid") String uuid);
|
||||||
|
@ -247,7 +247,7 @@ public interface CloudSigmaAsyncClient {
|
||||||
/**
|
/**
|
||||||
* @see CloudSigmaClient#destroyDrive
|
* @see CloudSigmaClient#destroyDrive
|
||||||
*/
|
*/
|
||||||
@POST
|
@GET
|
||||||
@Path("/drives/{uuid}/destroy")
|
@Path("/drives/{uuid}/destroy")
|
||||||
@ExceptionParser(ReturnVoidOnNotFoundOr404.class)
|
@ExceptionParser(ReturnVoidOnNotFoundOr404.class)
|
||||||
ListenableFuture<Void> destroyDrive(@PathParam("uuid") String uuid);
|
ListenableFuture<Void> destroyDrive(@PathParam("uuid") String uuid);
|
||||||
|
@ -301,7 +301,7 @@ public interface CloudSigmaAsyncClient {
|
||||||
/**
|
/**
|
||||||
* @see CloudSigmaClient#destroyVLAN
|
* @see CloudSigmaClient#destroyVLAN
|
||||||
*/
|
*/
|
||||||
@POST
|
@GET
|
||||||
@Path("/resources/vlan/{uuid}/destroy")
|
@Path("/resources/vlan/{uuid}/destroy")
|
||||||
@ExceptionParser(ReturnVoidOnNotFoundOr404.class)
|
@ExceptionParser(ReturnVoidOnNotFoundOr404.class)
|
||||||
ListenableFuture<Void> destroyVLAN(@PathParam("uuid") String uuid);
|
ListenableFuture<Void> destroyVLAN(@PathParam("uuid") String uuid);
|
||||||
|
@ -343,7 +343,7 @@ public interface CloudSigmaAsyncClient {
|
||||||
/**
|
/**
|
||||||
* @see CloudSigmaClient#destroyStaticIP
|
* @see CloudSigmaClient#destroyStaticIP
|
||||||
*/
|
*/
|
||||||
@POST
|
@GET
|
||||||
@Path("/resources/ip/{uuid}/destroy")
|
@Path("/resources/ip/{uuid}/destroy")
|
||||||
@ExceptionParser(ReturnVoidOnNotFoundOr404.class)
|
@ExceptionParser(ReturnVoidOnNotFoundOr404.class)
|
||||||
ListenableFuture<Void> destroyStaticIP(@PathParam("uuid") String uuid);
|
ListenableFuture<Void> destroyStaticIP(@PathParam("uuid") String uuid);
|
||||||
|
|
|
@ -323,7 +323,7 @@ public class CloudSigmaAsyncClientTest extends RestClientTest<CloudSigmaAsyncCli
|
||||||
Method method = CloudSigmaAsyncClient.class.getMethod("destroyServer", String.class);
|
Method method = CloudSigmaAsyncClient.class.getMethod("destroyServer", String.class);
|
||||||
HttpRequest httpRequest = processor.createRequest(method, "uuid");
|
HttpRequest httpRequest = processor.createRequest(method, "uuid");
|
||||||
|
|
||||||
assertRequestLineEquals(httpRequest, "POST https://api.cloudsigma.com/servers/uuid/destroy HTTP/1.1");
|
assertRequestLineEquals(httpRequest, "GET https://api.cloudsigma.com/servers/uuid/destroy HTTP/1.1");
|
||||||
assertNonPayloadHeadersEqual(httpRequest, "Accept: text/plain\n");
|
assertNonPayloadHeadersEqual(httpRequest, "Accept: text/plain\n");
|
||||||
assertPayloadEquals(httpRequest, null, null, false);
|
assertPayloadEquals(httpRequest, null, null, false);
|
||||||
|
|
||||||
|
@ -430,7 +430,7 @@ public class CloudSigmaAsyncClientTest extends RestClientTest<CloudSigmaAsyncCli
|
||||||
Method method = CloudSigmaAsyncClient.class.getMethod("destroyDrive", String.class);
|
Method method = CloudSigmaAsyncClient.class.getMethod("destroyDrive", String.class);
|
||||||
HttpRequest httpRequest = processor.createRequest(method, "uuid");
|
HttpRequest httpRequest = processor.createRequest(method, "uuid");
|
||||||
|
|
||||||
assertRequestLineEquals(httpRequest, "POST https://api.cloudsigma.com/drives/uuid/destroy HTTP/1.1");
|
assertRequestLineEquals(httpRequest, "GET https://api.cloudsigma.com/drives/uuid/destroy HTTP/1.1");
|
||||||
assertNonPayloadHeadersEqual(httpRequest, "Accept: text/plain\n");
|
assertNonPayloadHeadersEqual(httpRequest, "Accept: text/plain\n");
|
||||||
assertPayloadEquals(httpRequest, null, null, false);
|
assertPayloadEquals(httpRequest, null, null, false);
|
||||||
|
|
||||||
|
@ -536,7 +536,7 @@ public class CloudSigmaAsyncClientTest extends RestClientTest<CloudSigmaAsyncCli
|
||||||
Method method = CloudSigmaAsyncClient.class.getMethod("destroyVLAN", String.class);
|
Method method = CloudSigmaAsyncClient.class.getMethod("destroyVLAN", String.class);
|
||||||
HttpRequest httpRequest = processor.createRequest(method, "uuid");
|
HttpRequest httpRequest = processor.createRequest(method, "uuid");
|
||||||
|
|
||||||
assertRequestLineEquals(httpRequest, "POST https://api.cloudsigma.com/resources/vlan/uuid/destroy HTTP/1.1");
|
assertRequestLineEquals(httpRequest, "GET https://api.cloudsigma.com/resources/vlan/uuid/destroy HTTP/1.1");
|
||||||
assertNonPayloadHeadersEqual(httpRequest, "Accept: text/plain\n");
|
assertNonPayloadHeadersEqual(httpRequest, "Accept: text/plain\n");
|
||||||
assertPayloadEquals(httpRequest, null, null, false);
|
assertPayloadEquals(httpRequest, null, null, false);
|
||||||
|
|
||||||
|
@ -626,7 +626,7 @@ public class CloudSigmaAsyncClientTest extends RestClientTest<CloudSigmaAsyncCli
|
||||||
Method method = CloudSigmaAsyncClient.class.getMethod("destroyStaticIP", String.class);
|
Method method = CloudSigmaAsyncClient.class.getMethod("destroyStaticIP", String.class);
|
||||||
HttpRequest httpRequest = processor.createRequest(method, "uuid");
|
HttpRequest httpRequest = processor.createRequest(method, "uuid");
|
||||||
|
|
||||||
assertRequestLineEquals(httpRequest, "POST https://api.cloudsigma.com/resources/ip/uuid/destroy HTTP/1.1");
|
assertRequestLineEquals(httpRequest, "GET https://api.cloudsigma.com/resources/ip/uuid/destroy HTTP/1.1");
|
||||||
assertNonPayloadHeadersEqual(httpRequest, "Accept: text/plain\n");
|
assertNonPayloadHeadersEqual(httpRequest, "Accept: text/plain\n");
|
||||||
assertPayloadEquals(httpRequest, null, null, false);
|
assertPayloadEquals(httpRequest, null, null, false);
|
||||||
|
|
||||||
|
|
|
@ -308,18 +308,8 @@ public class CloudSigmaClientLiveTest {
|
||||||
client.destroyServer(server.getUuid());
|
client.destroyServer(server.getUuid());
|
||||||
client.destroyDrive(drive.getUuid());
|
client.destroyDrive(drive.getUuid());
|
||||||
}
|
}
|
||||||
try {
|
client.destroyStaticIP(ip.getAddress());
|
||||||
client.destroyStaticIP(ip.getAddress());
|
client.destroyStaticIP(ip2.getAddress());
|
||||||
} catch (IllegalArgumentException e) {
|
|
||||||
// this shouldn't happen
|
|
||||||
assertEquals(e.getMessage(), "resource_exception:Missing resource");
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
client.destroyStaticIP(ip2.getAddress());
|
|
||||||
} catch (IllegalArgumentException e) {
|
|
||||||
// this shouldn't happen
|
|
||||||
assertEquals(e.getMessage(), "resource_exception:Missing resource");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -439,16 +429,10 @@ public class CloudSigmaClientLiveTest {
|
||||||
|
|
||||||
@AfterGroups(groups = "live")
|
@AfterGroups(groups = "live")
|
||||||
protected void tearDown() {
|
protected void tearDown() {
|
||||||
try {
|
if (server != null)
|
||||||
client.destroyServer(server.getUuid());
|
client.destroyServer(server.getUuid());
|
||||||
} catch (Exception e) {
|
if (server != null)
|
||||||
// no need to check null or anything as we swallow all
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
client.destroyDrive(drive.getUuid());
|
client.destroyDrive(drive.getUuid());
|
||||||
} catch (Exception e) {
|
|
||||||
|
|
||||||
}
|
|
||||||
if (context != null)
|
if (context != null)
|
||||||
context.close();
|
context.close();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue