revised test properties in perftest

This commit is contained in:
Adrian Cole 2010-12-27 22:54:49 +01:00
parent dc7914c1f5
commit fe46d0d02a
5 changed files with 25 additions and 34 deletions

View File

@ -34,9 +34,9 @@
extraction of appengine-java-sdk
-->
<appengine.home>YOUR_APPENGINE_HOME</appengine.home>
<jclouds.test.loopcount>100</jclouds.test.loopcount>
<jclouds.test.identity>${test.aws.identity}</jclouds.test.identity>
<jclouds.test.credential>${test.aws.credential}</jclouds.test.credential>
<test.s3.loopcount>100</test.s3.loopcount>
<test.s3.identity>${test.aws.identity}</test.s3.identity>
<test.s3.credential>${test.aws.credential}</test.s3.credential>
<test.initializer>org.jclouds.aws.s3.blobstore.integration.S3TestInitializer</test.initializer>
</properties>
@ -143,20 +143,20 @@
<threadCount>1</threadCount>
<systemProperties>
<property>
<name>jclouds.test.identity</name>
<value>${jclouds.test.identity}</value>
<name>test.s3.identity</name>
<value>${test.s3.identity}</value>
</property>
<property>
<name>jclouds.test.credential</name>
<value>${jclouds.test.credential}</value>
<name>test.s3.credential</name>
<value>${test.s3.credential}</value>
</property>
<property>
<name>test.initializer</name>
<value>${test.initializer}</value>
</property>
<property>
<name>jclouds.test.loopcount</name>
<value>${jclouds.test.loopcount}</value>
<name>test.s3.loopcount</name>
<value>${test.s3.loopcount}</value>
</property>
</systemProperties>
</configuration>

View File

@ -27,7 +27,6 @@ import java.util.concurrent.ExecutionException;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import org.jets3t.service.S3ServiceException;
import org.testng.ITestContext;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
@ -47,15 +46,12 @@ import com.amazonaws.services.s3.model.PutObjectRequest;
public class AmazonPerformanceLiveTest extends BasePerformanceLiveTest {
private AmazonS3 s3;
@BeforeClass(groups = { "live" }, dependsOnMethods = "setUpResourcesOnThisThread")
protected void createLiveS3Context(ITestContext testContext) throws S3ServiceException {
@BeforeClass(groups = { "integration", "live" })
public void setUpResourcesOnThisThread(ITestContext testContext) throws Exception {
super.setUpResourcesOnThisThread(testContext);
exec = Executors.newCachedThreadPool();
if (testContext.getAttribute("jclouds.test.identity") != null) {
s3 = new AmazonS3Client(new BasicAWSCredentials((String) testContext.getAttribute("jclouds.test.identity"),
(String) testContext.getAttribute("jclouds.test.credential")));
} else {
throw new RuntimeException("not configured properly");
}
s3 = new AmazonS3Client(new BasicAWSCredentials(System.getProperty("test.s3.identity"),
System.getProperty("test.s3.credential")));
}
@Override

View File

@ -51,7 +51,7 @@ public abstract class BasePerformanceLiveTest extends BaseBlobStoreIntegrationTe
containerCount = 1;
}
protected int timeoutSeconds = 15;
protected int loopCount = Integer.parseInt(System.getProperty("jclouds.test.loopcount", "1000"));
protected int loopCount = Integer.parseInt(System.getProperty("test.s3.loopcount", "1000"));
protected ExecutorService exec;
protected Logger logger = Logger.NULL;;

View File

@ -49,8 +49,8 @@ public class JCloudsPerformanceLiveTest extends BaseJCloudsPerformanceLiveTest {
@BeforeClass(groups = { "integration", "live" })
public void setUpResourcesOnThisThread(ITestContext testContext) throws Exception {
exec = Executors.newCachedThreadPool();
String accesskeyid = System.getProperty("jclouds.test.identity");
String secretkey = System.getProperty("jclouds.test.credential");
String accesskeyid = System.getProperty("test.s3.identity");
String secretkey = System.getProperty("test.s3.credential");
Properties overrides = new Properties();
overrides.setProperty(PROPERTY_MAX_CONNECTIONS_PER_CONTEXT, 50 + "");
overrides.setProperty(PROPERTY_MAX_CONNECTIONS_PER_HOST, 30 + "");

View File

@ -24,10 +24,10 @@ import java.io.IOException;
import java.io.InputStream;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import org.jets3t.service.S3Service;
import org.jets3t.service.S3ServiceException;
import org.jets3t.service.impl.rest.httpclient.RestS3Service;
import org.jets3t.service.security.AWSCredentials;
import org.testng.ITestContext;
@ -45,16 +45,12 @@ import com.google.appengine.repackaged.com.google.common.base.Throwables;
public class Jets3tPerformanceLiveTest extends BasePerformanceLiveTest {
private S3Service jetClient;
@BeforeClass(groups = { "live" }, dependsOnMethods = "setUpResourcesOnThisThread")
protected void createLiveS3Context(ITestContext testContext) throws S3ServiceException {
if (testContext.getAttribute("jclouds.test.identity") != null) {
AWSCredentials credentials = new AWSCredentials((String) testContext
.getAttribute("jclouds.test.identity"), (String) testContext
.getAttribute("jclouds.test.credential"));
jetClient = new RestS3Service(credentials);
} else {
throw new RuntimeException("not configured properly");
}
@BeforeClass(groups = { "integration", "live" })
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")));
}
@Override
@ -118,8 +114,7 @@ public class Jets3tPerformanceLiveTest extends BasePerformanceLiveTest {
@SuppressWarnings("unchecked")
@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);
object.setContentType(contentType);
object.setDataInputStream(data);