mirror of
https://github.com/apache/jclouds.git
synced 2025-02-17 15:35:44 +00:00
eventual consistency madness
git-svn-id: http://jclouds.googlecode.com/svn/trunk@1861 3d8758e0-26b5-11de-8745-db77d3ebf521
This commit is contained in:
parent
9ee13291bb
commit
8a4e5d4839
@ -24,6 +24,7 @@
|
|||||||
package org.jclouds.aws.s3.commands;
|
package org.jclouds.aws.s3.commands;
|
||||||
|
|
||||||
import org.jclouds.aws.s3.S3IntegrationTest;
|
import org.jclouds.aws.s3.S3IntegrationTest;
|
||||||
|
import org.jclouds.util.Utils;
|
||||||
import org.testng.annotations.Test;
|
import org.testng.annotations.Test;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -57,10 +58,20 @@ public class DeleteBucketIntegrationTest extends S3IntegrationTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
void deleteBucketIfEmpty() throws Exception {
|
void deleteBucketIfEmpty() throws Exception {
|
||||||
String bucketName = getScratchBucketName();
|
final String bucketName = getScratchBucketName();
|
||||||
try {
|
try {
|
||||||
assert client.deleteBucketIfEmpty(bucketName);
|
assert client.deleteBucketIfEmpty(bucketName);
|
||||||
assert !client.bucketExists(bucketName);
|
|
||||||
|
assertEventually(new Runnable() {
|
||||||
|
public void run() {
|
||||||
|
try {
|
||||||
|
assert !client.bucketExists(bucketName) : "bucket " + bucketName
|
||||||
|
+ " still exists";
|
||||||
|
} catch (Exception e) {
|
||||||
|
Utils.<RuntimeException> rethrowIfRuntimeOrSameType(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
} finally {
|
} finally {
|
||||||
returnScratchBucket(bucketName);
|
returnScratchBucket(bucketName);
|
||||||
}
|
}
|
||||||
|
@ -95,14 +95,22 @@ public class PutBucketLiveTest extends S3IntegrationTest {
|
|||||||
*/
|
*/
|
||||||
@Test(groups = "live")
|
@Test(groups = "live")
|
||||||
void testEu() throws Exception {
|
void testEu() throws Exception {
|
||||||
String bucketName = getScratchBucketName();
|
final String bucketName = getScratchBucketName();
|
||||||
try {
|
try {
|
||||||
deleteBucket(bucketName);
|
deleteBucket(bucketName);
|
||||||
client.putBucketIfNotExists(bucketName,
|
client.putBucketIfNotExists(bucketName,
|
||||||
createIn(LocationConstraint.EU).withBucketAcl(CannedAccessPolicy.PUBLIC_READ))
|
createIn(LocationConstraint.EU).withBucketAcl(CannedAccessPolicy.PUBLIC_READ))
|
||||||
.get(10, TimeUnit.SECONDS);
|
.get(30, TimeUnit.SECONDS);
|
||||||
AccessControlList acl = client.getBucketACL(bucketName).get(10, TimeUnit.SECONDS);
|
assertEventually(new Runnable() {
|
||||||
assertTrue(acl.hasPermission(GroupGranteeURI.ALL_USERS, Permission.READ), acl.toString());
|
public void run() {
|
||||||
|
try {
|
||||||
|
AccessControlList acl = client.getBucketACL(bucketName).get(10, TimeUnit.SECONDS);
|
||||||
|
assertTrue(acl.hasPermission(GroupGranteeURI.ALL_USERS, Permission.READ), acl.toString());
|
||||||
|
} catch (Exception e) {
|
||||||
|
Utils.<RuntimeException> rethrowIfRuntimeOrSameType(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
// TODO: I believe that the following should work based on the above acl assertion passing.
|
// TODO: I believe that the following should work based on the above acl assertion passing.
|
||||||
// However, it fails on 403
|
// However, it fails on 403
|
||||||
// URL url = new URL(String.format("https://%s.s3.amazonaws.com", bucketName));
|
// URL url = new URL(String.format("https://%s.s3.amazonaws.com", bucketName));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user