mirror of https://github.com/apache/jclouds.git
Issue 337: support non-standard http methods
This commit is contained in:
parent
0394c29394
commit
8efea1b42d
|
@ -29,10 +29,12 @@ import java.io.ByteArrayInputStream;
|
|||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.lang.reflect.Field;
|
||||
import java.net.Authenticator;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.InetSocketAddress;
|
||||
import java.net.PasswordAuthentication;
|
||||
import java.net.ProtocolException;
|
||||
import java.net.Proxy;
|
||||
import java.net.ProxySelector;
|
||||
import java.net.SocketAddress;
|
||||
|
@ -60,6 +62,7 @@ import org.jclouds.io.Payload;
|
|||
import org.jclouds.io.Payloads;
|
||||
import org.jclouds.logging.Logger;
|
||||
|
||||
import com.google.common.base.Throwables;
|
||||
import com.google.common.collect.LinkedHashMultimap;
|
||||
import com.google.common.collect.Multimap;
|
||||
|
||||
|
@ -75,16 +78,20 @@ public class JavaUrlHttpCommandExecutorService extends BaseHttpCommandExecutorSe
|
|||
@Resource
|
||||
protected Logger logger = Logger.NULL;
|
||||
private final HostnameVerifier verifier;
|
||||
private final Field methodField;
|
||||
|
||||
@Inject
|
||||
public JavaUrlHttpCommandExecutorService(HttpUtils utils,
|
||||
@Named(Constants.PROPERTY_IO_WORKER_THREADS) ExecutorService ioWorkerExecutor,
|
||||
DelegatingRetryHandler retryHandler, IOExceptionRetryHandler ioRetryHandler,
|
||||
DelegatingErrorHandler errorHandler, HttpWire wire, HostnameVerifier verifier) {
|
||||
DelegatingErrorHandler errorHandler, HttpWire wire, HostnameVerifier verifier) throws SecurityException,
|
||||
NoSuchFieldException {
|
||||
super(utils, ioWorkerExecutor, retryHandler, ioRetryHandler, errorHandler, wire);
|
||||
if (utils.getMaxConnections() > 0)
|
||||
System.setProperty("http.maxConnections", String.valueOf(checkNotNull(utils, "utils").getMaxConnections()));
|
||||
this.verifier = checkNotNull(verifier, "verifier");
|
||||
this.methodField = HttpURLConnection.class.getDeclaredField("method");
|
||||
methodField.setAccessible(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -163,7 +170,17 @@ public class JavaUrlHttpCommandExecutorService extends BaseHttpCommandExecutorSe
|
|||
// ex. Caused by: java.io.IOException: HTTPS hostname wrong: should be
|
||||
// <adriancole.s3int0.s3-external-3.amazonaws.com>
|
||||
connection.setInstanceFollowRedirects(false);
|
||||
connection.setRequestMethod(request.getMethod().toString());
|
||||
try {
|
||||
connection.setRequestMethod(request.getMethod());
|
||||
} catch (ProtocolException e) {
|
||||
try {
|
||||
methodField.set(connection, request.getMethod());
|
||||
} catch (Exception e1) {
|
||||
logger.error(e, "could not set request method: ", request.getMethod());
|
||||
Throwables.propagate(e1);
|
||||
}
|
||||
}
|
||||
|
||||
for (String header : request.getHeaders().keySet()) {
|
||||
for (String value : request.getHeaders().get(header)) {
|
||||
connection.setRequestProperty(header, value);
|
||||
|
|
|
@ -64,13 +64,19 @@ public abstract class BaseHttpCommandExecutorServiceIntegrationTest extends Base
|
|||
|
||||
// TODO: filtering redirect test
|
||||
|
||||
@Test(invocationCount = 25, timeOut = 5000)
|
||||
@Test(invocationCount = 5, timeOut = 5000)
|
||||
public void testGetStringWithHeader() throws MalformedURLException, ExecutionException, InterruptedException,
|
||||
TimeoutException {
|
||||
assertEquals(client.download("", "test").trim(), "test");
|
||||
}
|
||||
|
||||
@Test(invocationCount = 25, timeOut = 5000)
|
||||
@Test(invocationCount = 1, timeOut = 5000)
|
||||
public void testAlternateMethod() throws MalformedURLException, ExecutionException, InterruptedException,
|
||||
TimeoutException {
|
||||
assertEquals(client.rowdy("").trim(), XML);
|
||||
}
|
||||
|
||||
@Test(invocationCount = 5, timeOut = 5000)
|
||||
public void testGetString() throws MalformedURLException, ExecutionException, InterruptedException, TimeoutException {
|
||||
assertEquals(client.download("").trim(), XML);
|
||||
}
|
||||
|
@ -80,26 +86,26 @@ public abstract class BaseHttpCommandExecutorServiceIntegrationTest extends Base
|
|||
return new Object[][] { { "object" }, { "/path" }, { "sp ace" }, { "unic₪de" }, { "qu?stion" } };
|
||||
}
|
||||
|
||||
@Test(invocationCount = 25, timeOut = 5000, dataProvider = "gets")
|
||||
@Test(invocationCount = 5, timeOut = 5000, dataProvider = "gets")
|
||||
public void testGetStringSynch(String uri) throws MalformedURLException, ExecutionException, InterruptedException,
|
||||
TimeoutException {
|
||||
// TODO why need trim?
|
||||
assertEquals(client.synch(uri).trim(), XML);
|
||||
}
|
||||
|
||||
@Test(invocationCount = 25, timeOut = 5000)
|
||||
@Test(invocationCount = 5, timeOut = 5000)
|
||||
public void testGetException() throws MalformedURLException, ExecutionException, InterruptedException,
|
||||
TimeoutException {
|
||||
assertEquals(client.downloadException("", GetOptions.Builder.tail(1)).trim(), "foo");
|
||||
}
|
||||
|
||||
@Test(invocationCount = 25, timeOut = 5000)
|
||||
@Test(invocationCount = 5, timeOut = 5000)
|
||||
public void testGetSynchException() throws MalformedURLException, ExecutionException, InterruptedException,
|
||||
TimeoutException {
|
||||
assertEquals(client.synchException("", "").trim(), "foo");
|
||||
}
|
||||
|
||||
@Test(invocationCount = 25, timeOut = 5000)
|
||||
@Test(invocationCount = 5, timeOut = 5000)
|
||||
public void testGetStringRedirect() throws MalformedURLException, ExecutionException, InterruptedException,
|
||||
TimeoutException {
|
||||
assertEquals(client.download("redirect").trim(), XML2);
|
||||
|
@ -128,7 +134,7 @@ public abstract class BaseHttpCommandExecutorServiceIntegrationTest extends Base
|
|||
return input;
|
||||
}
|
||||
|
||||
@Test(enabled = false, invocationCount = 25, timeOut = 5000)
|
||||
@Test(enabled = false, invocationCount = 5, timeOut = 5000)
|
||||
public void testGetStringPermanentRedirect() throws MalformedURLException, ExecutionException, InterruptedException,
|
||||
TimeoutException {
|
||||
// GetString get = factory.createGetString("permanentredirect");
|
||||
|
@ -139,12 +145,12 @@ public abstract class BaseHttpCommandExecutorServiceIntegrationTest extends Base
|
|||
// remembered.
|
||||
}
|
||||
|
||||
@Test(invocationCount = 25, timeOut = 5000)
|
||||
@Test(invocationCount = 5, timeOut = 5000)
|
||||
public void testPost() throws MalformedURLException, ExecutionException, InterruptedException, TimeoutException {
|
||||
assertEquals(client.post("", "foo").trim(), "fooPOST");
|
||||
}
|
||||
|
||||
@Test(invocationCount = 25, timeOut = 10000)
|
||||
@Test(invocationCount = 5, timeOut = 10000)
|
||||
public void testPostAsInputStream() throws MalformedURLException, ExecutionException, InterruptedException,
|
||||
TimeoutException {
|
||||
try {
|
||||
|
@ -215,35 +221,35 @@ public abstract class BaseHttpCommandExecutorServiceIntegrationTest extends Base
|
|||
assert postFailures.get() > 0;
|
||||
}
|
||||
|
||||
@Test(invocationCount = 25, timeOut = 5000)
|
||||
@Test(invocationCount = 5, timeOut = 5000)
|
||||
public void testPostBinder() throws MalformedURLException, ExecutionException, InterruptedException,
|
||||
TimeoutException {
|
||||
assertEquals(client.postJson("", "foo").trim(), "{\"key\":\"foo\"}POST");
|
||||
}
|
||||
|
||||
@Test(invocationCount = 25, timeOut = 5000)
|
||||
@Test(invocationCount = 5, timeOut = 5000)
|
||||
public void testPut() throws MalformedURLException, ExecutionException, InterruptedException, TimeoutException {
|
||||
assertEquals(client.upload("", "foo").trim(), "fooPUT");
|
||||
}
|
||||
|
||||
@Test(invocationCount = 25, timeOut = 5000)
|
||||
@Test(invocationCount = 5, timeOut = 5000)
|
||||
public void testPutRedirect() throws MalformedURLException, ExecutionException, InterruptedException,
|
||||
TimeoutException {
|
||||
assertEquals(client.upload("redirect", "foo").trim(), "fooPUTREDIRECT");
|
||||
}
|
||||
|
||||
@Test(invocationCount = 25, timeOut = 5000)
|
||||
@Test(invocationCount = 5, timeOut = 5000)
|
||||
public void testKillRobotSlowly() throws MalformedURLException, ExecutionException, InterruptedException,
|
||||
TimeoutException {
|
||||
assertEquals(client.action("robot", "kill", ImmutableMap.of("death", "slow")).trim(), "robot->kill:{death=slow}");
|
||||
}
|
||||
|
||||
@Test(invocationCount = 25, timeOut = 5000)
|
||||
@Test(invocationCount = 5, timeOut = 5000)
|
||||
public void testHead() throws MalformedURLException, ExecutionException, InterruptedException, TimeoutException {
|
||||
assert client.exists("");
|
||||
}
|
||||
|
||||
@Test(invocationCount = 25, timeOut = 5000)
|
||||
@Test(invocationCount = 5, timeOut = 5000)
|
||||
public void testGetAndParseSax() throws MalformedURLException, ExecutionException, InterruptedException,
|
||||
TimeoutException {
|
||||
assertEquals(client.downloadAndParse(""), "whoppers");
|
||||
|
|
|
@ -20,11 +20,16 @@
|
|||
package org.jclouds.http;
|
||||
|
||||
import java.io.File;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.ws.rs.GET;
|
||||
import javax.ws.rs.HEAD;
|
||||
import javax.ws.rs.HeaderParam;
|
||||
import javax.ws.rs.HttpMethod;
|
||||
import javax.ws.rs.POST;
|
||||
import javax.ws.rs.PUT;
|
||||
import javax.ws.rs.Path;
|
||||
|
@ -53,6 +58,15 @@ import com.google.common.util.concurrent.ListenableFuture;
|
|||
* @author Adrian Cole
|
||||
*/
|
||||
public interface IntegrationTestAsyncClient {
|
||||
@Target( { ElementType.METHOD })
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@HttpMethod("ROWDY")
|
||||
public @interface ROWDY {
|
||||
}
|
||||
|
||||
@ROWDY
|
||||
@Path("objects/{id}")
|
||||
ListenableFuture<String> rowdy(@PathParam("id") String path);
|
||||
|
||||
@HEAD
|
||||
@Path("objects/{id}")
|
||||
|
@ -82,18 +96,15 @@ public interface IntegrationTestAsyncClient {
|
|||
@GET
|
||||
@Path("objects/{id}")
|
||||
@ExceptionParser(FooOnException.class)
|
||||
ListenableFuture<String> synchException(@PathParam("id") String id,
|
||||
@HeaderParam("Range") String header);
|
||||
ListenableFuture<String> synchException(@PathParam("id") String id, @HeaderParam("Range") String header);
|
||||
|
||||
@PUT
|
||||
@Path("objects/{id}")
|
||||
ListenableFuture<String> upload(@PathParam("id") String id,
|
||||
@BinderParam(BindToStringPayload.class) String toPut);
|
||||
ListenableFuture<String> upload(@PathParam("id") String id, @BinderParam(BindToStringPayload.class) String toPut);
|
||||
|
||||
@POST
|
||||
@Path("objects/{id}")
|
||||
ListenableFuture<String> post(@PathParam("id") String id,
|
||||
@BinderParam(BindToStringPayload.class) String toPut);
|
||||
ListenableFuture<String> post(@PathParam("id") String id, @BinderParam(BindToStringPayload.class) String toPut);
|
||||
|
||||
@POST
|
||||
@Path("objects/{id}")
|
||||
|
@ -111,8 +122,7 @@ public interface IntegrationTestAsyncClient {
|
|||
|
||||
@POST
|
||||
@Path("objects/{id}")
|
||||
ListenableFuture<String> postWithMd5(@PathParam("id") String id,
|
||||
@HeaderParam("Content-MD5") String base64MD5,
|
||||
ListenableFuture<String> postWithMd5(@PathParam("id") String id, @HeaderParam("Content-MD5") String base64MD5,
|
||||
@BinderParam(BindToFilePayload.class) File file);
|
||||
|
||||
static class BindToFilePayload implements Binder {
|
||||
|
@ -126,8 +136,7 @@ public interface IntegrationTestAsyncClient {
|
|||
@POST
|
||||
@Path("objects/{id}")
|
||||
@MapBinder(BindToJsonPayload.class)
|
||||
ListenableFuture<String> postJson(@PathParam("id") String id,
|
||||
@MapPayloadParam("key") String toPut);
|
||||
ListenableFuture<String> postJson(@PathParam("id") String id, @MapPayloadParam("key") String toPut);
|
||||
|
||||
@POST
|
||||
@Path("objects/{id}/action/{action}")
|
||||
|
@ -137,8 +146,7 @@ public interface IntegrationTestAsyncClient {
|
|||
@GET
|
||||
@Path("objects/{id}")
|
||||
@RequestFilters(Filter.class)
|
||||
ListenableFuture<String> downloadFilter(@PathParam("id") String id,
|
||||
@HeaderParam("filterme") String header);
|
||||
ListenableFuture<String> downloadFilter(@PathParam("id") String id, @HeaderParam("filterme") String header);
|
||||
|
||||
static class Filter implements HttpRequestFilter {
|
||||
public void filter(HttpRequest request) throws HttpException {
|
||||
|
|
|
@ -33,6 +33,7 @@ import org.jclouds.http.options.HttpRequestOptions;
|
|||
*/
|
||||
@Timeout(duration = 40, timeUnit = TimeUnit.SECONDS)
|
||||
public interface IntegrationTestClient {
|
||||
String rowdy(String path);
|
||||
|
||||
boolean exists(String path);
|
||||
|
||||
|
|
|
@ -770,12 +770,31 @@ public class RestAnnotationProcessorTest extends BaseRestClientTest {
|
|||
@Unwrap
|
||||
@Consumes(MediaType.APPLICATION_JSON)
|
||||
ListenableFuture<? extends Set<String>> testUnwrap4();
|
||||
|
||||
@Target( { ElementType.METHOD })
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@HttpMethod("ROWDY")
|
||||
public @interface ROWDY {
|
||||
}
|
||||
|
||||
@ROWDY
|
||||
@Path("objects/{id}")
|
||||
ListenableFuture<Boolean> rowdy(@PathParam("id") String path);
|
||||
}
|
||||
|
||||
static class Wrapper {
|
||||
String foo;
|
||||
}
|
||||
|
||||
public void testAlternateHttpMethod() throws SecurityException, NoSuchMethodException, IOException {
|
||||
Method method = TestPut.class.getMethod("rowdy", String.class);
|
||||
HttpRequest request = factory(TestPut.class).createRequest(method, "data");
|
||||
|
||||
assertRequestLineEquals(request, "ROWDY http://localhost:9999/objects/data HTTP/1.1");
|
||||
assertNonPayloadHeadersEqual(request, "");
|
||||
assertPayloadEquals(request, null, null, false);
|
||||
}
|
||||
|
||||
public void testCreatePutWithMethodBinder() throws SecurityException, NoSuchMethodException, IOException {
|
||||
Method method = TestPut.class.getMethod("putWithMethodBinder", String.class);
|
||||
HttpRequest request = factory(TestPut.class).createRequest(method, "data");
|
||||
|
@ -2024,7 +2043,8 @@ public class RestAnnotationProcessorTest extends BaseRestClientTest {
|
|||
|
||||
@Override
|
||||
protected void configure() {
|
||||
bind(URI.class).annotatedWith(Localhost2.class).toInstance(URI.create("http://localhost:1111"));
|
||||
bind(URI.class).annotatedWith(Localhost2.class).toInstance(
|
||||
URI.create("http://localhost:1111"));
|
||||
}
|
||||
|
||||
}));
|
||||
|
|
|
@ -32,10 +32,12 @@ import javax.ws.rs.core.HttpHeaders;
|
|||
import org.apache.http.HttpEntity;
|
||||
import org.apache.http.HttpEntityEnclosingRequest;
|
||||
import org.apache.http.client.methods.HttpDelete;
|
||||
import org.apache.http.client.methods.HttpEntityEnclosingRequestBase;
|
||||
import org.apache.http.client.methods.HttpGet;
|
||||
import org.apache.http.client.methods.HttpHead;
|
||||
import org.apache.http.client.methods.HttpPost;
|
||||
import org.apache.http.client.methods.HttpPut;
|
||||
import org.apache.http.client.methods.HttpRequestBase;
|
||||
import org.apache.http.client.methods.HttpUriRequest;
|
||||
import org.apache.http.entity.ByteArrayEntity;
|
||||
import org.apache.http.entity.FileEntity;
|
||||
|
@ -73,7 +75,26 @@ public class ApacheHCUtils {
|
|||
} else if (request.getMethod().equals(HttpMethod.POST)) {
|
||||
apacheRequest = new HttpPost(request.getEndpoint());
|
||||
} else {
|
||||
throw new UnsupportedOperationException(request.getMethod());
|
||||
final String method = request.getMethod();
|
||||
if (request.getPayload() != null)
|
||||
apacheRequest = new HttpEntityEnclosingRequestBase() {
|
||||
|
||||
@Override
|
||||
public String getMethod() {
|
||||
return method;
|
||||
}
|
||||
|
||||
};
|
||||
else
|
||||
apacheRequest = new HttpRequestBase() {
|
||||
|
||||
@Override
|
||||
public String getMethod() {
|
||||
return method;
|
||||
}
|
||||
|
||||
};
|
||||
HttpRequestBase.class.cast(apacheRequest).setURI(request.getEndpoint());
|
||||
}
|
||||
Payload payload = request.getPayload();
|
||||
|
||||
|
|
|
@ -68,7 +68,7 @@ public class AsyncGaeHttpCommandExecutorServiceIntegrationTest extends BaseHttpC
|
|||
@Test(enabled = false)
|
||||
public void testPerformanceVsNothing() {
|
||||
setupApiProxy();
|
||||
int count = 50;
|
||||
int count = 5;
|
||||
final URI fetch = URI.create("http://www.google.com");
|
||||
|
||||
final URLFetchService service = URLFetchServiceFactory.getURLFetchService();
|
||||
|
@ -172,7 +172,7 @@ public class AsyncGaeHttpCommandExecutorServiceIntegrationTest extends BaseHttpC
|
|||
}
|
||||
|
||||
@Override
|
||||
@Test(enabled = true, invocationCount = 50, timeOut = 3000)
|
||||
@Test(enabled = true, invocationCount = 5, timeOut = 3000)
|
||||
public void testKillRobotSlowly() throws MalformedURLException, ExecutionException, InterruptedException,
|
||||
TimeoutException {
|
||||
setupApiProxy();
|
||||
|
@ -180,7 +180,7 @@ public class AsyncGaeHttpCommandExecutorServiceIntegrationTest extends BaseHttpC
|
|||
}
|
||||
|
||||
@Override
|
||||
@Test(enabled = true, invocationCount = 50, timeOut = 3000)
|
||||
@Test(enabled = true, invocationCount = 5, timeOut = 3000)
|
||||
public void testPostAsInputStream() throws MalformedURLException, ExecutionException, InterruptedException,
|
||||
TimeoutException {
|
||||
setupApiProxy();
|
||||
|
@ -196,7 +196,7 @@ public class AsyncGaeHttpCommandExecutorServiceIntegrationTest extends BaseHttpC
|
|||
}
|
||||
|
||||
@Override
|
||||
@Test(enabled = true, invocationCount = 50, timeOut = 3000)
|
||||
@Test(enabled = true, invocationCount = 5, timeOut = 3000)
|
||||
public void testPostBinder() throws MalformedURLException, ExecutionException, InterruptedException,
|
||||
TimeoutException {
|
||||
setupApiProxy();
|
||||
|
@ -209,7 +209,7 @@ public class AsyncGaeHttpCommandExecutorServiceIntegrationTest extends BaseHttpC
|
|||
}
|
||||
|
||||
@Override
|
||||
@Test(enabled = true, invocationCount = 50, timeOut = 3000)
|
||||
@Test(enabled = true, invocationCount = 5, timeOut = 3000)
|
||||
public void testGetAndParseSax() throws MalformedURLException, ExecutionException, InterruptedException,
|
||||
TimeoutException {
|
||||
setupApiProxy();
|
||||
|
@ -217,14 +217,14 @@ public class AsyncGaeHttpCommandExecutorServiceIntegrationTest extends BaseHttpC
|
|||
}
|
||||
|
||||
@Override
|
||||
@Test(enabled = true, invocationCount = 50, timeOut = 3000)
|
||||
@Test(enabled = true, invocationCount = 5, timeOut = 3000)
|
||||
public void testGetString() throws MalformedURLException, ExecutionException, InterruptedException, TimeoutException {
|
||||
setupApiProxy();
|
||||
super.testGetString();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Test(enabled = true, invocationCount = 50, timeOut = 3000, dataProvider = "gets")
|
||||
@Test(enabled = true, invocationCount = 5, timeOut = 3000, dataProvider = "gets")
|
||||
public void testGetStringSynch(String path) throws MalformedURLException, ExecutionException, InterruptedException,
|
||||
TimeoutException {
|
||||
setupApiProxy();
|
||||
|
@ -232,7 +232,7 @@ public class AsyncGaeHttpCommandExecutorServiceIntegrationTest extends BaseHttpC
|
|||
}
|
||||
|
||||
@Override
|
||||
@Test(enabled = true, invocationCount = 50, timeOut = 3000)
|
||||
@Test(enabled = true, invocationCount = 5, timeOut = 3000)
|
||||
public void testGetStringRedirect() throws MalformedURLException, ExecutionException, InterruptedException,
|
||||
TimeoutException {
|
||||
setupApiProxy();
|
||||
|
@ -240,7 +240,7 @@ public class AsyncGaeHttpCommandExecutorServiceIntegrationTest extends BaseHttpC
|
|||
}
|
||||
|
||||
@Override
|
||||
@Test(enabled = true, invocationCount = 50, timeOut = 3000)
|
||||
@Test(enabled = true, invocationCount = 5, timeOut = 3000)
|
||||
public void testGetException() throws MalformedURLException, ExecutionException, InterruptedException,
|
||||
TimeoutException {
|
||||
setupApiProxy();
|
||||
|
@ -248,7 +248,7 @@ public class AsyncGaeHttpCommandExecutorServiceIntegrationTest extends BaseHttpC
|
|||
}
|
||||
|
||||
@Override
|
||||
@Test(enabled = true, invocationCount = 50, timeOut = 3000)
|
||||
@Test(enabled = true, invocationCount = 5, timeOut = 3000)
|
||||
public void testGetStringPermanentRedirect() throws MalformedURLException, ExecutionException, InterruptedException,
|
||||
TimeoutException {
|
||||
setupApiProxy();
|
||||
|
@ -256,7 +256,7 @@ public class AsyncGaeHttpCommandExecutorServiceIntegrationTest extends BaseHttpC
|
|||
}
|
||||
|
||||
@Override
|
||||
@Test(enabled = true, invocationCount = 50, timeOut = 3000)
|
||||
@Test(enabled = true, invocationCount = 5, timeOut = 3000)
|
||||
public void testGetSynchException() throws MalformedURLException, ExecutionException, InterruptedException,
|
||||
TimeoutException {
|
||||
setupApiProxy();
|
||||
|
@ -264,21 +264,21 @@ public class AsyncGaeHttpCommandExecutorServiceIntegrationTest extends BaseHttpC
|
|||
}
|
||||
|
||||
@Override
|
||||
@Test(enabled = true, invocationCount = 50, timeOut = 3000)
|
||||
@Test(enabled = true, invocationCount = 5, timeOut = 3000)
|
||||
public void testPost() throws MalformedURLException, ExecutionException, InterruptedException, TimeoutException {
|
||||
setupApiProxy();
|
||||
super.testPost();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Test(enabled = true, invocationCount = 50, timeOut = 3000)
|
||||
@Test(enabled = true, invocationCount = 5, timeOut = 3000)
|
||||
public void testPut() throws MalformedURLException, ExecutionException, InterruptedException, TimeoutException {
|
||||
setupApiProxy();
|
||||
super.testPut();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Test(enabled = true, invocationCount = 50, timeOut = 3000)
|
||||
@Test(enabled = true, invocationCount = 5, timeOut = 3000)
|
||||
public void testPutRedirect() throws MalformedURLException, ExecutionException, InterruptedException,
|
||||
TimeoutException {
|
||||
setupApiProxy();
|
||||
|
@ -286,7 +286,7 @@ public class AsyncGaeHttpCommandExecutorServiceIntegrationTest extends BaseHttpC
|
|||
}
|
||||
|
||||
@Override
|
||||
@Test(enabled = true, invocationCount = 50, timeOut = 3000)
|
||||
@Test(enabled = true, invocationCount = 5, timeOut = 3000)
|
||||
public void testGetStringWithHeader() throws MalformedURLException, ExecutionException, InterruptedException,
|
||||
TimeoutException {
|
||||
setupApiProxy();
|
||||
|
@ -294,14 +294,14 @@ public class AsyncGaeHttpCommandExecutorServiceIntegrationTest extends BaseHttpC
|
|||
}
|
||||
|
||||
@Override
|
||||
@Test(enabled = true, invocationCount = 50, timeOut = 3000)
|
||||
@Test(enabled = true, invocationCount = 5, timeOut = 3000)
|
||||
public void testHead() throws MalformedURLException, ExecutionException, InterruptedException, TimeoutException {
|
||||
setupApiProxy();
|
||||
super.testHead();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Test(enabled = true, invocationCount = 50, timeOut = 3000)
|
||||
@Test(enabled = true, invocationCount = 5, timeOut = 3000)
|
||||
public void testRequestFilter() throws MalformedURLException, ExecutionException, InterruptedException,
|
||||
TimeoutException {
|
||||
setupApiProxy();
|
||||
|
@ -344,4 +344,13 @@ public class AsyncGaeHttpCommandExecutorServiceIntegrationTest extends BaseHttpC
|
|||
// disabled since test data is too big
|
||||
}
|
||||
|
||||
// http://code.google.com/p/googleappengine/issues/detail?id=3599
|
||||
@Override
|
||||
@Test(enabled = true, expectedExceptions = IllegalArgumentException.class)
|
||||
public void testAlternateMethod() throws MalformedURLException, ExecutionException, InterruptedException,
|
||||
TimeoutException {
|
||||
setupApiProxy();
|
||||
super.testAlternateMethod();
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue