java.lang.reflect.Methodcom.google.common.reflect.Invokable



Project jclouds/jclouds in file ....jclouds.vcloud.VCloudVersionsAsyncClientTest.java (2013-01-05)
@@ -21,7 +21,6 @@ package org.jclouds.vcloud;
 import static org.testng.Assert.assertEquals;
 
 import java.io.IOException;
-import java.lang.reflect.Method;
 
 import org.jclouds.http.HttpRequest;
 import org.jclouds.http.functions.ParseSax;
@@ -31,6 +30,9 @@ import org.jclouds.rest.internal.BaseAsyncClientTest;
 import org.jclouds.vcloud.xml.SupportedVersionsHandler;
 import org.testng.annotations.Test;
 
+import com.google.common.collect.ImmutableList;
+import com.google.common.reflect.Invokable;
+
 /**
  * Tests behavior of {@code VCloudVersionsAsyncClient}
  * 
@@ -41,8 +43,8 @@ import org.testng.annotations.Test;
 public class VCloudVersionsAsyncClientTest extends BaseAsyncClientTest<VCloudVersionsAsyncClient> {
 
    public void testVersions() throws SecurityException, NoSuchMethodException, IOException {
-      Method method = VCloudVersionsAsyncClient.class.getMethod("getSupportedVersions");
-      HttpRequest request = processor.createRequest(method);
+      Invokable<?, ?> method = Invokable.from(VCloudVersionsAsyncClient.class.getMethod("getSupportedVersions"));
+      HttpRequest request = processor.createRequest(method, ImmutableList.of());
 
       assertEquals(request.getRequestLine(), "GET http://localhost:8080/versions HTTP/1.1");
       assertNonPayloadHeadersEqual(request, "");
Project jclouds/jclouds in file ...ds.vcloud.internal.VCloudLoginAsyncClientTest.java (2013-01-05)
@@ -21,7 +21,6 @@ package org.jclouds.vcloud.internal;
 import static org.testng.Assert.assertEquals;
 
 import java.io.IOException;
-import java.lang.reflect.Method;
 import java.net.URI;
 
 import javax.ws.rs.core.HttpHeaders;
@@ -37,6 +36,8 @@ import org.jclouds.vcloud.functions.ParseLoginResponseFromHeaders;
 import org.testng.annotations.Test;
 
 import com.google.common.base.Supplier;
+import com.google.common.collect.ImmutableList;
+import com.google.common.reflect.Invokable;
 import com.google.inject.Binder;
 import com.google.inject.Module;
 import com.google.inject.Provides;
@@ -51,8 +52,8 @@ import com.google.inject.Provides;
 public class VCloudLoginAsyncClientTest extends BaseAsyncClientTest<VCloudLoginAsyncClient> {
 
    public void testLogin() throws SecurityException, NoSuchMethodException, IOException {
-      Method method = VCloudLoginAsyncClient.class.getMethod("login");
-      HttpRequest request = processor.createRequest(method);
+      Invokable<?, ?> method = Invokable.from(VCloudLoginAsyncClient.class.getMethod("login"));
+      HttpRequest request = processor.createRequest(method, ImmutableList.of());
 
       assertEquals(request.getRequestLine(), "POST http://localhost:8080/login HTTP/1.1");
       assertNonPayloadHeadersEqual(request, HttpHeaders.ACCEPT + ": application/vnd.vmware.vcloud.orgList+xml\n");
Project jclouds/jclouds in file ....internal.TerremarkVCloudLoginAsyncClientTest.java (2013-01-05)
@@ -21,7 +21,6 @@ package org.jclouds.trmk.vcloud_0_8.internal;
 import static org.testng.Assert.assertEquals;
 
 import java.io.IOException;
-import java.lang.reflect.Method;
 import java.net.URI;
 
 import javax.ws.rs.core.HttpHeaders;
@@ -37,6 +36,8 @@ import org.jclouds.trmk.vcloud_0_8.functions.ParseLoginResponseFromHeaders;
 import org.testng.annotations.Test;
 
 import com.google.common.base.Supplier;
+import com.google.common.collect.ImmutableList;
+import com.google.common.reflect.Invokable;
 import com.google.inject.Binder;
 import com.google.inject.Module;
 import com.google.inject.Provides;
@@ -52,8 +53,8 @@ import com.google.inject.Provides;
 public class TerremarkVCloudLoginAsyncClientTest extends BaseAsyncClientTest<TerremarkVCloudLoginAsyncClient> {
 
    public void testLogin() throws SecurityException, NoSuchMethodException, IOException {
-      Method method = TerremarkVCloudLoginAsyncClient.class.getMethod("login");
-      HttpRequest request = processor.createRequest(method);
+      Invokable<?, ?> method = Invokable.from(TerremarkVCloudLoginAsyncClient.class.getMethod("login"));
+      HttpRequest request = processor.createRequest(method, ImmutableList.of());
 
       assertEquals(request.getRequestLine(), "POST http://localhost:8080/login HTTP/1.1");
       assertNonPayloadHeadersEqual(request, HttpHeaders.ACCEPT + ": application/vnd.vmware.vcloud.orgList+xml\n");
Project jclouds/jclouds in file ...ternal.TerremarkVCloudVersionsAsyncClientTest.java (2013-01-05)
@@ -21,7 +21,6 @@ package org.jclouds.trmk.vcloud_0_8.internal;
 import static org.testng.Assert.assertEquals;
 
 import java.io.IOException;
-import java.lang.reflect.Method;
 
 import org.jclouds.http.HttpRequest;
 import org.jclouds.http.functions.ParseSax;
@@ -31,6 +30,9 @@ import org.jclouds.rest.internal.BaseAsyncClientTest;
 import org.jclouds.trmk.vcloud_0_8.xml.SupportedVersionsHandler;
 import org.testng.annotations.Test;
 
+import com.google.common.collect.ImmutableList;
+import com.google.common.reflect.Invokable;
+
 /**
  * Tests behavior of {@code VCloudVersionsAsyncClient}
  * 
@@ -41,8 +43,8 @@ import org.testng.annotations.Test;
 public class TerremarkVCloudVersionsAsyncClientTest extends BaseAsyncClientTest<TerremarkVCloudVersionsAsyncClient> {
 
    public void testVersions() throws SecurityException, NoSuchMethodException, IOException {
-      Method method = TerremarkVCloudVersionsAsyncClient.class.getMethod("getSupportedVersions");
-      HttpRequest request = processor.createRequest(method);
+      Invokable<?, ?> method = Invokable.from(TerremarkVCloudVersionsAsyncClient.class.getMethod("getSupportedVersions"));
+      HttpRequest request = processor.createRequest(method, ImmutableList.of());
 
       assertEquals(request.getRequestLine(), "GET http://localhost:8080/versions HTTP/1.1");
       assertNonPayloadHeadersEqual(request, "");
Project jclouds/jclouds in file ...org.jclouds.abiquo.features.EventAsyncApiTest.java (2013-01-05)
@@ -20,13 +20,14 @@
 package org.jclouds.abiquo.features;
 
 import java.io.IOException;
-import java.lang.reflect.Method;
 
 import org.jclouds.http.functions.ParseXMLWithJAXB;
 import org.jclouds.rest.internal.GeneratedHttpRequest;
 import org.testng.annotations.Test;
 
 import com.abiquo.server.core.event.EventsDto;
+import com.google.common.collect.ImmutableList;
+import com.google.common.reflect.Invokable;
 
 /**
  * Tests annotation parsing of {@code EventAsyncApi}
@@ -37,8 +38,8 @@ import com.abiquo.server.core.event.EventsDto;
 @Test(groups = "unit", testName = "EventAsyncApiTest")
 public class EventAsyncApiTest extends BaseAbiquoAsyncApiTest<EventAsyncApi> {
    public void testListEvents() throws SecurityException, NoSuchMethodException, IOException {
-      Method method = EventAsyncApi.class.getMethod("listEvents");
-      GeneratedHttpRequest request = processor.createRequest(method);
+      Invokable<?, ?> method = Invokable.from(EventAsyncApi.class.getMethod("listEvents"));
+      GeneratedHttpRequest request = processor.createRequest(method, ImmutableList.of());
 
       assertRequestLineEquals(request, "GET http://localhost/api/events HTTP/1.1");
       assertNonPayloadHeadersEqual(request, "Accept: " + EventsDto.BASE_MEDIA_TYPE + "\n");