mirror of https://github.com/apache/jclouds.git
fixed VolumeAsyncClientTest
This commit is contained in:
parent
9455d146a5
commit
0b9cb6238d
|
@ -58,12 +58,13 @@ public class VolumeAsyncClientTest extends BaseCloudStackAsyncClientTest<VolumeA
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testCreateVolumeWithSnapshot() throws SecurityException, NoSuchMethodException, IOException {
|
public void testCreateVolumeWithSnapshot() throws SecurityException, NoSuchMethodException, IOException {
|
||||||
Method method = VolumeAsyncClient.class.getMethod("createVolumeWithSnapshot", String.class, long.class);
|
Method method = VolumeAsyncClient.class.getMethod("createVolumeFromSnapshotInZone", String.class, long.class,
|
||||||
HttpRequest httpRequest = processor.createRequest(method, prefix + "-jclouds-volume", 999L);
|
long.class);
|
||||||
|
HttpRequest httpRequest = processor.createRequest(method, prefix + "-jclouds-volume", 999L, 111l);
|
||||||
|
|
||||||
assertRequestLineEquals(httpRequest,
|
assertRequestLineEquals(
|
||||||
"GET http://localhost:8080/client/api?response=json&command=createVolume&name="
|
httpRequest,
|
||||||
+ prefix + "-jclouds-volume&snapshotid=999 HTTP/1.1");
|
"GET http://localhost:8080/client/api?response=json&command=createVolume&name=adriancole-jclouds-volume&zoneid=111&snapshotid=999 HTTP/1.1");
|
||||||
assertNonPayloadHeadersEqual(httpRequest, "Accept: application/json\n");
|
assertNonPayloadHeadersEqual(httpRequest, "Accept: application/json\n");
|
||||||
assertPayloadEquals(httpRequest, null, null, false);
|
assertPayloadEquals(httpRequest, null, null, false);
|
||||||
|
|
||||||
|
@ -73,14 +74,14 @@ public class VolumeAsyncClientTest extends BaseCloudStackAsyncClientTest<VolumeA
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testCreateVolumeFromDiskOffering() throws SecurityException, NoSuchMethodException, IOException {
|
public void testCreateVolumeFromDiskOffering() throws SecurityException, NoSuchMethodException, IOException {
|
||||||
Method method = VolumeAsyncClient.class.getMethod("createVolumeFromDiskOfferingInZone",
|
Method method = VolumeAsyncClient.class.getMethod("createVolumeFromDiskOfferingInZone", String.class, long.class,
|
||||||
String.class, long.class, long.class);
|
long.class);
|
||||||
|
|
||||||
HttpRequest httpRequest = processor.createRequest(method, prefix + "-jclouds-volume", 999L, 111L);
|
HttpRequest httpRequest = processor.createRequest(method, prefix + "-jclouds-volume", 999L, 111L);
|
||||||
|
|
||||||
assertRequestLineEquals(httpRequest,
|
assertRequestLineEquals(httpRequest,
|
||||||
"GET http://localhost:8080/client/api?response=json&command=createVolume&name="
|
"GET http://localhost:8080/client/api?response=json&command=createVolume&name=" + prefix
|
||||||
+ prefix + "-jclouds-volume&zoneid=111&diskofferingid=999 HTTP/1.1");
|
+ "-jclouds-volume&zoneid=111&diskofferingid=999 HTTP/1.1");
|
||||||
assertNonPayloadHeadersEqual(httpRequest, "Accept: application/json\n");
|
assertNonPayloadHeadersEqual(httpRequest, "Accept: application/json\n");
|
||||||
assertPayloadEquals(httpRequest, null, null, false);
|
assertPayloadEquals(httpRequest, null, null, false);
|
||||||
|
|
||||||
|
@ -89,10 +90,8 @@ public class VolumeAsyncClientTest extends BaseCloudStackAsyncClientTest<VolumeA
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void testAttachVolume() throws SecurityException, NoSuchMethodException, IOException {
|
public void testAttachVolume() throws SecurityException, NoSuchMethodException, IOException {
|
||||||
Method method = VolumeAsyncClient.class.getMethod("attachVolume",
|
Method method = VolumeAsyncClient.class.getMethod("attachVolume", long.class, long.class);
|
||||||
long.class, long.class);
|
|
||||||
|
|
||||||
HttpRequest httpRequest = processor.createRequest(method, 111L, 999L);
|
HttpRequest httpRequest = processor.createRequest(method, 111L, 999L);
|
||||||
|
|
||||||
|
@ -126,8 +125,8 @@ public class VolumeAsyncClientTest extends BaseCloudStackAsyncClientTest<VolumeA
|
||||||
HttpRequest httpRequest = processor.createRequest(method, prefix + "-jclouds-volume");
|
HttpRequest httpRequest = processor.createRequest(method, prefix + "-jclouds-volume");
|
||||||
|
|
||||||
assertRequestLineEquals(httpRequest,
|
assertRequestLineEquals(httpRequest,
|
||||||
"GET http://localhost:8080/client/api?response=json&command=deleteVolume&id="
|
"GET http://localhost:8080/client/api?response=json&command=deleteVolume&id=" + prefix
|
||||||
+ prefix + "-jclouds-volume HTTP/1.1");
|
+ "-jclouds-volume HTTP/1.1");
|
||||||
assertPayloadEquals(httpRequest, null, null, false);
|
assertPayloadEquals(httpRequest, null, null, false);
|
||||||
|
|
||||||
assertSaxResponseParserClassEquals(method, null);
|
assertSaxResponseParserClassEquals(method, null);
|
||||||
|
@ -136,7 +135,6 @@ public class VolumeAsyncClientTest extends BaseCloudStackAsyncClientTest<VolumeA
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected TypeLiteral<RestAnnotationProcessor<VolumeAsyncClient>> createTypeLiteral() {
|
protected TypeLiteral<RestAnnotationProcessor<VolumeAsyncClient>> createTypeLiteral() {
|
||||||
return new TypeLiteral<RestAnnotationProcessor<VolumeAsyncClient>>() {
|
return new TypeLiteral<RestAnnotationProcessor<VolumeAsyncClient>>() {
|
||||||
|
|
Loading…
Reference in New Issue