From 008979b027f0e5d294ce606ba653e4312d31bf18 Mon Sep 17 00:00:00 2001 From: "adrian.f.cole" Date: Sun, 9 Aug 2009 22:51:35 +0000 Subject: [PATCH] attempts to clean up base integration test git-svn-id: http://jclouds.googlecode.com/svn/trunk@1847 3d8758e0-26b5-11de-8745-db77d3ebf521 --- .../org/jclouds/aws/s3/S3IntegrationTest.java | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/aws/s3/core/src/test/java/org/jclouds/aws/s3/S3IntegrationTest.java b/aws/s3/core/src/test/java/org/jclouds/aws/s3/S3IntegrationTest.java index 8c9f363cc0..2e9164d385 100644 --- a/aws/s3/core/src/test/java/org/jclouds/aws/s3/S3IntegrationTest.java +++ b/aws/s3/core/src/test/java/org/jclouds/aws/s3/S3IntegrationTest.java @@ -147,7 +147,7 @@ public class S3IntegrationTest { @BeforeGroups(groups = { "integration", "live" }) @Parameters( { S3Constants.PROPERTY_AWS_ACCESSKEYID, S3Constants.PROPERTY_AWS_SECRETACCESSKEY }) - protected void setUpCredentials(@Optional String AWSAccessKeyId, + public void setUpCredentials(@Optional String AWSAccessKeyId, @Optional String AWSSecretAccessKey, ITestContext testContext) throws Exception { AWSAccessKeyId = AWSAccessKeyId != null ? AWSAccessKeyId : sysAWSAccessKeyId; AWSSecretAccessKey = AWSSecretAccessKey != null ? AWSSecretAccessKey : sysAWSSecretAccessKey; @@ -158,7 +158,7 @@ public class S3IntegrationTest { } @BeforeGroups(dependsOnMethods = { "setUpCredentials" }, groups = { "integration", "live" }) - protected void setUpClient(ITestContext testContext) throws Exception { + public void setUpClient(ITestContext testContext) throws Exception { if (testContext.getAttribute(S3Constants.PROPERTY_AWS_ACCESSKEYID) != null) { String AWSAccessKeyId = (String) testContext .getAttribute(S3Constants.PROPERTY_AWS_ACCESSKEYID); @@ -329,11 +329,20 @@ public class S3IntegrationTest { * @throws ExecutionException * @throws TimeoutException */ - protected void deleteBucket(String name) throws InterruptedException, ExecutionException, + protected void deleteBucket(final String name) throws InterruptedException, ExecutionException, TimeoutException { if (client.bucketExists(name)) { emptyBucket(name); client.deleteBucketIfEmpty(name); + assertEventually(new Runnable() { + public void run() { + try { + assert !client.bucketExists(name) : "bucket " + name + " still exists"; + } catch (Exception e) { + Utils. rethrowIfRuntimeOrSameType(e); + } + } + }); } }