Repository: jclouds
Updated Branches:
  refs/heads/master 65a5ec816 -> 29655f314


JCLOUDS-1263: Add live integration test for manipulating objects through the 
Swift ObjectApi with unicode characters in their path


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

Branch: refs/heads/master
Commit: 29655f3149f151a834ed5a724e91e32994b28d89
Parents: 14621c0
Author: Mat Mannion <m.mann...@warwick.ac.uk>
Authored: Tue Apr 4 13:52:26 2017 +0100
Committer: Andrew Gaul <g...@apache.org>
Committed: Mon May 21 22:19:25 2018 -0700

----------------------------------------------------------------------
 .../swift/v1/features/ObjectApiLiveTest.java    | 35 +++++++++++++++-----
 1 file changed, 27 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jclouds/blob/29655f31/apis/openstack-swift/src/test/java/org/jclouds/openstack/swift/v1/features/ObjectApiLiveTest.java
----------------------------------------------------------------------
diff --git 
a/apis/openstack-swift/src/test/java/org/jclouds/openstack/swift/v1/features/ObjectApiLiveTest.java
 
b/apis/openstack-swift/src/test/java/org/jclouds/openstack/swift/v1/features/ObjectApiLiveTest.java
index 98a546e..02116f6 100644
--- 
a/apis/openstack-swift/src/test/java/org/jclouds/openstack/swift/v1/features/ObjectApiLiveTest.java
+++ 
b/apis/openstack-swift/src/test/java/org/jclouds/openstack/swift/v1/features/ObjectApiLiveTest.java
@@ -61,21 +61,40 @@ public class ObjectApiLiveTest extends BaseSwiftApiLiveTest 
{
    private String containerName = getClass().getSimpleName() + "Container";
    static final Payload PAYLOAD = 
newByteSourcePayload(ByteSource.wrap("swifty".getBytes()));
 
+   protected void assertCanCreateReadUpdateDeleteList(String regionId, String 
containerName, String objectName) throws Exception {
+      assertNotNull(getApi().getContainerApi(regionId).create(containerName));
+      assertNotNull(getApi().getObjectApi(regionId, 
containerName).put(objectName, PAYLOAD));
+
+      SwiftObject object = getApi().getObjectApi(regionId, 
containerName).get(objectName);
+      assertEquals(object.getName(), objectName);
+      checkObject(object);
+      assertEquals(toStringAndClose(object.getPayload().openStream()), 
"swifty");
+
+      String lexicographicallyBeforeName = objectName.substring(0, 
objectName.length() - 1);
+      object = getApi().getObjectApi(regionId, containerName)
+          .list(marker(lexicographicallyBeforeName)).get(0);
+      assertEquals(object.getName(), objectName);
+      checkObject(object);
+
+      getApi().getObjectApi(regionId, containerName).delete(objectName);
+      getApi().getContainerApi(regionId).deleteIfEmpty(containerName);
+   }
+
    public void testCreateWithSpacesAndSpecialCharacters() throws Exception {
       final String containerName = "container # ! special";
       final String objectName = "object # ! special";
 
       for (String regionId : regions) {
-         
assertNotNull(getApi().getContainerApi(regionId).create(containerName));
-         assertNotNull(getApi().getObjectApi(regionId, 
containerName).put(objectName, PAYLOAD));
+         assertCanCreateReadUpdateDeleteList(regionId, containerName, 
objectName);
+      }
+   }
 
-         SwiftObject object = getApi().getObjectApi(regionId, 
containerName).get(objectName);
-         assertEquals(object.getName(), objectName);
-         checkObject(object);
-         assertEquals(toStringAndClose(object.getPayload().openStream()), 
"swifty");
+   public void testCreateAndListWithUnicodeCharacters() throws Exception {
+      final String containerName = "container-unic₪de";
+      final String objectName = "object-unic₪de";
 
-         getApi().getObjectApi(regionId, containerName).delete(objectName);
-         getApi().getContainerApi(regionId).deleteIfEmpty(containerName);
+      for (String regionId : regions) {
+         assertCanCreateReadUpdateDeleteList(regionId, containerName, 
objectName);
       }
    }
 

Reply via email to