mirror of https://github.com/apache/jclouds.git
Issue 695: Converted api method calls to URI instead of primitives
This commit is contained in:
parent
9852a579e9
commit
820bdf6f47
|
@ -28,8 +28,6 @@ import org.jclouds.tmrk.enterprisecloud.domain.Tasks;
|
||||||
|
|
||||||
import javax.ws.rs.Consumes;
|
import javax.ws.rs.Consumes;
|
||||||
import javax.ws.rs.GET;
|
import javax.ws.rs.GET;
|
||||||
import javax.ws.rs.Path;
|
|
||||||
import javax.ws.rs.PathParam;
|
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -44,18 +42,16 @@ import java.net.URI;
|
||||||
*/
|
*/
|
||||||
@RequestFilters(BasicAuthentication.class)
|
@RequestFilters(BasicAuthentication.class)
|
||||||
@Headers(keys = "x-tmrk-version", values = "{jclouds.api-version}")
|
@Headers(keys = "x-tmrk-version", values = "{jclouds.api-version}")
|
||||||
//@VirtualHost
|
|
||||||
public interface TaskAsyncClient {
|
public interface TaskAsyncClient {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see TaskClient#getTasksInEnvironment
|
* @see TaskClient#getTasksInEnvironment
|
||||||
*/
|
*/
|
||||||
@GET
|
@GET
|
||||||
@Path("/tasks/environments/{environmentId}")
|
|
||||||
@Consumes("application/vnd.tmrk.cloud.task; type=collection")
|
@Consumes("application/vnd.tmrk.cloud.task; type=collection")
|
||||||
@JAXBResponseParser
|
@JAXBResponseParser
|
||||||
@ExceptionParser(ReturnEmptySetOnNotFoundOr404.class)
|
@ExceptionParser(ReturnEmptySetOnNotFoundOr404.class)
|
||||||
ListenableFuture<Tasks> getTasksInEnvironment(@PathParam("environmentId") long environmentId);
|
ListenableFuture<Tasks> getTasksInEnvironment(@EndpointParam URI environmentId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see TaskClient#getTask
|
* @see TaskClient#getTask
|
||||||
|
|
|
@ -44,7 +44,7 @@ public interface TaskClient {
|
||||||
*
|
*
|
||||||
* @return a history of changes to the environment.
|
* @return a history of changes to the environment.
|
||||||
*/
|
*/
|
||||||
Tasks getTasksInEnvironment(long environmentId);
|
Tasks getTasksInEnvironment(URI environmentUri);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Get Tasks by ID call returns information regarding a specified task in
|
* The Get Tasks by ID call returns information regarding a specified task in
|
||||||
|
|
|
@ -20,10 +20,7 @@ package org.jclouds.tmrk.enterprisecloud.features;
|
||||||
|
|
||||||
import com.google.common.util.concurrent.ListenableFuture;
|
import com.google.common.util.concurrent.ListenableFuture;
|
||||||
import org.jclouds.http.filters.BasicAuthentication;
|
import org.jclouds.http.filters.BasicAuthentication;
|
||||||
import org.jclouds.rest.annotations.ExceptionParser;
|
import org.jclouds.rest.annotations.*;
|
||||||
import org.jclouds.rest.annotations.Headers;
|
|
||||||
import org.jclouds.rest.annotations.JAXBResponseParser;
|
|
||||||
import org.jclouds.rest.annotations.RequestFilters;
|
|
||||||
import org.jclouds.rest.functions.ReturnNullOnNotFoundOr404;
|
import org.jclouds.rest.functions.ReturnNullOnNotFoundOr404;
|
||||||
import org.jclouds.tmrk.enterprisecloud.domain.AssignedIpAddresses;
|
import org.jclouds.tmrk.enterprisecloud.domain.AssignedIpAddresses;
|
||||||
import org.jclouds.tmrk.enterprisecloud.domain.VirtualMachine;
|
import org.jclouds.tmrk.enterprisecloud.domain.VirtualMachine;
|
||||||
|
@ -31,8 +28,7 @@ import org.jclouds.tmrk.enterprisecloud.domain.VirtualMachines;
|
||||||
|
|
||||||
import javax.ws.rs.Consumes;
|
import javax.ws.rs.Consumes;
|
||||||
import javax.ws.rs.GET;
|
import javax.ws.rs.GET;
|
||||||
import javax.ws.rs.Path;
|
import java.net.URI;
|
||||||
import javax.ws.rs.PathParam;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides asynchronous access to VirtualMachine via their REST API.
|
* Provides asynchronous access to VirtualMachine via their REST API.
|
||||||
|
@ -52,30 +48,27 @@ public interface VirtualMachineAsyncClient {
|
||||||
* @see VirtualMachineClient#getVirtualMachines
|
* @see VirtualMachineClient#getVirtualMachines
|
||||||
*/
|
*/
|
||||||
@GET
|
@GET
|
||||||
@Path("/virtualMachines/computePools/{id}")
|
|
||||||
@Consumes("application/vnd.tmrk.cloud.virtualMachine; type=collection")
|
@Consumes("application/vnd.tmrk.cloud.virtualMachine; type=collection")
|
||||||
@JAXBResponseParser
|
@JAXBResponseParser
|
||||||
@ExceptionParser(ReturnNullOnNotFoundOr404.class)
|
@ExceptionParser(ReturnNullOnNotFoundOr404.class)
|
||||||
ListenableFuture<VirtualMachines> getVirtualMachines(@PathParam("id") long id);
|
ListenableFuture<VirtualMachines> getVirtualMachines(@EndpointParam URI uri);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VirtualMachineClient#getVirtualMachine
|
* @see VirtualMachineClient#getVirtualMachine
|
||||||
*/
|
*/
|
||||||
@GET
|
@GET
|
||||||
@Path("/virtualMachines/{id}")
|
|
||||||
@Consumes("application/vnd.tmrk.cloud.virtualMachine")
|
@Consumes("application/vnd.tmrk.cloud.virtualMachine")
|
||||||
@JAXBResponseParser
|
@JAXBResponseParser
|
||||||
@ExceptionParser(ReturnNullOnNotFoundOr404.class)
|
@ExceptionParser(ReturnNullOnNotFoundOr404.class)
|
||||||
ListenableFuture<VirtualMachine> getVirtualMachine(@PathParam("id") long id);
|
ListenableFuture<VirtualMachine> getVirtualMachine(@EndpointParam URI uri);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VirtualMachineClient#getVirtualMachine
|
* @see VirtualMachineClient#getVirtualMachine
|
||||||
*/
|
*/
|
||||||
@GET
|
@GET
|
||||||
@Path("/virtualMachines/{id}/assignedIps")
|
|
||||||
@Consumes("application/vnd.tmrk.cloud.virtualMachineAssignedIps")
|
@Consumes("application/vnd.tmrk.cloud.virtualMachineAssignedIps")
|
||||||
@JAXBResponseParser
|
@JAXBResponseParser
|
||||||
@ExceptionParser(ReturnNullOnNotFoundOr404.class)
|
@ExceptionParser(ReturnNullOnNotFoundOr404.class)
|
||||||
ListenableFuture<AssignedIpAddresses> getAssignedIpAddresses(@PathParam("id") long id);
|
ListenableFuture<AssignedIpAddresses> getAssignedIpAddresses(@EndpointParam URI uri);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,6 +23,7 @@ import org.jclouds.tmrk.enterprisecloud.domain.AssignedIpAddresses;
|
||||||
import org.jclouds.tmrk.enterprisecloud.domain.VirtualMachine;
|
import org.jclouds.tmrk.enterprisecloud.domain.VirtualMachine;
|
||||||
import org.jclouds.tmrk.enterprisecloud.domain.VirtualMachines;
|
import org.jclouds.tmrk.enterprisecloud.domain.VirtualMachines;
|
||||||
|
|
||||||
|
import java.net.URI;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -40,25 +41,25 @@ public interface VirtualMachineClient {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* returns information regarding virtual machines defined in a compute pool
|
* returns information regarding virtual machines defined in a compute pool
|
||||||
* @param id the i of the compute pool
|
* @param uri the uri of the compute pool
|
||||||
* @return the virtual machines
|
* @return the virtual machines
|
||||||
*/
|
*/
|
||||||
VirtualMachines getVirtualMachines(long id);
|
VirtualMachines getVirtualMachines(URI uri);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Get Virtual Machines by ID call returns information regarding a
|
* The Get Virtual Machines by ID call returns information regarding a
|
||||||
* specified virtual machine defined in an environment.
|
* specified virtual machine defined in an environment.
|
||||||
* @param id the id of the virtual machine
|
* @param uri the id of the virtual machine
|
||||||
* @return the virtual Machine or null if not found
|
* @return the virtual Machine or null if not found
|
||||||
*/
|
*/
|
||||||
VirtualMachine getVirtualMachine(long id);
|
VirtualMachine getVirtualMachine(URI uri);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Get Virtual Machines Assigned IP Addresses call returns information
|
* The Get Virtual Machines Assigned IP Addresses call returns information
|
||||||
* regarding the IP addresses assigned to a specified virtual machine in a compute pool.
|
* regarding the IP addresses assigned to a specified virtual machine in a compute pool.
|
||||||
* @param id the id of the virtual machine
|
* @param uri the assignedIpAddresses call
|
||||||
* @return the assigned ip addresses
|
* @return the assigned ip addresses
|
||||||
*/
|
*/
|
||||||
AssignedIpAddresses getAssignedIpAddresses(long id);
|
AssignedIpAddresses getAssignedIpAddresses(URI uri);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,6 +29,7 @@ import org.testng.annotations.Test;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
|
import java.net.URISyntaxException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests annotation parsing of {@code TaskAsyncClient}
|
* Tests annotation parsing of {@code TaskAsyncClient}
|
||||||
|
@ -38,9 +39,9 @@ import java.net.URI;
|
||||||
@Test(groups = "unit", testName = "TaskAsyncClientTest")
|
@Test(groups = "unit", testName = "TaskAsyncClientTest")
|
||||||
public class TaskAsyncClientTest extends BaseTerremarkEnterpriseCloudAsyncClientTest<TaskAsyncClient> {
|
public class TaskAsyncClientTest extends BaseTerremarkEnterpriseCloudAsyncClientTest<TaskAsyncClient> {
|
||||||
|
|
||||||
public void testGetTasksInEnvironment() throws SecurityException, NoSuchMethodException, IOException {
|
public void testGetTasksInEnvironment() throws SecurityException, NoSuchMethodException, IOException, URISyntaxException {
|
||||||
Method method = TaskAsyncClient.class.getMethod("getTasksInEnvironment", long.class);
|
Method method = TaskAsyncClient.class.getMethod("getTasksInEnvironment", URI.class);
|
||||||
HttpRequest httpRequest = processor.createRequest(method, 1l);
|
HttpRequest httpRequest = processor.createRequest(method, new URI("/cloudapi/ecloud/tasks/environments/1"));
|
||||||
|
|
||||||
assertRequestLineEquals(httpRequest, "GET https://services-beta.enterprisecloud.terremark.com/cloudapi/ecloud/tasks/environments/1 HTTP/1.1");
|
assertRequestLineEquals(httpRequest, "GET https://services-beta.enterprisecloud.terremark.com/cloudapi/ecloud/tasks/environments/1 HTTP/1.1");
|
||||||
assertNonPayloadHeadersEqual(httpRequest,
|
assertNonPayloadHeadersEqual(httpRequest,
|
||||||
|
|
|
@ -23,6 +23,8 @@ import org.jclouds.tmrk.enterprisecloud.domain.Tasks;
|
||||||
import org.testng.annotations.BeforeGroups;
|
import org.testng.annotations.BeforeGroups;
|
||||||
import org.testng.annotations.Test;
|
import org.testng.annotations.Test;
|
||||||
|
|
||||||
|
import java.net.URI;
|
||||||
|
|
||||||
import static org.testng.Assert.assertEquals;
|
import static org.testng.Assert.assertEquals;
|
||||||
import static org.testng.Assert.assertTrue;
|
import static org.testng.Assert.assertTrue;
|
||||||
|
|
||||||
|
@ -42,11 +44,11 @@ public class TaskClientLiveTest extends BaseTerremarkEnterpriseCloudClientLiveTe
|
||||||
private TaskClient client;
|
private TaskClient client;
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testGetTasks() {
|
public void testGetTasks() throws Exception {
|
||||||
// TODO: don't hard-code id
|
// TODO: don't hard-code id
|
||||||
// TODO: docs say don't parse the href, yet no xml includes "identifier",
|
// TODO: docs say don't parse the href, yet no xml includes "identifier",
|
||||||
// I suspect we may need to change to URI args as opposed to long
|
// I suspect we may need to change to URI args as opposed to long
|
||||||
Tasks response = client.getTasksInEnvironment(77);
|
Tasks response = client.getTasksInEnvironment(new URI("/cloudapi/ecloud/tasks/environments/77"));
|
||||||
assert null != response;
|
assert null != response;
|
||||||
|
|
||||||
assertTrue(response.getTasks().size() >= 0);
|
assertTrue(response.getTasks().size() >= 0);
|
||||||
|
|
|
@ -27,6 +27,8 @@ import org.testng.annotations.Test;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
|
import java.net.URI;
|
||||||
|
import java.net.URISyntaxException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests annotation parsing of {@code TaskAsyncClient}
|
* Tests annotation parsing of {@code TaskAsyncClient}
|
||||||
|
@ -36,9 +38,9 @@ import java.lang.reflect.Method;
|
||||||
@Test(groups = "unit", testName = "VirtualMachineAsyncClientTest")
|
@Test(groups = "unit", testName = "VirtualMachineAsyncClientTest")
|
||||||
public class VirtualMachineAsyncClientTest extends BaseTerremarkEnterpriseCloudAsyncClientTest<VirtualMachineAsyncClient> {
|
public class VirtualMachineAsyncClientTest extends BaseTerremarkEnterpriseCloudAsyncClientTest<VirtualMachineAsyncClient> {
|
||||||
|
|
||||||
public void testGetVirtualMachine() throws SecurityException, NoSuchMethodException, IOException {
|
public void testGetVirtualMachine() throws SecurityException, NoSuchMethodException, IOException, URISyntaxException {
|
||||||
Method method = VirtualMachineAsyncClient.class.getMethod("getVirtualMachine", long.class);
|
Method method = VirtualMachineAsyncClient.class.getMethod("getVirtualMachine", URI.class);
|
||||||
HttpRequest httpRequest = processor.createRequest(method,1);
|
HttpRequest httpRequest = processor.createRequest(method,new URI("/cloudapi/ecloud/virtualMachines/1"));
|
||||||
|
|
||||||
assertRequestLineEquals(httpRequest, "GET https://services-beta.enterprisecloud.terremark.com/cloudapi/ecloud/virtualMachines/1 HTTP/1.1");
|
assertRequestLineEquals(httpRequest, "GET https://services-beta.enterprisecloud.terremark.com/cloudapi/ecloud/virtualMachines/1 HTTP/1.1");
|
||||||
assertNonPayloadHeadersEqual(httpRequest, "Accept: application/vnd.tmrk.cloud.virtualMachine\nx-tmrk-version: 2011-07-01\n");
|
assertNonPayloadHeadersEqual(httpRequest, "Accept: application/vnd.tmrk.cloud.virtualMachine\nx-tmrk-version: 2011-07-01\n");
|
||||||
|
@ -50,9 +52,9 @@ public class VirtualMachineAsyncClientTest extends BaseTerremarkEnterpriseCloudA
|
||||||
checkFilters(httpRequest);
|
checkFilters(httpRequest);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testGetVirtualMachines() throws SecurityException, NoSuchMethodException, IOException {
|
public void testGetVirtualMachines() throws SecurityException, NoSuchMethodException, IOException, URISyntaxException {
|
||||||
Method method = VirtualMachineAsyncClient.class.getMethod("getVirtualMachines", long.class);
|
Method method = VirtualMachineAsyncClient.class.getMethod("getVirtualMachines", URI.class);
|
||||||
HttpRequest httpRequest = processor.createRequest(method,567);
|
HttpRequest httpRequest = processor.createRequest(method,new URI("/cloudapi/ecloud/virtualMachines/computePools/567"));
|
||||||
|
|
||||||
assertRequestLineEquals(httpRequest, "GET https://services-beta.enterprisecloud.terremark.com/cloudapi/ecloud/virtualMachines/computePools/567 HTTP/1.1");
|
assertRequestLineEquals(httpRequest, "GET https://services-beta.enterprisecloud.terremark.com/cloudapi/ecloud/virtualMachines/computePools/567 HTTP/1.1");
|
||||||
assertNonPayloadHeadersEqual(httpRequest, "Accept: application/vnd.tmrk.cloud.virtualMachine; type=collection\nx-tmrk-version: 2011-07-01\n");
|
assertNonPayloadHeadersEqual(httpRequest, "Accept: application/vnd.tmrk.cloud.virtualMachine; type=collection\nx-tmrk-version: 2011-07-01\n");
|
||||||
|
@ -64,11 +66,11 @@ public class VirtualMachineAsyncClientTest extends BaseTerremarkEnterpriseCloudA
|
||||||
checkFilters(httpRequest);
|
checkFilters(httpRequest);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testGetAssignedIpAddresses() throws SecurityException, NoSuchMethodException, IOException {
|
public void testGetAssignedIpAddresses() throws SecurityException, NoSuchMethodException, IOException, URISyntaxException {
|
||||||
Method method = VirtualMachineAsyncClient.class.getMethod("getAssignedIpAddresses", long.class);
|
Method method = VirtualMachineAsyncClient.class.getMethod("getAssignedIpAddresses", URI.class);
|
||||||
HttpRequest httpRequest = processor.createRequest(method,1);
|
HttpRequest httpRequest = processor.createRequest(method,new URI("/cloudapi/ecloud/virtualMachines/1/assignedips"));
|
||||||
|
|
||||||
assertRequestLineEquals(httpRequest, "GET https://services-beta.enterprisecloud.terremark.com/cloudapi/ecloud/virtualMachines/1/assignedIps HTTP/1.1");
|
assertRequestLineEquals(httpRequest, "GET https://services-beta.enterprisecloud.terremark.com/cloudapi/ecloud/virtualMachines/1/assignedips HTTP/1.1");
|
||||||
assertNonPayloadHeadersEqual(httpRequest, "Accept: application/vnd.tmrk.cloud.virtualMachineAssignedIps\nx-tmrk-version: 2011-07-01\n");
|
assertNonPayloadHeadersEqual(httpRequest, "Accept: application/vnd.tmrk.cloud.virtualMachineAssignedIps\nx-tmrk-version: 2011-07-01\n");
|
||||||
assertPayloadEquals(httpRequest, null, null, false);
|
assertPayloadEquals(httpRequest, null, null, false);
|
||||||
|
|
||||||
|
|
|
@ -49,10 +49,10 @@ public class VirtualMachineClientLiveTest extends BaseTerremarkEnterpriseCloudCl
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testGetVirtualMachines() throws Exception {
|
public void testGetVirtualMachines() throws Exception {
|
||||||
// TODO: don't hard-code id
|
// TODO: don't hard-code uri
|
||||||
VirtualMachines virtualMachines = client.getVirtualMachines(89);
|
VirtualMachines virtualMachines = client.getVirtualMachines(new URI("/cloudapi/ecloud/virtualMachines/computePools/89"));
|
||||||
for( VirtualMachine vm : virtualMachines.getVirtualMachines()) {
|
for( VirtualMachine vm : virtualMachines.getVirtualMachines()) {
|
||||||
VirtualMachine virtualMachine = client.getVirtualMachine(parse(vm.getHref()));
|
VirtualMachine virtualMachine = client.getVirtualMachine(vm.getHref());
|
||||||
assert null != virtualMachine;
|
assert null != virtualMachine;
|
||||||
assertEquals(virtualMachine.getStatus(),VirtualMachine.VirtualMachineStatus.DEPLOYED);
|
assertEquals(virtualMachine.getStatus(),VirtualMachine.VirtualMachineStatus.DEPLOYED);
|
||||||
}
|
}
|
||||||
|
@ -60,29 +60,18 @@ public class VirtualMachineClientLiveTest extends BaseTerremarkEnterpriseCloudCl
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testGetVirtualMachine() throws Exception {
|
public void testGetVirtualMachine() throws Exception {
|
||||||
// TODO: don't hard-code id
|
// TODO: don't hard-code uri
|
||||||
VirtualMachine virtualMachine = client.getVirtualMachine(5504);
|
VirtualMachine virtualMachine = client.getVirtualMachine(new URI("/cloudapi/ecloud/virtualMachines/5504"));
|
||||||
assert null != virtualMachine;
|
assert null != virtualMachine;
|
||||||
assertEquals(virtualMachine.getStatus(),VirtualMachine.VirtualMachineStatus.DEPLOYED);
|
assertEquals(virtualMachine.getStatus(),VirtualMachine.VirtualMachineStatus.DEPLOYED);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testGetAssignedIpAddresses() throws Exception {
|
public void testGetAssignedIpAddresses() throws Exception {
|
||||||
AssignedIpAddresses assignedIpAddresses = client.getAssignedIpAddresses(5504);
|
AssignedIpAddresses assignedIpAddresses = client.getAssignedIpAddresses(new URI("/cloudapi/ecloud/virtualMachines/5504/assignedips"));
|
||||||
assert null != assignedIpAddresses;
|
assert null != assignedIpAddresses;
|
||||||
DeviceNetwork network = Iterables.getOnlyElement(assignedIpAddresses.getNetworks().getDeviceNetworks());
|
DeviceNetwork network = Iterables.getOnlyElement(assignedIpAddresses.getNetworks().getDeviceNetworks());
|
||||||
Set<String> ipAddresses = network.getIpAddresses().getIpAddresses();
|
Set<String> ipAddresses = network.getIpAddresses().getIpAddresses();
|
||||||
assertTrue(ipAddresses.size()>0, "vm has no assigned ip addresses");
|
assertTrue(ipAddresses.size()>0, "vm has no assigned ip addresses");
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: We are not supposed to parse the href's
|
|
||||||
// The alternative is to use URI's on the method calls.
|
|
||||||
// But this has the risk of exposing strings like "/virtualmachines/5504" and "/computepools/89" to users
|
|
||||||
// Also - would need to figure out how to configure the tests
|
|
||||||
// to add on the endpoint so that the @EndpointParam is converted into a proper request.
|
|
||||||
private long parse(URI uri) {
|
|
||||||
String path = uri.getPath();
|
|
||||||
path = path.substring(path.lastIndexOf("/")+1);
|
|
||||||
return Long.parseLong(path);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -97,8 +97,8 @@ public class AssignedIpAddressesJAXBParsingTest extends BaseRestClientTest {
|
||||||
@Test
|
@Test
|
||||||
public void testParseAssignedIpAddressesWithJAXB() throws Exception {
|
public void testParseAssignedIpAddressesWithJAXB() throws Exception {
|
||||||
|
|
||||||
Method method = VirtualMachineAsyncClient.class.getMethod("getAssignedIpAddresses", long.class);
|
Method method = VirtualMachineAsyncClient.class.getMethod("getAssignedIpAddresses", URI.class);
|
||||||
HttpRequest request = factory(VirtualMachineAsyncClient.class).createRequest(method,1);
|
HttpRequest request = factory(VirtualMachineAsyncClient.class).createRequest(method,new URI("/1"));
|
||||||
assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
|
assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
|
||||||
|
|
||||||
Function<HttpResponse, AssignedIpAddresses> parser = (Function<HttpResponse, AssignedIpAddresses>) RestAnnotationProcessor
|
Function<HttpResponse, AssignedIpAddresses> parser = (Function<HttpResponse, AssignedIpAddresses>) RestAnnotationProcessor
|
||||||
|
|
|
@ -130,7 +130,7 @@ public class TaskJAXBParsingTest extends BaseRestClientTest {
|
||||||
public void testParseTaskWithJAXB() throws Exception {
|
public void testParseTaskWithJAXB() throws Exception {
|
||||||
|
|
||||||
Method method = TaskAsyncClient.class.getMethod("getTask",URI.class);
|
Method method = TaskAsyncClient.class.getMethod("getTask",URI.class);
|
||||||
HttpRequest request = factory(TaskAsyncClient.class).createRequest(method);
|
HttpRequest request = factory(TaskAsyncClient.class).createRequest(method, new URI("/1"));
|
||||||
assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
|
assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
|
||||||
|
|
||||||
Function<HttpResponse, Task> parser = (Function<HttpResponse, Task>) RestAnnotationProcessor
|
Function<HttpResponse, Task> parser = (Function<HttpResponse, Task>) RestAnnotationProcessor
|
||||||
|
@ -144,8 +144,8 @@ public class TaskJAXBParsingTest extends BaseRestClientTest {
|
||||||
@Test
|
@Test
|
||||||
public void testParseTasksWithJAXB() throws Exception {
|
public void testParseTasksWithJAXB() throws Exception {
|
||||||
|
|
||||||
Method method = TaskAsyncClient.class.getMethod("getTasksInEnvironment",long.class);
|
Method method = TaskAsyncClient.class.getMethod("getTasksInEnvironment",URI.class);
|
||||||
HttpRequest request = factory(TaskAsyncClient.class).createRequest(method,1);
|
HttpRequest request = factory(TaskAsyncClient.class).createRequest(method,new URI("/1"));
|
||||||
assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
|
assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
|
||||||
|
|
||||||
Function<HttpResponse, Tasks> parser = (Function<HttpResponse, Tasks>) RestAnnotationProcessor
|
Function<HttpResponse, Tasks> parser = (Function<HttpResponse, Tasks>) RestAnnotationProcessor
|
||||||
|
|
|
@ -97,8 +97,8 @@ public class VirtualMachineJAXBParsingTest extends BaseRestClientTest {
|
||||||
@Test
|
@Test
|
||||||
public void testParseVirtualMachineWithJAXB() throws Exception {
|
public void testParseVirtualMachineWithJAXB() throws Exception {
|
||||||
|
|
||||||
Method method = VirtualMachineAsyncClient.class.getMethod("getVirtualMachine", long.class);
|
Method method = VirtualMachineAsyncClient.class.getMethod("getVirtualMachine", URI.class);
|
||||||
HttpRequest request = factory(VirtualMachineAsyncClient.class).createRequest(method,1);
|
HttpRequest request = factory(VirtualMachineAsyncClient.class).createRequest(method,new URI("/1"));
|
||||||
assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
|
assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
|
||||||
|
|
||||||
Function<HttpResponse, VirtualMachine> parser = (Function<HttpResponse, VirtualMachine>) RestAnnotationProcessor
|
Function<HttpResponse, VirtualMachine> parser = (Function<HttpResponse, VirtualMachine>) RestAnnotationProcessor
|
||||||
|
|
Loading…
Reference in New Issue