JCLOUDS-150 clear remaining async stuff from aws

This commit is contained in:
Adrian Cole 2014-10-05 18:04:32 -07:00
parent 8bae4b952f
commit 6e6f8923e8
3 changed files with 7 additions and 18 deletions

View File

@ -30,7 +30,6 @@ import java.util.Properties;
import org.jclouds.apis.ApiMetadata;
import org.jclouds.rest.internal.BaseHttpApiMetadata;
import org.jclouds.rest.internal.BaseRestApiMetadata;
import org.jclouds.s3.blobstore.S3BlobStoreContext;
import org.jclouds.s3.blobstore.config.S3BlobStoreContextModule;
import org.jclouds.s3.config.S3HttpApiModule;
@ -69,7 +68,7 @@ public class S3ApiMetadata extends BaseHttpApiMetadata {
}
public static Properties defaultProperties() {
Properties properties = BaseRestApiMetadata.defaultProperties();
Properties properties = BaseHttpApiMetadata.defaultProperties();
properties.setProperty(PROPERTY_AUTH_TAG, "AWS");
properties.setProperty(PROPERTY_HEADER_TAG, S3Headers.DEFAULT_AMAZON_HEADERTAG);
properties.setProperty(PROPERTY_S3_SERVICE_PATH, "/");

View File

@ -17,7 +17,7 @@
package org.jclouds.sqs.features;
import static com.google.common.util.concurrent.MoreExecutors.sameThreadExecutor;
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.testng.Assert.assertEquals;
@ -39,7 +39,6 @@ import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import com.google.common.collect.ImmutableSet;
import com.google.common.util.concurrent.ListenableFuture;
import com.google.inject.Module;
@Test(groups = "live", singleThreaded = true, testName = "PermissionApiLiveTest")
@ -57,15 +56,11 @@ public class PermissionApiLiveTest extends BaseSQSApiLiveTest {
}
interface AnonymousAttributesApi extends Closeable {
String getQueueArn();
}
interface AnonymousAttributesAsyncApi extends Closeable {
@POST
@Path("/")
@FormParams(keys = { ACTION, "AttributeName.1" }, values = { "GetQueueAttributes", "QueueArn" })
@XMLResponseParser(ValueHandler.class)
ListenableFuture<String> getQueueArn();
String getQueueArn();
}
public void testAddAnonymousPermission() throws InterruptedException {
@ -95,9 +90,7 @@ public class PermissionApiLiveTest extends BaseSQSApiLiveTest {
}
private AnonymousAttributesApi getAnonymousAttributesApi(URI queue) {
return ContextBuilder.newBuilder(
forClientMappedToAsyncClientOnEndpoint(AnonymousAttributesApi.class,
AnonymousAttributesAsyncApi.class, queue.toASCIIString()))
return ContextBuilder.newBuilder(forApiOnEndpoint(AnonymousAttributesApi.class, queue.toASCIIString()))
.modules(ImmutableSet.<Module> of(new ExecutorServiceModule(sameThreadExecutor(), sameThreadExecutor())))
.buildApi(AnonymousAttributesApi.class);
}

View File

@ -18,6 +18,7 @@ package org.jclouds.aws.filters;
import static javax.ws.rs.HttpMethod.GET;
import static org.jclouds.aws.reference.AWSConstants.PROPERTY_HEADER_TAG;
import static org.jclouds.providers.AnonymousProviderMetadata.forApiOnEndpoint;
import static org.testng.Assert.assertEquals;
import org.jclouds.ContextBuilder;
@ -25,10 +26,8 @@ import org.jclouds.aws.xml.SessionCredentialsHandlerTest;
import org.jclouds.date.TimeStamp;
import org.jclouds.domain.Credentials;
import org.jclouds.http.HttpRequest;
import org.jclouds.http.IntegrationTestAsyncClient;
import org.jclouds.http.IntegrationTestClient;
import org.jclouds.logging.config.NullLoggingModule;
import org.jclouds.providers.AnonymousProviderMetadata;
import org.jclouds.rest.RequestSigner;
import org.jclouds.rest.internal.BaseRestApiTest.MockModule;
import org.testng.annotations.Test;
@ -36,11 +35,11 @@ import org.testng.annotations.Test;
import com.google.common.base.Suppliers;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMultimap;
import com.google.common.net.HttpHeaders;
import com.google.inject.AbstractModule;
import com.google.inject.Injector;
import com.google.inject.Module;
import com.google.inject.name.Names;
import com.google.common.net.HttpHeaders;
/**
* Tests behavior of {@code FormSigner}
*/
@ -50,9 +49,7 @@ import com.google.common.net.HttpHeaders;
public class FormSignerTest {
public static Injector injector(Credentials creds) {
return ContextBuilder
.newBuilder(
AnonymousProviderMetadata.forClientMappedToAsyncClientOnEndpoint(IntegrationTestClient.class,
IntegrationTestAsyncClient.class, "http://localhost"))
.newBuilder(forApiOnEndpoint(IntegrationTestClient.class, "http://localhost"))
.credentialsSupplier(Suppliers.<Credentials> ofInstance(creds)).apiVersion("apiVersion")
.modules(ImmutableList.<Module> of(new MockModule(), new NullLoggingModule(), new AbstractModule() {
@Override