mirror of https://github.com/apache/jclouds.git
JCLOUDS-150 clear remaining async stuff from aws
This commit is contained in:
parent
360e8b8d6a
commit
100d43360a
|
@ -30,7 +30,6 @@ import java.util.Properties;
|
||||||
|
|
||||||
import org.jclouds.apis.ApiMetadata;
|
import org.jclouds.apis.ApiMetadata;
|
||||||
import org.jclouds.rest.internal.BaseHttpApiMetadata;
|
import org.jclouds.rest.internal.BaseHttpApiMetadata;
|
||||||
import org.jclouds.rest.internal.BaseRestApiMetadata;
|
|
||||||
import org.jclouds.s3.blobstore.S3BlobStoreContext;
|
import org.jclouds.s3.blobstore.S3BlobStoreContext;
|
||||||
import org.jclouds.s3.blobstore.config.S3BlobStoreContextModule;
|
import org.jclouds.s3.blobstore.config.S3BlobStoreContextModule;
|
||||||
import org.jclouds.s3.config.S3HttpApiModule;
|
import org.jclouds.s3.config.S3HttpApiModule;
|
||||||
|
@ -69,7 +68,7 @@ public class S3ApiMetadata extends BaseHttpApiMetadata {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Properties defaultProperties() {
|
public static Properties defaultProperties() {
|
||||||
Properties properties = BaseRestApiMetadata.defaultProperties();
|
Properties properties = BaseHttpApiMetadata.defaultProperties();
|
||||||
properties.setProperty(PROPERTY_AUTH_TAG, "AWS");
|
properties.setProperty(PROPERTY_AUTH_TAG, "AWS");
|
||||||
properties.setProperty(PROPERTY_HEADER_TAG, S3Headers.DEFAULT_AMAZON_HEADERTAG);
|
properties.setProperty(PROPERTY_HEADER_TAG, S3Headers.DEFAULT_AMAZON_HEADERTAG);
|
||||||
properties.setProperty(PROPERTY_S3_SERVICE_PATH, "/");
|
properties.setProperty(PROPERTY_S3_SERVICE_PATH, "/");
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
package org.jclouds.sqs.features;
|
package org.jclouds.sqs.features;
|
||||||
|
|
||||||
import static com.google.common.util.concurrent.MoreExecutors.newDirectExecutorService;
|
import static com.google.common.util.concurrent.MoreExecutors.newDirectExecutorService;
|
||||||
import static org.jclouds.providers.AnonymousProviderMetadata.forClientMappedToAsyncClientOnEndpoint;
|
import static org.jclouds.providers.AnonymousProviderMetadata.forApiOnEndpoint;
|
||||||
import static org.jclouds.sqs.reference.SQSParameters.ACTION;
|
import static org.jclouds.sqs.reference.SQSParameters.ACTION;
|
||||||
import static org.testng.Assert.assertEquals;
|
import static org.testng.Assert.assertEquals;
|
||||||
|
|
||||||
|
@ -39,7 +39,6 @@ import org.testng.annotations.BeforeClass;
|
||||||
import org.testng.annotations.Test;
|
import org.testng.annotations.Test;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableSet;
|
import com.google.common.collect.ImmutableSet;
|
||||||
import com.google.common.util.concurrent.ListenableFuture;
|
|
||||||
import com.google.inject.Module;
|
import com.google.inject.Module;
|
||||||
|
|
||||||
@Test(groups = "live", singleThreaded = true, testName = "PermissionApiLiveTest")
|
@Test(groups = "live", singleThreaded = true, testName = "PermissionApiLiveTest")
|
||||||
|
@ -57,15 +56,11 @@ public class PermissionApiLiveTest extends BaseSQSApiLiveTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
interface AnonymousAttributesApi extends Closeable {
|
interface AnonymousAttributesApi extends Closeable {
|
||||||
String getQueueArn();
|
|
||||||
}
|
|
||||||
|
|
||||||
interface AnonymousAttributesAsyncApi extends Closeable {
|
|
||||||
@POST
|
@POST
|
||||||
@Path("/")
|
@Path("/")
|
||||||
@FormParams(keys = { ACTION, "AttributeName.1" }, values = { "GetQueueAttributes", "QueueArn" })
|
@FormParams(keys = { ACTION, "AttributeName.1" }, values = { "GetQueueAttributes", "QueueArn" })
|
||||||
@XMLResponseParser(ValueHandler.class)
|
@XMLResponseParser(ValueHandler.class)
|
||||||
ListenableFuture<String> getQueueArn();
|
String getQueueArn();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testAddAnonymousPermission() throws InterruptedException {
|
public void testAddAnonymousPermission() throws InterruptedException {
|
||||||
|
@ -95,9 +90,7 @@ public class PermissionApiLiveTest extends BaseSQSApiLiveTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
private AnonymousAttributesApi getAnonymousAttributesApi(URI queue) {
|
private AnonymousAttributesApi getAnonymousAttributesApi(URI queue) {
|
||||||
return ContextBuilder.newBuilder(
|
return ContextBuilder.newBuilder(forApiOnEndpoint(AnonymousAttributesApi.class, queue.toASCIIString()))
|
||||||
forClientMappedToAsyncClientOnEndpoint(AnonymousAttributesApi.class,
|
|
||||||
AnonymousAttributesAsyncApi.class, queue.toASCIIString()))
|
|
||||||
.modules(ImmutableSet.<Module> of(new ExecutorServiceModule(newDirectExecutorService(), newDirectExecutorService())))
|
.modules(ImmutableSet.<Module> of(new ExecutorServiceModule(newDirectExecutorService(), newDirectExecutorService())))
|
||||||
.buildApi(AnonymousAttributesApi.class);
|
.buildApi(AnonymousAttributesApi.class);
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,6 +18,7 @@ package org.jclouds.aws.filters;
|
||||||
|
|
||||||
import static javax.ws.rs.HttpMethod.GET;
|
import static javax.ws.rs.HttpMethod.GET;
|
||||||
import static org.jclouds.aws.reference.AWSConstants.PROPERTY_HEADER_TAG;
|
import static org.jclouds.aws.reference.AWSConstants.PROPERTY_HEADER_TAG;
|
||||||
|
import static org.jclouds.providers.AnonymousProviderMetadata.forApiOnEndpoint;
|
||||||
import static org.testng.Assert.assertEquals;
|
import static org.testng.Assert.assertEquals;
|
||||||
|
|
||||||
import org.jclouds.ContextBuilder;
|
import org.jclouds.ContextBuilder;
|
||||||
|
@ -25,10 +26,8 @@ import org.jclouds.aws.xml.SessionCredentialsHandlerTest;
|
||||||
import org.jclouds.date.TimeStamp;
|
import org.jclouds.date.TimeStamp;
|
||||||
import org.jclouds.domain.Credentials;
|
import org.jclouds.domain.Credentials;
|
||||||
import org.jclouds.http.HttpRequest;
|
import org.jclouds.http.HttpRequest;
|
||||||
import org.jclouds.http.IntegrationTestAsyncClient;
|
|
||||||
import org.jclouds.http.IntegrationTestClient;
|
import org.jclouds.http.IntegrationTestClient;
|
||||||
import org.jclouds.logging.config.NullLoggingModule;
|
import org.jclouds.logging.config.NullLoggingModule;
|
||||||
import org.jclouds.providers.AnonymousProviderMetadata;
|
|
||||||
import org.jclouds.rest.RequestSigner;
|
import org.jclouds.rest.RequestSigner;
|
||||||
import org.jclouds.rest.internal.BaseRestApiTest.MockModule;
|
import org.jclouds.rest.internal.BaseRestApiTest.MockModule;
|
||||||
import org.testng.annotations.Test;
|
import org.testng.annotations.Test;
|
||||||
|
@ -36,11 +35,11 @@ import org.testng.annotations.Test;
|
||||||
import com.google.common.base.Suppliers;
|
import com.google.common.base.Suppliers;
|
||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
import com.google.common.collect.ImmutableMultimap;
|
import com.google.common.collect.ImmutableMultimap;
|
||||||
|
import com.google.common.net.HttpHeaders;
|
||||||
import com.google.inject.AbstractModule;
|
import com.google.inject.AbstractModule;
|
||||||
import com.google.inject.Injector;
|
import com.google.inject.Injector;
|
||||||
import com.google.inject.Module;
|
import com.google.inject.Module;
|
||||||
import com.google.inject.name.Names;
|
import com.google.inject.name.Names;
|
||||||
import com.google.common.net.HttpHeaders;
|
|
||||||
/**
|
/**
|
||||||
* Tests behavior of {@code FormSigner}
|
* Tests behavior of {@code FormSigner}
|
||||||
*/
|
*/
|
||||||
|
@ -50,9 +49,7 @@ import com.google.common.net.HttpHeaders;
|
||||||
public class FormSignerTest {
|
public class FormSignerTest {
|
||||||
public static Injector injector(Credentials creds) {
|
public static Injector injector(Credentials creds) {
|
||||||
return ContextBuilder
|
return ContextBuilder
|
||||||
.newBuilder(
|
.newBuilder(forApiOnEndpoint(IntegrationTestClient.class, "http://localhost"))
|
||||||
AnonymousProviderMetadata.forClientMappedToAsyncClientOnEndpoint(IntegrationTestClient.class,
|
|
||||||
IntegrationTestAsyncClient.class, "http://localhost"))
|
|
||||||
.credentialsSupplier(Suppliers.<Credentials> ofInstance(creds)).apiVersion("apiVersion")
|
.credentialsSupplier(Suppliers.<Credentials> ofInstance(creds)).apiVersion("apiVersion")
|
||||||
.modules(ImmutableList.<Module> of(new MockModule(), new NullLoggingModule(), new AbstractModule() {
|
.modules(ImmutableList.<Module> of(new MockModule(), new NullLoggingModule(), new AbstractModule() {
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in New Issue