Repository: jclouds
Updated Branches:
  refs/heads/master b3691fed7 -> af1a01a0a


JCLOUDS-96: Handle us-standard in testAllLocations


Project: http://git-wip-us.apache.org/repos/asf/jclouds/repo
Commit: http://git-wip-us.apache.org/repos/asf/jclouds/commit/af1a01a0
Tree: http://git-wip-us.apache.org/repos/asf/jclouds/tree/af1a01a0
Diff: http://git-wip-us.apache.org/repos/asf/jclouds/diff/af1a01a0

Branch: refs/heads/master
Commit: af1a01a0af93b4855b2b76c183b80f72a9c86fc1
Parents: b3691fe
Author: Andrew Gaul <[email protected]>
Authored: Fri Jan 23 10:04:24 2015 -0800
Committer: Andrew Gaul <[email protected]>
Committed: Fri Jan 23 19:24:44 2015 -0800

----------------------------------------------------------------------
 .../internal/BaseServiceIntegrationTest.java          |  5 ++++-
 .../integration/AWSS3ServiceIntegrationLiveTest.java  | 14 ++++++++++++++
 2 files changed, 18 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jclouds/blob/af1a01a0/blobstore/src/test/java/org/jclouds/blobstore/integration/internal/BaseServiceIntegrationTest.java
----------------------------------------------------------------------
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 555b67d..1b3854c 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<? extends StorageMetadata> list = 
view.getBlobStore().list();
                   assert Iterables.any(list, new Predicate<StorageMetadata>() {
                      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);
+   }
 }

http://git-wip-us.apache.org/repos/asf/jclouds/blob/af1a01a0/providers/aws-s3/src/test/java/org/jclouds/aws/s3/blobstore/integration/AWSS3ServiceIntegrationLiveTest.java
----------------------------------------------------------------------
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 f7bcba9..2a192ec 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.<String> 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);
+   }
 }

Reply via email to