diff --git a/demos/perftest/pom.xml b/demos/perftest/pom.xml index 0852d22744..21e4b824dc 100644 --- a/demos/perftest/pom.xml +++ b/demos/perftest/pom.xml @@ -1,168 +1,181 @@ - - - 4.0.0 - - org.jclouds - aws-common-project - 1.0-SNAPSHOT - - aws-common-perftest - jclouds Performance test verses Amazon SDK implementation - Performance test verses Amazon SDK implementation - - - YOUR_APPENGINE_HOME - 100 - ${test.aws.identity} - ${test.aws.credential} - org.jclouds.s3.blobstore.integration.S3TestInitializer - - - - - ${project.groupId} - jclouds-apachehc - ${project.version} - - - org.jclouds.api - s3 - ${project.version} - - - com.amazonaws - aws-java-sdk - 1.1.1 - - - net.java.dev.jets3t - jets3t - 0.8.0 - - - org.jclouds.driver - jclouds-enterprise - ${project.version} - - - org.jclouds.driver - jclouds-apachehc - ${project.version} - - - org.jclouds.driver - jclouds-gae - ${project.version} - - - org.jclouds.api - s3 - ${project.version} - test-jar - test - - - - com.google.appengine - appengine-api-stubs - 1.3.5 - test - - - com.google.appengine - appengine-testing - 1.3.5 - test - - - com.google.appengine - appengine-local-runtime - 1.3.5 - test - - - ${project.groupId} - jclouds-core - ${project.version} - test-jar - test - - - - org.apache.geronimo.specs - geronimo-servlet_2.5_spec - 1.2 - test - - - - - - scm:svn:http://jclouds.googlecode.com/svn/trunk - scm:svn:https://jclouds.googlecode.com/svn/trunk - http://jclouds.googlecode.com/svn/trunk - - - - - - maven-surefire-plugin - - - integration - integration-test - - test - - - 1 - - - test.s3.identity - ${test.s3.identity} - - - test.s3.credential - ${test.s3.credential} - - - test.initializer - ${test.initializer} - - - test.s3.loopcount - ${test.s3.loopcount} - - - - - - - - + http://www.apache.org/licenses/LICENSE-2.0 Unless required by + applicable law or agreed to in writing, software distributed under the + License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + CONDITIONS OF ANY KIND, either express or implied. See the License for + the specific language governing permissions and limitations under the + License. + ==================================================================== + --> + + 4.0.0 + + org.jclouds + jclouds-project + 1.0-SNAPSHOT + ../../project/pom.xml + + s3-perftest + jclouds Performance test verses Amazon SDK implementation + Performance test verses Amazon SDK implementation + + 100 + ${test.aws.identity} + ${test.aws.credential} + org.jclouds.aws.s3.blobstore.integration.AWSS3TestInitializer + 1.0-SNAPSHOT + 1.4.0 + + + + + jclouds-sona-snapshots-nexus + https://oss.sonatype.org/content/repositories/snapshots + + false + + + true + + + + + + org.jclouds.provider + aws-s3 + ${jclouds.version} + + + com.amazonaws + aws-java-sdk + 1.1.9 + + + net.java.dev.jets3t + jets3t + 0.8.0 + + + org.jclouds.driver + jclouds-enterprise + ${jclouds.version} + + + org.jclouds.driver + jclouds-log4j + ${jclouds.version} + + + org.jclouds.driver + jclouds-apachehc + ${jclouds.version} + + + org.jclouds.driver + jclouds-gae + ${jclouds.version} + + + com.google.appengine + appengine-tools-sdk + ${gae.version} + system + ${env.APPENGINE_HOME}/lib/appengine-tools-api.jar + + + org.jclouds + jclouds-core + ${jclouds.version} + test-jar + test + + + org.jclouds + jclouds-blobstore + ${jclouds.version} + test-jar + test + + + org.jclouds.api + s3 + ${jclouds.version} + test-jar + test + + + org.jclouds.provider + aws-s3 + ${jclouds.version} + test-jar + test + + + + com.google.appengine + appengine-tools-sdk + ${gae.version} + system + ${env.APPENGINE_HOME}/lib/appengine-tools-api.jar + + + com.google.appengine + appengine-api-stubs + ${gae.version} + test + + + com.google.appengine + appengine-testing + ${gae.version} + test + + + + + + maven-surefire-plugin + + + integration + integration-test + + test + + + 1 + + + test.aws-s3.identity + ${test.aws-s3.identity} + + + test.aws-s3.credential + ${test.aws-s3.credential} + + + test.initializer + ${test.initializer} + + + test.aws-s3.loopcount + ${test.aws-s3.loopcount} + + + + + + + + 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 bd889d1a28..2458b70440 100755 --- a/demos/perftest/src/test/java/org/jclouds/aws/s3/AmazonPerformanceLiveTest.java +++ b/demos/perftest/src/test/java/org/jclouds/aws/s3/AmazonPerformanceLiveTest.java @@ -50,8 +50,8 @@ public class AmazonPerformanceLiveTest extends BasePerformanceLiveTest { public void setUpResourcesOnThisThread(ITestContext testContext) throws Exception { super.setUpResourcesOnThisThread(testContext); exec = Executors.newCachedThreadPool(); - s3 = new AmazonS3Client(new BasicAWSCredentials(System.getProperty("test.s3.identity"), - System.getProperty("test.s3.credential"))); + s3 = new AmazonS3Client(new BasicAWSCredentials(System.getProperty("test.aws-s3.identity"), + System.getProperty("test.aws-s3.credential"))); } @Override diff --git a/demos/perftest/src/test/java/org/jclouds/aws/s3/BaseJCloudsPerformanceLiveTest.java b/demos/perftest/src/test/java/org/jclouds/aws/s3/BaseJCloudsPerformanceLiveTest.java index 5c01cab67e..1d543d64be 100644 --- a/demos/perftest/src/test/java/org/jclouds/aws/s3/BaseJCloudsPerformanceLiveTest.java +++ b/demos/perftest/src/test/java/org/jclouds/aws/s3/BaseJCloudsPerformanceLiveTest.java @@ -30,7 +30,8 @@ import java.io.InputStream; import java.util.Properties; import java.util.concurrent.Future; -import org.jclouds.aws.s3.domain.S3Object; +import org.jclouds.s3.S3AsyncClient; +import org.jclouds.s3.domain.S3Object; import com.google.common.base.Throwables; @@ -59,7 +60,7 @@ public abstract class BaseJCloudsPerformanceLiveTest extends BasePerformanceLive // } protected void overrideWithSysPropertiesAndPrint(Properties overrides, String contextName) { overrides.putAll(System.getProperties()); - System.out.printf("%s: loopCount(%s), perContext(%s), perHost(%s),ioWorkers(%s), userThreads(%s)%n", contextName, + System.out.printf("%s: loopCount(%s), perContext(%s), perHost(%s), ioWorkers(%s), userThreads(%s)%n", contextName, loopCount, overrides.getProperty(PROPERTY_MAX_CONNECTIONS_PER_CONTEXT), overrides .getProperty(PROPERTY_MAX_CONNECTIONS_PER_HOST), overrides.getProperty(PROPERTY_IO_WORKER_THREADS), overrides.getProperty(PROPERTY_USER_THREADS)); 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 545028f7c4..e4c0eda138 100755 --- a/demos/perftest/src/test/java/org/jclouds/aws/s3/BasePerformanceLiveTest.java +++ b/demos/perftest/src/test/java/org/jclouds/aws/s3/BasePerformanceLiveTest.java @@ -51,7 +51,7 @@ public abstract class BasePerformanceLiveTest extends BaseBlobStoreIntegrationTe containerCount = 1; } protected int timeoutSeconds = 15; - protected int loopCount = Integer.parseInt(System.getProperty("test.s3.loopcount", "1000")); + protected int loopCount = Integer.parseInt(System.getProperty("test.aws-s3.loopcount", "1000")); protected ExecutorService exec; protected Logger logger = Logger.NULL;; @@ -141,13 +141,13 @@ public abstract class BasePerformanceLiveTest extends BaseBlobStoreIntegrationTe } private void doParallel(Provider> provider, int loopCount, String containerName) - throws InterruptedException, ExecutionException, TimeoutException { + throws InterruptedException, ExecutionException, TimeoutException { Map> responses = Maps.newHashMap(); for (int i = 0; i < loopCount; i++) responses.put(i, provider.get()); Map exceptions = awaitCompletion(responses, exec, null, Logger.NULL, String.format( - "putting into containerName: %s", containerName)); + "putting into containerName: %s", containerName)); assert exceptions.size() == 0 : exceptions; @@ -164,13 +164,13 @@ public abstract class BasePerformanceLiveTest extends BaseBlobStoreIntegrationTe public ListenableFuture get() { return Futures.makeListenable(putByteArray(bucketName, key.getAndIncrement() + "", test, - "application/octetstring")); + "application/octetstring")); } } class PutFileFuture implements Provider> { final AtomicInteger key = new AtomicInteger(0); - protected File file = new File("pom.xml"); + protected File file = new File(getClass().getResource("/testimg.png").getFile()); private final String bucketName; public PutFileFuture(String bucketName) { @@ -195,7 +195,7 @@ public abstract class BasePerformanceLiveTest extends BaseBlobStoreIntegrationTe public ListenableFuture get() { return Futures.makeListenable(putInputStream(bucketName, key.getAndIncrement() + "", new ByteArrayInputStream( - test), "application/octetstring")); + test), "application/octetstring")); } } diff --git a/demos/perftest/src/test/java/org/jclouds/aws/s3/JCloudsApacheHCPerformanceLiveTest.java b/demos/perftest/src/test/java/org/jclouds/aws/s3/JCloudsApacheHCPerformanceLiveTest.java index a72c965014..4477aec933 100644 --- a/demos/perftest/src/test/java/org/jclouds/aws/s3/JCloudsApacheHCPerformanceLiveTest.java +++ b/demos/perftest/src/test/java/org/jclouds/aws/s3/JCloudsApacheHCPerformanceLiveTest.java @@ -33,6 +33,7 @@ import org.jclouds.blobstore.BlobStoreContextFactory; import org.jclouds.enterprise.config.EnterpriseConfigurationModule; import org.jclouds.http.apachehc.config.ApacheHCHttpCommandExecutorServiceModule; import org.jclouds.logging.config.NullLoggingModule; +import org.jclouds.s3.S3AsyncClient; import org.testng.ITestContext; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; @@ -46,8 +47,8 @@ public class JCloudsApacheHCPerformanceLiveTest extends BaseJCloudsPerformanceLi @BeforeClass(groups = { "integration", "live" }) public void setUpResourcesOnThisThread(ITestContext testContext) throws Exception { exec = Executors.newCachedThreadPool(); - String accesskeyid = System.getProperty("test.s3.identity"); - String secretkey = System.getProperty("test.s3.credential"); + String accesskeyid = System.getProperty("test.aws-s3.identity"); + String secretkey = System.getProperty("test.aws-s3.credential"); Properties overrides = new Properties(); overrides.setProperty(PROPERTY_SO_TIMEOUT, 5000 + ""); overrides.setProperty(PROPERTY_CONNECTION_TIMEOUT, 5000 + ""); @@ -57,7 +58,7 @@ public class JCloudsApacheHCPerformanceLiveTest extends BaseJCloudsPerformanceLi overrides.setProperty(PROPERTY_USER_THREADS, 0 + ""); String contextName = "enterprise"; overrideWithSysPropertiesAndPrint(overrides, contextName); - context = new BlobStoreContextFactory().createContext("s3", accesskeyid, secretkey, ImmutableSet.of( + context = new BlobStoreContextFactory().createContext("aws-s3", accesskeyid, secretkey, ImmutableSet.of( new NullLoggingModule(), new ApacheHCHttpCommandExecutorServiceModule(), new EnterpriseConfigurationModule()), overrides); } diff --git a/demos/perftest/src/test/java/org/jclouds/aws/s3/JCloudsGaePerformanceLiveTest.java b/demos/perftest/src/test/java/org/jclouds/aws/s3/JCloudsGaePerformanceLiveTest.java index d1479e06e7..76a35dd198 100755 --- a/demos/perftest/src/test/java/org/jclouds/aws/s3/JCloudsGaePerformanceLiveTest.java +++ b/demos/perftest/src/test/java/org/jclouds/aws/s3/JCloudsGaePerformanceLiveTest.java @@ -30,6 +30,7 @@ import org.jclouds.blobstore.BlobStoreContext; import org.jclouds.blobstore.BlobStoreContextFactory; import org.jclouds.gae.config.GoogleAppEngineConfigurationModule; import org.jclouds.logging.config.NullLoggingModule; +import org.jclouds.s3.S3AsyncClient; import org.testng.annotations.AfterClass; import org.testng.annotations.BeforeClass; import org.testng.annotations.BeforeMethod; @@ -143,7 +144,7 @@ public class JCloudsGaePerformanceLiveTest extends BaseJCloudsPerformanceLiveTes Properties overrides = new Properties(); String contextName = "gae"; overrideWithSysPropertiesAndPrint(overrides, contextName); - context = new BlobStoreContextFactory().createContext("s3", accesskeyid, secretkey, ImmutableSet.of( + context = new BlobStoreContextFactory().createContext("aws-s3", accesskeyid, secretkey, ImmutableSet.of( new NullLoggingModule(), new GoogleAppEngineConfigurationModule()), overrides); } diff --git a/demos/perftest/src/test/java/org/jclouds/aws/s3/JCloudsPerformanceLiveTest.java b/demos/perftest/src/test/java/org/jclouds/aws/s3/JCloudsPerformanceLiveTest.java index 32e5e1ed44..1e62d41b11 100755 --- a/demos/perftest/src/test/java/org/jclouds/aws/s3/JCloudsPerformanceLiveTest.java +++ b/demos/perftest/src/test/java/org/jclouds/aws/s3/JCloudsPerformanceLiveTest.java @@ -30,6 +30,7 @@ import java.util.concurrent.Executors; import org.jclouds.blobstore.BlobStoreContextFactory; import org.jclouds.enterprise.config.EnterpriseConfigurationModule; import org.jclouds.logging.config.NullLoggingModule; +import org.jclouds.s3.S3AsyncClient; import org.testng.ITestContext; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; @@ -49,8 +50,8 @@ public class JCloudsPerformanceLiveTest extends BaseJCloudsPerformanceLiveTest { @BeforeClass(groups = { "integration", "live" }) public void setUpResourcesOnThisThread(ITestContext testContext) throws Exception { exec = Executors.newCachedThreadPool(); - String accesskeyid = System.getProperty("test.s3.identity"); - String secretkey = System.getProperty("test.s3.credential"); + String accesskeyid = System.getProperty("test.aws-s3.identity"); + String secretkey = System.getProperty("test.aws-s3.credential"); Properties overrides = new Properties(); overrides.setProperty(PROPERTY_MAX_CONNECTIONS_PER_CONTEXT, 50 + ""); overrides.setProperty(PROPERTY_MAX_CONNECTIONS_PER_HOST, 30 + ""); @@ -58,7 +59,7 @@ public class JCloudsPerformanceLiveTest extends BaseJCloudsPerformanceLiveTest { overrides.setProperty(PROPERTY_USER_THREADS, 0 + ""); String contextName = "standard"; overrideWithSysPropertiesAndPrint(overrides, contextName); - context = new BlobStoreContextFactory().createContext("s3", accesskeyid, secretkey, ImmutableSet.of( + context = new BlobStoreContextFactory().createContext("aws-s3", accesskeyid, secretkey, ImmutableSet.of( new NullLoggingModule(), new EnterpriseConfigurationModule()), overrides); } 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 51e15e5d31..8bd4215068 100755 --- a/demos/perftest/src/test/java/org/jclouds/aws/s3/Jets3tPerformanceLiveTest.java +++ b/demos/perftest/src/test/java/org/jclouds/aws/s3/Jets3tPerformanceLiveTest.java @@ -49,8 +49,8 @@ public class Jets3tPerformanceLiveTest extends BasePerformanceLiveTest { public void setUpResourcesOnThisThread(ITestContext testContext) throws Exception { super.setUpResourcesOnThisThread(testContext); exec = Executors.newCachedThreadPool(); - jetClient = new RestS3Service(new AWSCredentials(System.getProperty("test.s3.identity"), - System.getProperty("test.s3.credential"))); + jetClient = new RestS3Service(new AWSCredentials(System.getProperty("test.aws-s3.identity"), + System.getProperty("test.aws-s3.credential"))); } @Override diff --git a/demos/perftest/src/test/resources/testimg.png b/demos/perftest/src/test/resources/testimg.png new file mode 100644 index 0000000000..9205c47587 Binary files /dev/null and b/demos/perftest/src/test/resources/testimg.png differ