Live test demonstrating effectiveness of JCLOUDS-1401 fix.

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

Branch: refs/heads/2.1.x
Commit: a29f6065c44e66ab3f62008828978decb923d90e
Parents: b9596bf
Author: Jesse Glick <jgl...@cloudbees.com>
Authored: Wed Jul 11 10:19:05 2018 -0400
Committer: Ignasi Barrera <n...@apache.org>
Committed: Wed Jul 11 09:37:33 2018 -0700

----------------------------------------------------------------------
 .../java/org/jclouds/s3/S3ClientLiveTest.java   | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jclouds/blob/a29f6065/apis/s3/src/test/java/org/jclouds/s3/S3ClientLiveTest.java
----------------------------------------------------------------------
diff --git a/apis/s3/src/test/java/org/jclouds/s3/S3ClientLiveTest.java 
b/apis/s3/src/test/java/org/jclouds/s3/S3ClientLiveTest.java
index b6b53e0..425f37a 100644
--- a/apis/s3/src/test/java/org/jclouds/s3/S3ClientLiveTest.java
+++ b/apis/s3/src/test/java/org/jclouds/s3/S3ClientLiveTest.java
@@ -48,7 +48,10 @@ import org.jclouds.ContextBuilder;
 import org.jclouds.aws.domain.SessionCredentials;
 import org.jclouds.blobstore.KeyNotFoundException;
 import org.jclouds.blobstore.domain.Blob;
+import org.jclouds.blobstore.domain.PageSet;
+import org.jclouds.blobstore.domain.StorageMetadata;
 import org.jclouds.blobstore.integration.internal.BaseBlobStoreIntegrationTest;
+import org.jclouds.blobstore.options.ListContainerOptions;
 import org.jclouds.domain.Credentials;
 import org.jclouds.http.HttpResponseException;
 import org.jclouds.io.ByteStreams2;
@@ -535,6 +538,23 @@ public class S3ClientLiveTest extends 
BaseBlobStoreIntegrationTest {
       }
    }
 
+   // JCLOUDS-1401
+   public void testUnusualKeyCharacters() throws InterruptedException, 
ExecutionException, TimeoutException, IOException {
+      String containerName = getContainerName();
+      try {
+         String dirName = "a%2Fb&xxx#?:$'\\\"<>čॐ";
+         String fileName = "foo%3Abar.xml";
+         addToContainerAndValidate(containerName, dirName + '/' + fileName);
+         PageSet<? extends StorageMetadata> list = 
view.getBlobStore().list(containerName,
+                  ListContainerOptions.Builder.prefix(dirName + "/"));
+         assertEquals(list.size(), 1);
+         StorageMetadata md = list.iterator().next();
+         assertEquals(md.getName(), dirName + '/' + fileName);
+      } finally {
+         returnContainer(containerName);
+      }
+   }
+
    public void testMultipartSynchronously() throws InterruptedException, 
IOException {
       HashCode oneHundredOneConstitutionsMD5 = 
oneHundredOneConstitutions.hash(md5());
       String containerName = getContainerName();

Reply via email to