Cleaned up some of the "sandbox" tests (updated group IDs, versions, deprecated code etc.)

This commit is contained in:
Andrew Phillips 2011-12-07 15:56:18 -05:00
parent bcc4f8fa53
commit 03db8b0d45
9 changed files with 41 additions and 46 deletions

View File

@ -24,7 +24,7 @@
<parent> <parent>
<groupId>org.jclouds</groupId> <groupId>org.jclouds</groupId>
<artifactId>jclouds-demos-project</artifactId> <artifactId>jclouds-demos-project</artifactId>
<version>1.0-SNAPSHOT</version> <version>1.3.0-SNAPSHOT</version>
</parent> </parent>
<artifactId>jclouds-demo-getpath</artifactId> <artifactId>jclouds-demo-getpath</artifactId>
<name>jclouds getpath</name> <name>jclouds getpath</name>

View File

@ -24,7 +24,7 @@
<parent> <parent>
<groupId>org.jclouds</groupId> <groupId>org.jclouds</groupId>
<artifactId>jclouds-demos-project</artifactId> <artifactId>jclouds-demos-project</artifactId>
<version>1.0-SNAPSHOT</version> <version>1.3.0-SNAPSHOT</version>
</parent> </parent>
<artifactId>jclouds-demo-perftest</artifactId> <artifactId>jclouds-demo-perftest</artifactId>
<name>jclouds Performance test verses Amazon SDK implementation</name> <name>jclouds Performance test verses Amazon SDK implementation</name>
@ -36,7 +36,7 @@
<test.aws-s3.credential>${test.aws.credential}</test.aws-s3.credential> <test.aws-s3.credential>${test.aws.credential}</test.aws-s3.credential>
<test.initializer>org.jclouds.aws.s3.blobstore.integration.AWSS3TestInitializer</test.initializer> <test.initializer>org.jclouds.aws.s3.blobstore.integration.AWSS3TestInitializer</test.initializer>
<jclouds.version>1.0-SNAPSHOT</jclouds.version> <jclouds.version>1.0-SNAPSHOT</jclouds.version>
<gae.version>1.4.3</gae.version> <appengine.sdk.version>1.4.3</appengine.sdk.version>
</properties> </properties>
<dependencies> <dependencies>
@ -70,13 +70,6 @@
<artifactId>jclouds-gae</artifactId> <artifactId>jclouds-gae</artifactId>
<version>${jclouds.version}</version> <version>${jclouds.version}</version>
</dependency> </dependency>
<dependency>
<groupId>com.google.appengine</groupId>
<artifactId>appengine-tools-sdk</artifactId>
<version>${gae.version}</version>
<scope>system</scope>
<systemPath>${appengine.home}/lib/appengine-tools-api.jar</systemPath>
</dependency>
<dependency> <dependency>
<groupId>org.jclouds</groupId> <groupId>org.jclouds</groupId>
<artifactId>jclouds-blobstore</artifactId> <artifactId>jclouds-blobstore</artifactId>
@ -102,20 +95,19 @@
<dependency> <dependency>
<groupId>com.google.appengine</groupId> <groupId>com.google.appengine</groupId>
<artifactId>appengine-tools-sdk</artifactId> <artifactId>appengine-tools-sdk</artifactId>
<version>${gae.version}</version> <version>${appengine.sdk.version}</version>
<scope>system</scope> <scope>test</scope>
<systemPath>${appengine.home}/lib/appengine-tools-api.jar</systemPath>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.google.appengine</groupId> <groupId>com.google.appengine</groupId>
<artifactId>appengine-api-stubs</artifactId> <artifactId>appengine-api-stubs</artifactId>
<version>${gae.version}</version> <version>${appengine.sdk.version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.google.appengine</groupId> <groupId>com.google.appengine</groupId>
<artifactId>appengine-testing</artifactId> <artifactId>appengine-testing</artifactId>
<version>${gae.version}</version> <version>${appengine.sdk.version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
</dependencies> </dependencies>

View File

@ -65,13 +65,12 @@ public class AmazonPerformanceLiveTest extends BasePerformanceLiveTest {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
@SuppressWarnings("unchecked")
@Override @Override
protected Future<?> putByteArray(final String bucket, final String key, final byte[] data, final String contentType) { 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<String>() {
@Override @Override
public Object call() throws Exception { public String call() throws Exception {
ObjectMetadata md = new ObjectMetadata(); ObjectMetadata md = new ObjectMetadata();
md.setContentType(contentType); md.setContentType(contentType);
md.setContentLength(data.length); md.setContentLength(data.length);
@ -80,26 +79,24 @@ public class AmazonPerformanceLiveTest extends BasePerformanceLiveTest {
}); });
} }
@SuppressWarnings("unchecked")
@Override @Override
protected Future<?> putFile(final String bucket, final String key, final File data, String contentType) { protected Future<?> putFile(final String bucket, final String key, final File data, String contentType) {
return exec.submit(new Callable() { return exec.submit(new Callable<String>() {
@Override @Override
public Object call() throws Exception { public String call() throws Exception {
return s3.putObject(new PutObjectRequest(bucket, key, data)).getETag(); return s3.putObject(new PutObjectRequest(bucket, key, data)).getETag();
} }
}); });
} }
@SuppressWarnings("unchecked")
@Override @Override
protected Future<?> putInputStream(final String bucket, final String key, final InputStream data, protected Future<?> putInputStream(final String bucket, final String key, final InputStream data,
final String contentType) { final String contentType) {
return exec.submit(new Callable() { return exec.submit(new Callable<String>() {
@Override @Override
public Object call() throws Exception { public String call() throws Exception {
ObjectMetadata md = new ObjectMetadata(); ObjectMetadata md = new ObjectMetadata();
md.setContentType(contentType); md.setContentType(contentType);
md.setContentLength(data.available()); md.setContentLength(data.available());

View File

@ -37,7 +37,7 @@ import org.jclouds.logging.Logger;
import org.testng.annotations.Test; import org.testng.annotations.Test;
import com.google.common.collect.Maps; 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; import com.google.common.util.concurrent.ListenableFuture;
/** /**
@ -162,7 +162,7 @@ public abstract class BasePerformanceLiveTest extends BaseBlobStoreIntegrationTe
} }
public ListenableFuture<?> get() { public ListenableFuture<?> get() {
return Futures.makeListenable(putByteArray(bucketName, key.getAndIncrement() + "", test, return JdkFutureAdapters.listenInPoolThread(putByteArray(bucketName, key.getAndIncrement() + "", test,
"application/octetstring")); "application/octetstring"));
} }
} }
@ -177,7 +177,7 @@ public abstract class BasePerformanceLiveTest extends BaseBlobStoreIntegrationTe
} }
public ListenableFuture<?> get() { 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 @Override
public ListenableFuture<?> get() { public ListenableFuture<?> get() {
return Futures.makeListenable(putInputStream(bucketName, key.getAndIncrement() + "", new ByteArrayInputStream( return JdkFutureAdapters.listenInPoolThread(putInputStream(bucketName, key.getAndIncrement() + "", new ByteArrayInputStream(
test), "application/octetstring")); test), "application/octetstring"));
} }
@ -209,7 +209,7 @@ public abstract class BasePerformanceLiveTest extends BaseBlobStoreIntegrationTe
} }
public ListenableFuture<?> get() { public ListenableFuture<?> get() {
return Futures.makeListenable(putString(bucketName, key.getAndIncrement() + "", testString, "text/plain")); return JdkFutureAdapters.listenInPoolThread(putString(bucketName, key.getAndIncrement() + "", testString, "text/plain"));
} }
} }

View File

@ -28,6 +28,7 @@ import java.util.concurrent.Future;
import org.jets3t.service.S3Service; import org.jets3t.service.S3Service;
import org.jets3t.service.impl.rest.httpclient.RestS3Service; import org.jets3t.service.impl.rest.httpclient.RestS3Service;
import org.jets3t.service.model.S3Object;
import org.jets3t.service.security.AWSCredentials; import org.jets3t.service.security.AWSCredentials;
import org.testng.ITestContext; import org.testng.ITestContext;
import org.testng.annotations.BeforeClass; import org.testng.annotations.BeforeClass;
@ -95,23 +96,21 @@ public class Jets3tPerformanceLiveTest extends BasePerformanceLiveTest {
} }
@SuppressWarnings("unchecked")
@Override @Override
protected Future<?> putFile(final String bucket, String key, File data, String contentType) { 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); final org.jets3t.service.model.S3Object object = new org.jets3t.service.model.S3Object(key);
object.setContentType(contentType); object.setContentType(contentType);
object.setDataInputFile(data); object.setDataInputFile(data);
object.setContentLength(data.length()); object.setContentLength(data.length());
return exec.submit(new Callable() { return exec.submit(new Callable<S3Object>() {
@Override @Override
public Object call() throws Exception { public S3Object call() throws Exception {
return jetClient.putObject(bucket, object); return jetClient.putObject(bucket, object);
} }
}); });
} }
@SuppressWarnings("unchecked")
@Override @Override
protected Future<?> putInputStream(final String bucket, String key, InputStream data, String contentType) { 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); 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) { } catch (IOException e) {
Throwables.propagate(e); Throwables.propagate(e);
} }
return exec.submit(new Callable() { return exec.submit(new Callable<S3Object>() {
@Override @Override
public Object call() throws Exception { public S3Object call() throws Exception {
return jetClient.putObject(bucket, object); return jetClient.putObject(bucket, object);
} }
}); });

View File

@ -24,7 +24,7 @@
<parent> <parent>
<groupId>org.jclouds</groupId> <groupId>org.jclouds</groupId>
<artifactId>jclouds-demos-project</artifactId> <artifactId>jclouds-demos-project</artifactId>
<version>1.0-SNAPSHOT</version> <version>1.3.0-SNAPSHOT</version>
</parent> </parent>
<artifactId>jclouds-demo-simpledb</artifactId> <artifactId>jclouds-demo-simpledb</artifactId>
<name>jclouds simpledb sample that putAttributes and select it</name> <name>jclouds simpledb sample that putAttributes and select it</name>
@ -32,8 +32,8 @@
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>org.jclouds.api</groupId> <groupId>org.jclouds.provider</groupId>
<artifactId>simpledb</artifactId> <artifactId>aws-simpledb</artifactId>
<version>${project.version}</version> <version>${project.version}</version>
</dependency> </dependency>
</dependencies> </dependencies>

View File

@ -24,7 +24,7 @@
<parent> <parent>
<groupId>org.jclouds</groupId> <groupId>org.jclouds</groupId>
<artifactId>jclouds-demos-project</artifactId> <artifactId>jclouds-demos-project</artifactId>
<version>1.0-SNAPSHOT</version> <version>1.3.0-SNAPSHOT</version>
</parent> </parent>
<artifactId>jclouds-demo-speedtest-azurequeue</artifactId> <artifactId>jclouds-demo-speedtest-azurequeue</artifactId>
<name>Speed tests of Azure's queue offering</name> <name>Speed tests of Azure's queue offering</name>
@ -32,13 +32,13 @@
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>${project.groupId}</groupId> <groupId>org.jclouds.driver</groupId>
<artifactId>jclouds-enterprise</artifactId> <artifactId>jclouds-enterprise</artifactId>
<version>${project.version}</version> <version>${project.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>${project.groupId}</groupId> <groupId>org.jclouds.provider</groupId>
<artifactId>jclouds-azure</artifactId> <artifactId>azurequeue</artifactId>
<version>${project.version}</version> <version>${project.version}</version>
</dependency> </dependency>
</dependencies> </dependencies>

View File

@ -24,7 +24,7 @@
<parent> <parent>
<groupId>org.jclouds</groupId> <groupId>org.jclouds</groupId>
<artifactId>jclouds-demos-project</artifactId> <artifactId>jclouds-demos-project</artifactId>
<version>1.0-SNAPSHOT</version> <version>1.3.0-SNAPSHOT</version>
</parent> </parent>
<artifactId>jclouds-demo-speedtest-sqs</artifactId> <artifactId>jclouds-demo-speedtest-sqs</artifactId>
<name>Speed tests of SQS across regions</name> <name>Speed tests of SQS across regions</name>
@ -32,7 +32,12 @@
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>${project.groupId}</groupId> <groupId>org.jclouds.api</groupId>
<artifactId>sqs</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.jclouds.driver</groupId>
<artifactId>jclouds-enterprise</artifactId> <artifactId>jclouds-enterprise</artifactId>
<version>${project.version}</version> <version>${project.version}</version>
</dependency> </dependency>

View File

@ -18,8 +18,8 @@
*/ */
package org.jclouds.aws.sqs; 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.concurrent.FutureIterables.awaitCompletion;
import static org.jclouds.sqs.options.ListQueuesOptions.Builder.queuePrefix;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
@ -27,7 +27,6 @@ import java.util.SortedSet;
import java.util.concurrent.Future; import java.util.concurrent.Future;
import org.jclouds.aws.domain.Region; import org.jclouds.aws.domain.Region;
import org.jclouds.aws.sqs.domain.Queue;
import org.jclouds.concurrent.MoreExecutors; import org.jclouds.concurrent.MoreExecutors;
import org.jclouds.enterprise.config.EnterpriseConfigurationModule; import org.jclouds.enterprise.config.EnterpriseConfigurationModule;
import org.jclouds.logging.ConsoleLogger; import org.jclouds.logging.ConsoleLogger;
@ -35,6 +34,9 @@ import org.jclouds.logging.Logger;
import org.jclouds.logging.config.NullLoggingModule; import org.jclouds.logging.config.NullLoggingModule;
import org.jclouds.rest.RestContext; import org.jclouds.rest.RestContext;
import org.jclouds.rest.RestContextFactory; 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.ImmutableSet;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;