diff --git a/blobstore/src/test/java/org/jclouds/blobstore/integration/internal/BaseServiceIntegrationTest.java b/blobstore/src/test/java/org/jclouds/blobstore/integration/internal/BaseServiceIntegrationTest.java index 555b67d820..1b3854c49d 100644 --- a/blobstore/src/test/java/org/jclouds/blobstore/integration/internal/BaseServiceIntegrationTest.java +++ b/blobstore/src/test/java/org/jclouds/blobstore/integration/internal/BaseServiceIntegrationTest.java @@ -56,7 +56,7 @@ public class BaseServiceIntegrationTest extends BaseBlobStoreIntegrationTest { PageSet list = view.getBlobStore().list(); assert Iterables.any(list, new Predicate() { public boolean apply(StorageMetadata md) { - return containerName.equals(md.getName()) && location.equals(md.getLocation()); + return containerName.equals(md.getName()) && locationEquals(location, md.getLocation()); } }) : String.format("container %s/%s not found in list %s", location, containerName, list); assertTrue(view.getBlobStore().containerExists(containerName), containerName); @@ -119,4 +119,7 @@ public class BaseServiceIntegrationTest extends BaseBlobStoreIntegrationTest { assertEquals(provider.getIso3166Codes(), getIso3166Codes()); } + protected boolean locationEquals(Location location1, Location location2) { + return location1.equals(location2); + } } diff --git a/providers/aws-s3/src/test/java/org/jclouds/aws/s3/blobstore/integration/AWSS3ServiceIntegrationLiveTest.java b/providers/aws-s3/src/test/java/org/jclouds/aws/s3/blobstore/integration/AWSS3ServiceIntegrationLiveTest.java index f7bcba90dd..2a192ec5e0 100644 --- a/providers/aws-s3/src/test/java/org/jclouds/aws/s3/blobstore/integration/AWSS3ServiceIntegrationLiveTest.java +++ b/providers/aws-s3/src/test/java/org/jclouds/aws/s3/blobstore/integration/AWSS3ServiceIntegrationLiveTest.java @@ -18,6 +18,7 @@ package org.jclouds.aws.s3.blobstore.integration; import java.util.Set; +import org.jclouds.domain.Location; import org.jclouds.s3.blobstore.integration.S3ServiceIntegrationLiveTest; import org.testng.annotations.Test; @@ -34,4 +35,17 @@ public class AWSS3ServiceIntegrationLiveTest extends S3ServiceIntegrationLiveTes return ImmutableSet. of("US", "US-CA", "US-OR", "BR-SP", "IE", "SG", "AU-NSW", "JP-13"); } + // Amazon returns null instead of us-standard in some situations + @Override + protected boolean locationEquals(Location location1, Location location2) { + Location usStandard = null; + for (Location location : view.getBlobStore().listAssignableLocations()) { + if (location.getId().equals("us-standard")) { + usStandard = location; + break; + } + } + return super.locationEquals(location1 == null ? usStandard : location1, + location2 == null ? usStandard : location2); + } }