From 915e05330a540fcad8479cbf51cafbf1e1573f2a Mon Sep 17 00:00:00 2001 From: "adrian.f.cole" Date: Sun, 9 Aug 2009 23:00:11 +0000 Subject: [PATCH] cleanup git-svn-id: http://jclouds.googlecode.com/svn/trunk@1855 3d8758e0-26b5-11de-8745-db77d3ebf521 --- .../org/jclouds/aws/s3/BasePerformance.java | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/aws/s3/perftest/src/test/java/org/jclouds/aws/s3/BasePerformance.java b/aws/s3/perftest/src/test/java/org/jclouds/aws/s3/BasePerformance.java index d82c967977..d16ea368ef 100644 --- a/aws/s3/perftest/src/test/java/org/jclouds/aws/s3/BasePerformance.java +++ b/aws/s3/perftest/src/test/java/org/jclouds/aws/s3/BasePerformance.java @@ -36,8 +36,8 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; import java.util.concurrent.atomic.AtomicInteger; -import org.testng.annotations.AfterTest; -import org.testng.annotations.BeforeTest; +import org.testng.annotations.AfterGroups; +import org.testng.annotations.BeforeGroups; import org.testng.annotations.Test; import com.google.inject.Provider; @@ -47,22 +47,21 @@ import com.google.inject.Provider; * * @author Adrian Cole */ -@Test(groups = { "live" }) +@Test(groups = { "live" }, testName = "s3.S3Performance") public abstract class BasePerformance extends S3IntegrationTest { protected int timeoutSeconds = 10; protected int loopCount = 100; protected ExecutorService exec; protected CompletionService completer; - @BeforeTest - protected void setUpCallables() throws InterruptedException, ExecutionException, - TimeoutException { + @BeforeGroups(groups = { "live" }) + public void setUpCallables() throws InterruptedException, ExecutionException, TimeoutException { exec = Executors.newCachedThreadPool(); completer = new ExecutorCompletionService(exec); } - @AfterTest - protected void tearDownExecutor() throws Exception { + @AfterGroups(groups = { "live" }) + public void tearDownExecutor() throws Exception { exec.shutdownNow(); exec = null; } @@ -70,7 +69,11 @@ public abstract class BasePerformance extends S3IntegrationTest { @Test public void testPutBytesSerialEU() throws Exception { String euBucketName = createScratchBucketInEU(); - doSerial(new PutBytesCallable(euBucketName), loopCount / 10); + try { + doSerial(new PutBytesCallable(euBucketName), loopCount); + } finally { + returnBucket(euBucketName); + } } @Test