corrected bucket delete logic and fixed enableDebug so that subclasses can call it

git-svn-id: http://jclouds.googlecode.com/svn/trunk@1427 3d8758e0-26b5-11de-8745-db77d3ebf521
This commit is contained in:
adrian.f.cole 2009-06-12 16:24:21 +00:00
parent d91f069761
commit ac8210c90a
1 changed files with 4 additions and 2 deletions

View File

@ -68,7 +68,7 @@ public class S3IntegrationTest {
protected void createBucketAndEnsureEmpty(String sourceBucket) throws InterruptedException, protected void createBucketAndEnsureEmpty(String sourceBucket) throws InterruptedException,
ExecutionException, TimeoutException { ExecutionException, TimeoutException {
client.deleteBucketIfEmpty(sourceBucket).get(10, TimeUnit.SECONDS); deleteBucket(sourceBucket);
client.putBucketIfNotExists(sourceBucket).get(10, TimeUnit.SECONDS); client.putBucketIfNotExists(sourceBucket).get(10, TimeUnit.SECONDS);
assertEquals(client.listBucket(sourceBucket).get(10, TimeUnit.SECONDS).getContents().size(), assertEquals(client.listBucket(sourceBucket).get(10, TimeUnit.SECONDS).getContents().size(),
0, "bucket " + sourceBucket + "wasn't empty"); 0, "bucket " + sourceBucket + "wasn't empty");
@ -98,7 +98,7 @@ public class S3IntegrationTest {
} }
@BeforeClass(groups = { "integration", "live" }) @BeforeClass(groups = { "integration", "live" })
void enableDebug() { protected void enableDebug() {
if (debugEnabled()) { if (debugEnabled()) {
Handler HANDLER = new ConsoleHandler() { Handler HANDLER = new ConsoleHandler() {
{ {
@ -176,6 +176,8 @@ public class S3IntegrationTest {
public void setUpBucket(Method method) throws TimeoutException, ExecutionException, public void setUpBucket(Method method) throws TimeoutException, ExecutionException,
InterruptedException { InterruptedException {
bucketName = (bucketPrefix + method.getName()).toLowerCase(); bucketName = (bucketPrefix + method.getName()).toLowerCase();
if (bucketName.length() > 63)
bucketName = bucketName.substring(0, 62);
createBucketAndEnsureEmpty(bucketName); createBucketAndEnsureEmpty(bucketName);
} }