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



Project jclouds/jclouds in file ....http.handlers.BackoffLimitedRetryHandlerTest.java (2013-01-05)
@@ -23,7 +23,6 @@ import static org.testng.Assert.assertTrue;
 
 import java.io.IOException;
 import java.io.InputStream;
-import java.lang.reflect.Method;
 import java.util.Properties;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
@@ -50,6 +49,8 @@ import org.testng.annotations.BeforeTest;
 import org.testng.annotations.Test;
 
 import com.google.common.base.Supplier;
+import com.google.common.collect.ImmutableList;
+import com.google.common.reflect.Invokable;
 
 @Test(groups = "unit", testName = "BackoffLimitedRetryHandlerTest")
 public class BackoffLimitedRetryHandlerTest {
@@ -169,9 +170,9 @@ public class BackoffLimitedRetryHandlerTest {
          .getInstance(RestAnnotationProcessor.Factory.class).declaring(IntegrationTestAsyncClient.class);
 
    private HttpCommand createCommand() throws SecurityException, NoSuchMethodException {
-      Method method = IntegrationTestAsyncClient.class.getMethod("download", String.class);
+      Invokable<?, Object> method = Invokable.from(IntegrationTestAsyncClient.class.getMethod("download", String.class));
 
-      return new HttpCommand(processor.createRequest(method, "1"));
+      return new HttpCommand(processor.createRequest(method, ImmutableList.<Object> of("1")));
    }
 
    @Test
Project jclouds/jclouds in file ...udstack.features.ConfigurationAsyncClientTest.java (2013-01-05)
@@ -19,7 +19,6 @@
 package org.jclouds.cloudstack.features;
 
 import java.io.IOException;
-import java.lang.reflect.Method;
 
 import org.jclouds.cloudstack.internal.BaseCloudStackAsyncClientTest;
 import org.jclouds.fallbacks.MapHttp4xxCodesToExceptions;
@@ -27,6 +26,9 @@ import org.jclouds.http.HttpRequest;
 import org.jclouds.http.functions.ParseFirstJsonValueNamed;
 import org.testng.annotations.Test;
 
+import com.google.common.collect.ImmutableList;
+import com.google.common.reflect.Invokable;
+
 /**
  * Tests behavior of {@code ConfigurationAsyncClient}
  * 
@@ -38,8 +40,8 @@ import org.testng.annotations.Test;
 public class ConfigurationAsyncClientTest extends BaseCloudStackAsyncClientTest<ConfigurationAsyncClient> {
 
    public void testListCapabilities() throws SecurityException, NoSuchMethodException, IOException {
-      Method method = ConfigurationAsyncClient.class.getMethod("listCapabilities");
-      HttpRequest httpRequest = processor.createRequest(method);
+      Invokable<?, ?> method = Invokable.from(ConfigurationAsyncClient.class.getMethod("listCapabilities"));
+      HttpRequest httpRequest = processor.createRequest(method, ImmutableList.of());
 
       assertRequestLineEquals(httpRequest,
             "GET http://localhost:8080/client/api?response=json&listAll=true&command=listCapabilities HTTP/1.1");
Project jclouds/jclouds in file ...cloudstack.features.GlobalHostAsyncClientTest.java (2013-01-05)
@@ -18,8 +18,6 @@
  */
 package org.jclouds.cloudstack.features;
 
-import java.lang.reflect.Method;
-
 import org.jclouds.Fallbacks.EmptySetOnNotFoundOr404;
 import org.jclouds.cloudstack.internal.BaseCloudStackAsyncClientTest;
 import org.jclouds.cloudstack.options.ListHostsOptions;
@@ -27,6 +25,9 @@ import org.jclouds.http.HttpRequest;
 import org.jclouds.http.functions.ParseFirstJsonValueNamed;
 import org.testng.annotations.Test;
 
+import com.google.common.collect.ImmutableList;
+import com.google.common.reflect.Invokable;
+
 /**
  * Tests behavior of {@code GlobalHostAsyncClient}
  *
@@ -36,8 +37,8 @@ import org.testng.annotations.Test;
 public class GlobalHostAsyncClientTest extends BaseCloudStackAsyncClientTest<GlobalHostAsyncClient> {
 
    public void testListHosts() throws Exception {
-      Method method =GlobalHostAsyncClient.class.getMethod("listHosts", ListHostsOptions[].class);
-      HttpRequest httpRequest = processor.createRequest(method);
+      Invokable<?, ?> method = Invokable.from(GlobalHostAsyncClient.class.getMethod("listHosts", ListHostsOptions[].class));
+      HttpRequest httpRequest = processor.createRequest(method, ImmutableList.of());
 
       assertRequestLineEquals(httpRequest,
          "GET http://localhost:8080/client/api?response=json&command=listHosts&listAll=true HTTP/1.1");
Project jclouds/jclouds in file ...inders.BindAsHostPrefixIfConfiguredNoPathTest.java (2013-01-05)
@@ -21,7 +21,6 @@ package org.jclouds.s3.binders;
 import static org.jclouds.s3.reference.S3Constants.PROPERTY_S3_VIRTUAL_HOST_BUCKETS;
 
 import java.io.IOException;
-import java.lang.reflect.Method;
 import java.util.Properties;
 
 import org.jclouds.rest.internal.GeneratedHttpRequest;
@@ -29,6 +28,9 @@ import org.jclouds.s3.S3AsyncClient;
 import org.jclouds.s3.internal.BaseS3AsyncClientTest;
 import org.testng.annotations.Test;
 
+import com.google.common.collect.ImmutableList;
+import com.google.common.reflect.Invokable;
+
 /**
  * Tests behavior of {@code BindAsHostPrefixIfConfigured}
  * 
@@ -40,8 +42,8 @@ public class BindAsHostPrefixIfConfiguredNoPathTest extends BaseS3AsyncClientTes
 
    public void testBucketWithHostnameStyle() throws IOException, SecurityException, NoSuchMethodException {
 
-      Method method = S3AsyncClient.class.getMethod("deleteObject", String.class, String.class);
-      GeneratedHttpRequest request = processor.createRequest(method, "testbucket.example.com", "test.jpg");
+      Invokable<?, ?> method = Invokable.from(S3AsyncClient.class.getMethod("deleteObject", String.class, String.class));
+      GeneratedHttpRequest request = processor.createRequest(method, ImmutableList.<Object> of("testbucket.example.com", "test.jpg"));
       assertRequestLineEquals(request, "DELETE https://s3.amazonaws.com/testbucket.example.com/test.jpg HTTP/1.1");
    }
 
Project jclouds/jclouds in file ...s.s3.binders.BindAsHostPrefixIfConfiguredTest.java (2013-01-05)
@@ -23,7 +23,6 @@ import static org.jclouds.s3.reference.S3Constants.PROPERTY_S3_VIRTUAL_HOST_BUCK
 import static org.testng.Assert.assertEquals;
 
 import java.io.IOException;
-import java.lang.reflect.Method;
 import java.util.Properties;
 
 import org.jclouds.http.HttpRequest;
@@ -32,6 +31,9 @@ import org.jclouds.s3.internal.BaseS3AsyncClientTest;
 import org.testng.annotations.DataProvider;
 import org.testng.annotations.Test;
 
+import com.google.common.collect.ImmutableList;
+import com.google.common.reflect.Invokable;
+
 /**
  * Tests behavior of {@code BindAsHostPrefixIfConfigured}
  * 
@@ -59,8 +61,8 @@ public class BindAsHostPrefixIfConfiguredTest extends BaseS3AsyncClientTest<S3As
       request = binder.bindToRequest(request, "testbucket.example.com");
       assertEquals(request.getRequestLine(), "GET http://euc/services/Walrus/testbucket.example.com HTTP/1.1");
 
-      Method method = S3AsyncClient.class.getMethod("deleteObject", String.class, String.class);
-      request = processor.createRequest(method, "testbucket.example.com", "test.jpg");
+      Invokable<?, ?> method = Invokable.from(S3AsyncClient.class.getMethod("deleteObject", String.class, String.class));
+      request = processor.createRequest(method, ImmutableList.<Object> of("testbucket.example.com", "test.jpg"));
 
       assertRequestLineEquals(request, "DELETE http://euc/services/Walrus/testbucket.example.com/test.jpg HTTP/1.1");
    }