chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From f...@apache.org
Subject svn commit: r1539403 - /chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/tests/crud/ChangeTokenTest.java
Date Wed, 06 Nov 2013 17:13:40 GMT
Author: fmui
Date: Wed Nov  6 17:13:40 2013
New Revision: 1539403

URL: http://svn.apache.org/r1539403
Log:
TCK: improved change token test

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

Modified: chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/tests/crud/ChangeTokenTest.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/ChangeTokenTest.java?rev=1539403&r1=1539402&r2=1539403&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/tests/crud/ChangeTokenTest.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/tests/crud/ChangeTokenTest.java
Wed Nov  6 17:13:40 2013
@@ -21,6 +21,7 @@ package org.apache.chemistry.opencmis.tc
 import static org.apache.chemistry.opencmis.tck.CmisTestResultStatus.FAILURE;
 import static org.apache.chemistry.opencmis.tck.CmisTestResultStatus.INFO;
 import static org.apache.chemistry.opencmis.tck.CmisTestResultStatus.SKIPPED;
+import static org.apache.chemistry.opencmis.tck.CmisTestResultStatus.WARNING;
 
 import java.io.ByteArrayInputStream;
 import java.math.BigInteger;
@@ -50,7 +51,7 @@ public class ChangeTokenTest extends Abs
     public void init(Map<String, String> parameters) {
         super.init(parameters);
         setName("Change Token Test");
-        setDescription("Creates a document and updates it with an outdated change token.");
+        setDescription("Creates a document and a folder and updates them with an outdated
change token.");
     }
 
     @Override
@@ -67,6 +68,9 @@ public class ChangeTokenTest extends Abs
 
             // update folder properties test
             runUpdateFolderTest(session, testFolder);
+
+            // add child and update folder properties test
+            runAddChildFolderTest(session, testFolder);
         } finally {
             // delete the test folder
             deleteTestFolder();
@@ -218,4 +222,34 @@ public class ChangeTokenTest extends Abs
             deleteObject(folder);
         }
     }
+
+    private void runAddChildFolderTest(Session session, Folder testFolder) {
+        Folder folder = createFolder(session, testFolder, "folder1");
+
+        try {
+            if (folder.getChangeToken() == null) {
+                addResult(createResult(SKIPPED, "Repository does not provide change tokens
for folders. Test skipped!"));
+                return;
+            }
+
+            if (!folder.getAllowableActions().getAllowableActions().contains(Action.CAN_UPDATE_PROPERTIES))
{
+                addResult(createResult(SKIPPED, "Folder name can't be changed. Test skipped!"));
+                return;
+            }
+
+            createDocument(session, folder, "doc1", "content");
+
+            try {
+                Map<String, Object> properties2 = new HashMap<String, Object>();
+                properties2.put(PropertyIds.NAME, "folder2");
+                folder.updateProperties(properties2, false);
+            } catch (CmisUpdateConflictException e) {
+                addResult(createResult(WARNING, "Adding a child to a folder changes the change
token of the folder. "
+                        + "CMIS clients might not expect that."));
+            }
+
+        } finally {
+            deleteObject(folder);
+        }
+    }
 }



Mime
View raw message