chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From f...@apache.org
Subject svn commit: r1790373 - /chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/tests/crud/CreateAndDeleteFolderTest.java
Date Thu, 06 Apr 2017 10:41:37 GMT
Author: fmui
Date: Thu Apr  6 10:41:37 2017
New Revision: 1790373

URL: http://svn.apache.org/viewvc?rev=1790373&view=rev
Log:
CMIS-1021: changed TCK test to support repositories with path segements that are different
from the folder name

Modified:
    chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/tests/crud/CreateAndDeleteFolderTest.java

Modified: chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/tests/crud/CreateAndDeleteFolderTest.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/tests/crud/CreateAndDeleteFolderTest.java?rev=1790373&r1=1790372&r2=1790373&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/tests/crud/CreateAndDeleteFolderTest.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/tests/crud/CreateAndDeleteFolderTest.java
Thu Apr  6 10:41:37 2017
@@ -28,6 +28,7 @@ import java.util.Map;
 import org.apache.chemistry.opencmis.client.api.CmisObject;
 import org.apache.chemistry.opencmis.client.api.Folder;
 import org.apache.chemistry.opencmis.client.api.ItemIterable;
+import org.apache.chemistry.opencmis.client.api.ObjectId;
 import org.apache.chemistry.opencmis.client.api.Session;
 import org.apache.chemistry.opencmis.tck.CmisTestResult;
 import org.apache.chemistry.opencmis.tck.impl.AbstractSessionTest;
@@ -117,10 +118,13 @@ public class CreateAndDeleteFolderTest e
             path.append(folderName + i);
         }
 
-        session.createPath(testFolder, path.toString(), getFolderTestTypeId());
+        ObjectId deepestFolderId = session.createPath(testFolder, path.toString(), getFolderTestTypeId());
+
+        Folder deepestFolder = (Folder) session.getObject(deepestFolderId, SELECT_ALL_NO_CACHE_OC);
+        String testPath = deepestFolder.getPath();
 
         for (int i = 0; i < depth; i++) {
-            CmisObject folderObj = session.getObjectByPath(path.toString(), SELECT_ALL_NO_CACHE_OC);
+            CmisObject folderObj = session.getObjectByPath(testPath, SELECT_ALL_NO_CACHE_OC);
 
             if (folderObj instanceof Folder) {
                 session.deleteByPath(((Folder) folderObj).getPath());
@@ -128,7 +132,7 @@ public class CreateAndDeleteFolderTest e
                 addResult(createResult(FAILURE, "Just created folder is not a folder! Id:
" + folderObj.getId()));
             }
 
-            path.delete(path.lastIndexOf("/"), path.length());
+            testPath = testPath.substring(0, testPath.lastIndexOf("/"));
         }
 
         addResult(createInfoResult("Tested the creation of a folder hierarchy with a depth
of " + (depth + 1)



Mime
View raw message