mirror of https://github.com/apache/jclouds.git
revised test properties in perftest
This commit is contained in:
parent
dc7914c1f5
commit
fe46d0d02a
|
@ -34,9 +34,9 @@
|
||||||
extraction of appengine-java-sdk
|
extraction of appengine-java-sdk
|
||||||
-->
|
-->
|
||||||
<appengine.home>YOUR_APPENGINE_HOME</appengine.home>
|
<appengine.home>YOUR_APPENGINE_HOME</appengine.home>
|
||||||
<jclouds.test.loopcount>100</jclouds.test.loopcount>
|
<test.s3.loopcount>100</test.s3.loopcount>
|
||||||
<jclouds.test.identity>${test.aws.identity}</jclouds.test.identity>
|
<test.s3.identity>${test.aws.identity}</test.s3.identity>
|
||||||
<jclouds.test.credential>${test.aws.credential}</jclouds.test.credential>
|
<test.s3.credential>${test.aws.credential}</test.s3.credential>
|
||||||
<test.initializer>org.jclouds.aws.s3.blobstore.integration.S3TestInitializer</test.initializer>
|
<test.initializer>org.jclouds.aws.s3.blobstore.integration.S3TestInitializer</test.initializer>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
|
@ -143,20 +143,20 @@
|
||||||
<threadCount>1</threadCount>
|
<threadCount>1</threadCount>
|
||||||
<systemProperties>
|
<systemProperties>
|
||||||
<property>
|
<property>
|
||||||
<name>jclouds.test.identity</name>
|
<name>test.s3.identity</name>
|
||||||
<value>${jclouds.test.identity}</value>
|
<value>${test.s3.identity}</value>
|
||||||
</property>
|
</property>
|
||||||
<property>
|
<property>
|
||||||
<name>jclouds.test.credential</name>
|
<name>test.s3.credential</name>
|
||||||
<value>${jclouds.test.credential}</value>
|
<value>${test.s3.credential}</value>
|
||||||
</property>
|
</property>
|
||||||
<property>
|
<property>
|
||||||
<name>test.initializer</name>
|
<name>test.initializer</name>
|
||||||
<value>${test.initializer}</value>
|
<value>${test.initializer}</value>
|
||||||
</property>
|
</property>
|
||||||
<property>
|
<property>
|
||||||
<name>jclouds.test.loopcount</name>
|
<name>test.s3.loopcount</name>
|
||||||
<value>${jclouds.test.loopcount}</value>
|
<value>${test.s3.loopcount}</value>
|
||||||
</property>
|
</property>
|
||||||
</systemProperties>
|
</systemProperties>
|
||||||
</configuration>
|
</configuration>
|
||||||
|
|
|
@ -27,7 +27,6 @@ import java.util.concurrent.ExecutionException;
|
||||||
import java.util.concurrent.Executors;
|
import java.util.concurrent.Executors;
|
||||||
import java.util.concurrent.Future;
|
import java.util.concurrent.Future;
|
||||||
|
|
||||||
import org.jets3t.service.S3ServiceException;
|
|
||||||
import org.testng.ITestContext;
|
import org.testng.ITestContext;
|
||||||
import org.testng.annotations.BeforeClass;
|
import org.testng.annotations.BeforeClass;
|
||||||
import org.testng.annotations.Test;
|
import org.testng.annotations.Test;
|
||||||
|
@ -47,15 +46,12 @@ import com.amazonaws.services.s3.model.PutObjectRequest;
|
||||||
public class AmazonPerformanceLiveTest extends BasePerformanceLiveTest {
|
public class AmazonPerformanceLiveTest extends BasePerformanceLiveTest {
|
||||||
private AmazonS3 s3;
|
private AmazonS3 s3;
|
||||||
|
|
||||||
@BeforeClass(groups = { "live" }, dependsOnMethods = "setUpResourcesOnThisThread")
|
@BeforeClass(groups = { "integration", "live" })
|
||||||
protected void createLiveS3Context(ITestContext testContext) throws S3ServiceException {
|
public void setUpResourcesOnThisThread(ITestContext testContext) throws Exception {
|
||||||
|
super.setUpResourcesOnThisThread(testContext);
|
||||||
exec = Executors.newCachedThreadPool();
|
exec = Executors.newCachedThreadPool();
|
||||||
if (testContext.getAttribute("jclouds.test.identity") != null) {
|
s3 = new AmazonS3Client(new BasicAWSCredentials(System.getProperty("test.s3.identity"),
|
||||||
s3 = new AmazonS3Client(new BasicAWSCredentials((String) testContext.getAttribute("jclouds.test.identity"),
|
System.getProperty("test.s3.credential")));
|
||||||
(String) testContext.getAttribute("jclouds.test.credential")));
|
|
||||||
} else {
|
|
||||||
throw new RuntimeException("not configured properly");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -51,7 +51,7 @@ public abstract class BasePerformanceLiveTest extends BaseBlobStoreIntegrationTe
|
||||||
containerCount = 1;
|
containerCount = 1;
|
||||||
}
|
}
|
||||||
protected int timeoutSeconds = 15;
|
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 ExecutorService exec;
|
||||||
protected Logger logger = Logger.NULL;;
|
protected Logger logger = Logger.NULL;;
|
||||||
|
|
||||||
|
|
|
@ -49,8 +49,8 @@ public class JCloudsPerformanceLiveTest extends BaseJCloudsPerformanceLiveTest {
|
||||||
@BeforeClass(groups = { "integration", "live" })
|
@BeforeClass(groups = { "integration", "live" })
|
||||||
public void setUpResourcesOnThisThread(ITestContext testContext) throws Exception {
|
public void setUpResourcesOnThisThread(ITestContext testContext) throws Exception {
|
||||||
exec = Executors.newCachedThreadPool();
|
exec = Executors.newCachedThreadPool();
|
||||||
String accesskeyid = System.getProperty("jclouds.test.identity");
|
String accesskeyid = System.getProperty("test.s3.identity");
|
||||||
String secretkey = System.getProperty("jclouds.test.credential");
|
String secretkey = System.getProperty("test.s3.credential");
|
||||||
Properties overrides = new Properties();
|
Properties overrides = new Properties();
|
||||||
overrides.setProperty(PROPERTY_MAX_CONNECTIONS_PER_CONTEXT, 50 + "");
|
overrides.setProperty(PROPERTY_MAX_CONNECTIONS_PER_CONTEXT, 50 + "");
|
||||||
overrides.setProperty(PROPERTY_MAX_CONNECTIONS_PER_HOST, 30 + "");
|
overrides.setProperty(PROPERTY_MAX_CONNECTIONS_PER_HOST, 30 + "");
|
||||||
|
|
|
@ -24,10 +24,10 @@ import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.util.concurrent.Callable;
|
import java.util.concurrent.Callable;
|
||||||
import java.util.concurrent.ExecutionException;
|
import java.util.concurrent.ExecutionException;
|
||||||
|
import java.util.concurrent.Executors;
|
||||||
import java.util.concurrent.Future;
|
import java.util.concurrent.Future;
|
||||||
|
|
||||||
import org.jets3t.service.S3Service;
|
import org.jets3t.service.S3Service;
|
||||||
import org.jets3t.service.S3ServiceException;
|
|
||||||
import org.jets3t.service.impl.rest.httpclient.RestS3Service;
|
import org.jets3t.service.impl.rest.httpclient.RestS3Service;
|
||||||
import org.jets3t.service.security.AWSCredentials;
|
import org.jets3t.service.security.AWSCredentials;
|
||||||
import org.testng.ITestContext;
|
import org.testng.ITestContext;
|
||||||
|
@ -45,16 +45,12 @@ import com.google.appengine.repackaged.com.google.common.base.Throwables;
|
||||||
public class Jets3tPerformanceLiveTest extends BasePerformanceLiveTest {
|
public class Jets3tPerformanceLiveTest extends BasePerformanceLiveTest {
|
||||||
private S3Service jetClient;
|
private S3Service jetClient;
|
||||||
|
|
||||||
@BeforeClass(groups = { "live" }, dependsOnMethods = "setUpResourcesOnThisThread")
|
@BeforeClass(groups = { "integration", "live" })
|
||||||
protected void createLiveS3Context(ITestContext testContext) throws S3ServiceException {
|
public void setUpResourcesOnThisThread(ITestContext testContext) throws Exception {
|
||||||
if (testContext.getAttribute("jclouds.test.identity") != null) {
|
super.setUpResourcesOnThisThread(testContext);
|
||||||
AWSCredentials credentials = new AWSCredentials((String) testContext
|
exec = Executors.newCachedThreadPool();
|
||||||
.getAttribute("jclouds.test.identity"), (String) testContext
|
jetClient = new RestS3Service(new AWSCredentials(System.getProperty("test.s3.identity"),
|
||||||
.getAttribute("jclouds.test.credential"));
|
System.getProperty("test.s3.credential")));
|
||||||
jetClient = new RestS3Service(credentials);
|
|
||||||
} else {
|
|
||||||
throw new RuntimeException("not configured properly");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -118,8 +114,7 @@ public class Jets3tPerformanceLiveTest extends BasePerformanceLiveTest {
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@Override
|
@Override
|
||||||
protected Future<?> putInputStream(final String bucket, String key, InputStream data,
|
protected Future<?> putInputStream(final String bucket, String key, InputStream data, String contentType) {
|
||||||
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.setDataInputStream(data);
|
object.setDataInputStream(data);
|
||||||
|
|
Loading…
Reference in New Issue