From 03db8b0d4569640a30761ee0f75d4579b6716825 Mon Sep 17 00:00:00 2001 From: Andrew Phillips Date: Wed, 7 Dec 2011 15:56:18 -0500 Subject: [PATCH] Cleaned up some of the "sandbox" tests (updated group IDs, versions, deprecated code etc.) --- demos/getpath/pom.xml | 2 +- demos/perftest/pom.xml | 20 ++++++------------- .../aws/s3/AmazonPerformanceLiveTest.java | 15 ++++++-------- .../aws/s3/BasePerformanceLiveTest.java | 10 +++++----- .../aws/s3/Jets3tPerformanceLiveTest.java | 11 +++++----- demos/simpledb/pom.xml | 6 +++--- demos/speedtest-azurequeue/pom.xml | 8 ++++---- demos/speedtest-sqs/pom.xml | 9 +++++++-- .../java/org/jclouds/aws/sqs/SpeedTest.java | 6 ++++-- 9 files changed, 41 insertions(+), 46 deletions(-) diff --git a/demos/getpath/pom.xml b/demos/getpath/pom.xml index 1ed7b32d4e..821da7952f 100644 --- a/demos/getpath/pom.xml +++ b/demos/getpath/pom.xml @@ -24,7 +24,7 @@ org.jclouds jclouds-demos-project - 1.0-SNAPSHOT + 1.3.0-SNAPSHOT jclouds-demo-getpath jclouds getpath diff --git a/demos/perftest/pom.xml b/demos/perftest/pom.xml index 61fdbb4bf0..3d34ddf325 100644 --- a/demos/perftest/pom.xml +++ b/demos/perftest/pom.xml @@ -24,7 +24,7 @@ org.jclouds jclouds-demos-project - 1.0-SNAPSHOT + 1.3.0-SNAPSHOT jclouds-demo-perftest jclouds Performance test verses Amazon SDK implementation @@ -36,7 +36,7 @@ ${test.aws.credential} org.jclouds.aws.s3.blobstore.integration.AWSS3TestInitializer 1.0-SNAPSHOT - 1.4.3 + 1.4.3 @@ -70,13 +70,6 @@ jclouds-gae ${jclouds.version} - - com.google.appengine - appengine-tools-sdk - ${gae.version} - system - ${appengine.home}/lib/appengine-tools-api.jar - org.jclouds jclouds-blobstore @@ -102,20 +95,19 @@ com.google.appengine appengine-tools-sdk - ${gae.version} - system - ${appengine.home}/lib/appengine-tools-api.jar + ${appengine.sdk.version} + test com.google.appengine appengine-api-stubs - ${gae.version} + ${appengine.sdk.version} test com.google.appengine appengine-testing - ${gae.version} + ${appengine.sdk.version} test diff --git a/demos/perftest/src/test/java/org/jclouds/aws/s3/AmazonPerformanceLiveTest.java b/demos/perftest/src/test/java/org/jclouds/aws/s3/AmazonPerformanceLiveTest.java index 79b8c25c58..da9ee4ed29 100644 --- a/demos/perftest/src/test/java/org/jclouds/aws/s3/AmazonPerformanceLiveTest.java +++ b/demos/perftest/src/test/java/org/jclouds/aws/s3/AmazonPerformanceLiveTest.java @@ -65,13 +65,12 @@ public class AmazonPerformanceLiveTest extends BasePerformanceLiveTest { throw new UnsupportedOperationException(); } - @SuppressWarnings("unchecked") @Override protected Future putByteArray(final String bucket, final String key, final byte[] data, final String contentType) { - return exec.submit(new Callable() { + return exec.submit(new Callable() { @Override - public Object call() throws Exception { + public String call() throws Exception { ObjectMetadata md = new ObjectMetadata(); md.setContentType(contentType); md.setContentLength(data.length); @@ -80,26 +79,24 @@ public class AmazonPerformanceLiveTest extends BasePerformanceLiveTest { }); } - @SuppressWarnings("unchecked") @Override protected Future putFile(final String bucket, final String key, final File data, String contentType) { - return exec.submit(new Callable() { + return exec.submit(new Callable() { @Override - public Object call() throws Exception { + public String call() throws Exception { return s3.putObject(new PutObjectRequest(bucket, key, data)).getETag(); } }); } - @SuppressWarnings("unchecked") @Override protected Future putInputStream(final String bucket, final String key, final InputStream data, final String contentType) { - return exec.submit(new Callable() { + return exec.submit(new Callable() { @Override - public Object call() throws Exception { + public String call() throws Exception { ObjectMetadata md = new ObjectMetadata(); md.setContentType(contentType); md.setContentLength(data.available()); diff --git a/demos/perftest/src/test/java/org/jclouds/aws/s3/BasePerformanceLiveTest.java b/demos/perftest/src/test/java/org/jclouds/aws/s3/BasePerformanceLiveTest.java index 6e682921df..ab0066d2db 100644 --- a/demos/perftest/src/test/java/org/jclouds/aws/s3/BasePerformanceLiveTest.java +++ b/demos/perftest/src/test/java/org/jclouds/aws/s3/BasePerformanceLiveTest.java @@ -37,7 +37,7 @@ import org.jclouds.logging.Logger; import org.testng.annotations.Test; import com.google.common.collect.Maps; -import com.google.common.util.concurrent.Futures; +import com.google.common.util.concurrent.JdkFutureAdapters; import com.google.common.util.concurrent.ListenableFuture; /** @@ -162,7 +162,7 @@ public abstract class BasePerformanceLiveTest extends BaseBlobStoreIntegrationTe } public ListenableFuture get() { - return Futures.makeListenable(putByteArray(bucketName, key.getAndIncrement() + "", test, + return JdkFutureAdapters.listenInPoolThread(putByteArray(bucketName, key.getAndIncrement() + "", test, "application/octetstring")); } } @@ -177,7 +177,7 @@ public abstract class BasePerformanceLiveTest extends BaseBlobStoreIntegrationTe } public ListenableFuture get() { - return Futures.makeListenable(putFile(bucketName, key.getAndIncrement() + "", file, "text/xml")); + return JdkFutureAdapters.listenInPoolThread(putFile(bucketName, key.getAndIncrement() + "", file, "text/xml")); } } @@ -193,7 +193,7 @@ public abstract class BasePerformanceLiveTest extends BaseBlobStoreIntegrationTe @Override public ListenableFuture get() { - return Futures.makeListenable(putInputStream(bucketName, key.getAndIncrement() + "", new ByteArrayInputStream( + return JdkFutureAdapters.listenInPoolThread(putInputStream(bucketName, key.getAndIncrement() + "", new ByteArrayInputStream( test), "application/octetstring")); } @@ -209,7 +209,7 @@ public abstract class BasePerformanceLiveTest extends BaseBlobStoreIntegrationTe } public ListenableFuture get() { - return Futures.makeListenable(putString(bucketName, key.getAndIncrement() + "", testString, "text/plain")); + return JdkFutureAdapters.listenInPoolThread(putString(bucketName, key.getAndIncrement() + "", testString, "text/plain")); } } diff --git a/demos/perftest/src/test/java/org/jclouds/aws/s3/Jets3tPerformanceLiveTest.java b/demos/perftest/src/test/java/org/jclouds/aws/s3/Jets3tPerformanceLiveTest.java index 17c51c9a0a..7f442a456b 100644 --- a/demos/perftest/src/test/java/org/jclouds/aws/s3/Jets3tPerformanceLiveTest.java +++ b/demos/perftest/src/test/java/org/jclouds/aws/s3/Jets3tPerformanceLiveTest.java @@ -28,6 +28,7 @@ import java.util.concurrent.Future; import org.jets3t.service.S3Service; import org.jets3t.service.impl.rest.httpclient.RestS3Service; +import org.jets3t.service.model.S3Object; import org.jets3t.service.security.AWSCredentials; import org.testng.ITestContext; import org.testng.annotations.BeforeClass; @@ -95,23 +96,21 @@ public class Jets3tPerformanceLiveTest extends BasePerformanceLiveTest { } - @SuppressWarnings("unchecked") @Override protected Future putFile(final String bucket, String key, File data, String contentType) { final org.jets3t.service.model.S3Object object = new org.jets3t.service.model.S3Object(key); object.setContentType(contentType); object.setDataInputFile(data); object.setContentLength(data.length()); - return exec.submit(new Callable() { + return exec.submit(new Callable() { @Override - public Object call() throws Exception { + public S3Object call() throws Exception { return jetClient.putObject(bucket, object); } }); } - @SuppressWarnings("unchecked") @Override protected Future putInputStream(final String bucket, String key, InputStream data, String contentType) { final org.jets3t.service.model.S3Object object = new org.jets3t.service.model.S3Object(key); @@ -122,9 +121,9 @@ public class Jets3tPerformanceLiveTest extends BasePerformanceLiveTest { } catch (IOException e) { Throwables.propagate(e); } - return exec.submit(new Callable() { + return exec.submit(new Callable() { @Override - public Object call() throws Exception { + public S3Object call() throws Exception { return jetClient.putObject(bucket, object); } }); diff --git a/demos/simpledb/pom.xml b/demos/simpledb/pom.xml index 8ba0f69ea1..a3a1dcf64b 100644 --- a/demos/simpledb/pom.xml +++ b/demos/simpledb/pom.xml @@ -24,7 +24,7 @@ org.jclouds jclouds-demos-project - 1.0-SNAPSHOT + 1.3.0-SNAPSHOT jclouds-demo-simpledb jclouds simpledb sample that putAttributes and select it @@ -32,8 +32,8 @@ - org.jclouds.api - simpledb + org.jclouds.provider + aws-simpledb ${project.version} diff --git a/demos/speedtest-azurequeue/pom.xml b/demos/speedtest-azurequeue/pom.xml index d34ec21958..0d8d641b21 100644 --- a/demos/speedtest-azurequeue/pom.xml +++ b/demos/speedtest-azurequeue/pom.xml @@ -24,7 +24,7 @@ org.jclouds jclouds-demos-project - 1.0-SNAPSHOT + 1.3.0-SNAPSHOT jclouds-demo-speedtest-azurequeue Speed tests of Azure's queue offering @@ -32,13 +32,13 @@ - ${project.groupId} + org.jclouds.driver jclouds-enterprise ${project.version} - ${project.groupId} - jclouds-azure + org.jclouds.provider + azurequeue ${project.version} diff --git a/demos/speedtest-sqs/pom.xml b/demos/speedtest-sqs/pom.xml index ed45a4cb57..5be4b60853 100644 --- a/demos/speedtest-sqs/pom.xml +++ b/demos/speedtest-sqs/pom.xml @@ -24,7 +24,7 @@ org.jclouds jclouds-demos-project - 1.0-SNAPSHOT + 1.3.0-SNAPSHOT jclouds-demo-speedtest-sqs Speed tests of SQS across regions @@ -32,7 +32,12 @@ - ${project.groupId} + org.jclouds.api + sqs + ${project.version} + + + org.jclouds.driver jclouds-enterprise ${project.version} diff --git a/demos/speedtest-sqs/src/main/java/org/jclouds/aws/sqs/SpeedTest.java b/demos/speedtest-sqs/src/main/java/org/jclouds/aws/sqs/SpeedTest.java index 9f7b5c469e..7289c14417 100644 --- a/demos/speedtest-sqs/src/main/java/org/jclouds/aws/sqs/SpeedTest.java +++ b/demos/speedtest-sqs/src/main/java/org/jclouds/aws/sqs/SpeedTest.java @@ -18,8 +18,8 @@ */ package org.jclouds.aws.sqs; -import static org.jclouds.aws.sqs.options.ListQueuesOptions.Builder.queuePrefix; import static org.jclouds.concurrent.FutureIterables.awaitCompletion; +import static org.jclouds.sqs.options.ListQueuesOptions.Builder.queuePrefix; import java.util.Map; import java.util.Set; @@ -27,7 +27,6 @@ import java.util.SortedSet; import java.util.concurrent.Future; import org.jclouds.aws.domain.Region; -import org.jclouds.aws.sqs.domain.Queue; import org.jclouds.concurrent.MoreExecutors; import org.jclouds.enterprise.config.EnterpriseConfigurationModule; import org.jclouds.logging.ConsoleLogger; @@ -35,6 +34,9 @@ import org.jclouds.logging.Logger; import org.jclouds.logging.config.NullLoggingModule; import org.jclouds.rest.RestContext; import org.jclouds.rest.RestContextFactory; +import org.jclouds.sqs.SQSAsyncClient; +import org.jclouds.sqs.SQSClient; +import org.jclouds.sqs.domain.Queue; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Maps;