Live test demonstrating effectiveness of JCLOUDS-1401 fix.

This commit is contained in:
Jesse Glick 2018-07-11 10:19:05 -04:00 committed by Ignasi Barrera
parent 34d272ac80
commit 9a65be789e
No known key found for this signature in database
GPG Key ID: 3D5414A0D959B94F
1 changed files with 20 additions and 0 deletions

View File

@ -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();