updated perftest to use joda/bouncycastle

git-svn-id: http://jclouds.googlecode.com/svn/trunk@2412 3d8758e0-26b5-11de-8745-db77d3ebf521
This commit is contained in:
adrian.f.cole 2009-12-13 21:42:07 +00:00
parent 01bb58d712
commit 8023ccefff
5 changed files with 54 additions and 9 deletions

View File

@ -48,6 +48,16 @@
<description>Performance test verses Amazon samples implementation</description> <description>Performance test verses Amazon samples implementation</description>
<dependencies> <dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>jclouds-joda</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>jclouds-bouncycastle</artifactId>
<version>${project.version}</version>
</dependency>
<dependency> <dependency>
<groupId>${project.groupId}</groupId> <groupId>${project.groupId}</groupId>
<artifactId>jclouds-aws</artifactId> <artifactId>jclouds-aws</artifactId>

View File

@ -57,7 +57,7 @@ public abstract class BasePerformanceLiveTest extends
containerCount = 1; containerCount = 1;
} }
protected int timeoutSeconds = 15; protected int timeoutSeconds = 15;
protected int loopCount = 1000; protected int loopCount = 100;
protected ExecutorService exec; protected ExecutorService exec;
protected CompletionService<Boolean> completer; protected CompletionService<Boolean> completer;

View File

@ -29,14 +29,16 @@ import java.util.Map;
import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeoutException; import java.util.concurrent.TimeoutException;
import org.jclouds.date.joda.config.JodaDateServiceModule;
import org.jclouds.encryption.bouncycastle.config.BouncyCastleEncryptionServiceModule;
import org.jclouds.gae.config.GaeHttpCommandExecutorServiceModule; import org.jclouds.gae.config.GaeHttpCommandExecutorServiceModule;
import org.jclouds.http.config.ConfiguresHttpCommandExecutorService;
import org.testng.annotations.BeforeMethod; import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test; import org.testng.annotations.Test;
import org.testng.v6.Maps; import org.testng.v6.Maps;
import com.google.appengine.tools.development.ApiProxyLocalImpl; import com.google.appengine.tools.development.ApiProxyLocalImpl;
import com.google.apphosting.api.ApiProxy; import com.google.apphosting.api.ApiProxy;
import com.google.inject.Module;
/** /**
* *
@ -155,6 +157,16 @@ public class JCloudsGaePerformanceLiveTest extends BaseJCloudsPerformanceLiveTes
}); });
} }
@ConfiguresHttpCommandExecutorService
private static final class Module extends GaeHttpCommandExecutorServiceModule {
@Override
protected void configure() {
super.configure();
install(new JodaDateServiceModule());
install(new BouncyCastleEncryptionServiceModule());
}
}
class TestEnvironment implements ApiProxy.Environment { class TestEnvironment implements ApiProxy.Environment {
public String getAppId() { public String getAppId() {
return "Unit Tests"; return "Unit Tests";
@ -198,6 +210,6 @@ public class JCloudsGaePerformanceLiveTest extends BaseJCloudsPerformanceLiveTes
@Override @Override
protected Module createHttpModule() { protected Module createHttpModule() {
return new GaeHttpCommandExecutorServiceModule(); return new Module();
} }
} }

View File

@ -23,16 +23,27 @@
*/ */
package org.jclouds.aws.s3; package org.jclouds.aws.s3;
import org.jclouds.date.joda.config.JodaDateServiceModule;
import org.jclouds.encryption.bouncycastle.config.BouncyCastleEncryptionServiceModule;
import org.jclouds.http.config.ConfiguresHttpCommandExecutorService;
import org.jclouds.http.httpnio.config.NioTransformingHttpCommandExecutorServiceModule; import org.jclouds.http.httpnio.config.NioTransformingHttpCommandExecutorServiceModule;
import org.testng.annotations.Test; import org.testng.annotations.Test;
import com.google.inject.Module;
@Test(sequential = true, testName = "perftest.JCloudsNioPerformanceLiveTest", groups = { "live" }) @Test(sequential = true, testName = "perftest.JCloudsNioPerformanceLiveTest", groups = { "live" })
public class JCloudsNioPerformanceLiveTest extends BaseJCloudsPerformanceLiveTest { public class JCloudsNioPerformanceLiveTest extends BaseJCloudsPerformanceLiveTest {
@ConfiguresHttpCommandExecutorService
private static final class Module extends NioTransformingHttpCommandExecutorServiceModule {
@Override
protected void configure() {
super.configure();
install(new JodaDateServiceModule());
install(new BouncyCastleEncryptionServiceModule());
}
}
@Override @Override
protected Module createHttpModule() { protected Module createHttpModule() {
return new NioTransformingHttpCommandExecutorServiceModule(); return new Module();
} }
} }

View File

@ -22,11 +22,13 @@
* ==================================================================== * ====================================================================
*/ */
package org.jclouds.aws.s3; package org.jclouds.aws.s3;
import org.jclouds.date.joda.config.JodaDateServiceModule;
import org.jclouds.encryption.bouncycastle.config.BouncyCastleEncryptionServiceModule;
import org.jclouds.http.config.ConfiguresHttpCommandExecutorService;
import org.jclouds.http.config.JavaUrlHttpCommandExecutorServiceModule; import org.jclouds.http.config.JavaUrlHttpCommandExecutorServiceModule;
import org.testng.annotations.Test; import org.testng.annotations.Test;
import com.google.inject.Module;
/** /**
* Tests the default JClouds client. * Tests the default JClouds client.
* *
@ -35,8 +37,18 @@ import com.google.inject.Module;
*/ */
@Test(sequential = true, timeOut = 2 * 60 * 1000, testName = "perftest.JCloudsPerformanceLiveTest", groups = { "live" }) @Test(sequential = true, timeOut = 2 * 60 * 1000, testName = "perftest.JCloudsPerformanceLiveTest", groups = { "live" })
public class JCloudsPerformanceLiveTest extends BaseJCloudsPerformanceLiveTest { public class JCloudsPerformanceLiveTest extends BaseJCloudsPerformanceLiveTest {
@ConfiguresHttpCommandExecutorService
private static final class Module extends JavaUrlHttpCommandExecutorServiceModule {
@Override
protected void configure() {
super.configure();
install(new JodaDateServiceModule());
install(new BouncyCastleEncryptionServiceModule());
}
}
@Override @Override
protected Module createHttpModule() { protected Module createHttpModule() {
return new JavaUrlHttpCommandExecutorServiceModule(); return new Module();
} }
} }