hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lium...@apache.org
Subject hadoop git commit: HADOOP-13937. S3Guard: Mock bucket locations in MockS3ClientFactory. Contributed by Mingliang Liu
Date Tue, 03 Jan 2017 20:42:46 GMT
Repository: hadoop
Updated Branches:
  refs/heads/HADOOP-13345 c7885deb9 -> b27317189


HADOOP-13937. S3Guard: Mock bucket locations in MockS3ClientFactory. Contributed by Mingliang
Liu


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

Branch: refs/heads/HADOOP-13345
Commit: b273171896c51c1f7f4680637e83118de385e754
Parents: c7885de
Author: Mingliang Liu <liuml07@apache.org>
Authored: Thu Dec 22 17:09:26 2016 -0800
Committer: Mingliang Liu <liuml07@apache.org>
Committed: Tue Jan 3 12:39:59 2017 -0800

----------------------------------------------------------------------
 .../test/java/org/apache/hadoop/fs/s3a/MockS3ClientFactory.java   | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/b2731718/hadoop-tools/hadoop-aws/src/test/java/org/apache/hadoop/fs/s3a/MockS3ClientFactory.java
----------------------------------------------------------------------
diff --git a/hadoop-tools/hadoop-aws/src/test/java/org/apache/hadoop/fs/s3a/MockS3ClientFactory.java
b/hadoop-tools/hadoop-aws/src/test/java/org/apache/hadoop/fs/s3a/MockS3ClientFactory.java
index 41f04ee..fe04b9a 100644
--- a/hadoop-tools/hadoop-aws/src/test/java/org/apache/hadoop/fs/s3a/MockS3ClientFactory.java
+++ b/hadoop-tools/hadoop-aws/src/test/java/org/apache/hadoop/fs/s3a/MockS3ClientFactory.java
@@ -23,6 +23,7 @@ import static org.mockito.Mockito.*;
 import java.net.URI;
 
 import com.amazonaws.services.s3.AmazonS3;
+import com.amazonaws.services.s3.model.Region;
 
 /**
  * An {@link S3ClientFactory} that returns Mockito mocks of the {@link AmazonS3}
@@ -35,6 +36,8 @@ public class MockS3ClientFactory implements S3ClientFactory {
     String bucket = name.getHost();
     AmazonS3 s3 = mock(AmazonS3.class);
     when(s3.doesBucketExist(bucket)).thenReturn(true);
+    when(s3.getBucketLocation(anyString()))
+        .thenReturn(Region.US_West.toString());
     return s3;
   }
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org


Mime
View raw message