You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@chemistry.apache.org by fm...@apache.org on 2011/10/20 10:46:34 UTC
svn commit: r1186669 -
/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/tests/crud/SetAndDeleteContentTest.java
Author: fmui
Date: Thu Oct 20 08:46:34 2011
New Revision: 1186669
URL: http://svn.apache.org/viewvc?rev=1186669&view=rev
Log:
TCK: made SetAndDeleteContentTest more robust
Modified:
chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/tests/crud/SetAndDeleteContentTest.java
Modified: chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/tests/crud/SetAndDeleteContentTest.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/SetAndDeleteContentTest.java?rev=1186669&r1=1186668&r2=1186669&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/tests/crud/SetAndDeleteContentTest.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/tests/crud/SetAndDeleteContentTest.java Thu Oct 20 08:46:34 2011
@@ -35,6 +35,7 @@ import org.apache.chemistry.opencmis.cli
import org.apache.chemistry.opencmis.client.api.Session;
import org.apache.chemistry.opencmis.commons.data.ContentStream;
import org.apache.chemistry.opencmis.commons.definitions.DocumentTypeDefinition;
+import org.apache.chemistry.opencmis.commons.enums.Action;
import org.apache.chemistry.opencmis.commons.enums.BindingType;
import org.apache.chemistry.opencmis.commons.enums.CapabilityContentStreamUpdates;
import org.apache.chemistry.opencmis.commons.enums.ContentStreamAllowed;
@@ -76,18 +77,27 @@ public class SetAndDeleteContentTest ext
// test if check out is required and possible
boolean checkedout = false;
- if (getContentStreamUpdatesCapbility(session) == CapabilityContentStreamUpdates.PWCONLY) {
+ if (!doc.getAllowableActions().getAllowableActions().contains(Action.CAN_SET_CONTENT_STREAM)) {
if (!docType.isVersionable()) {
addResult(createResult(SKIPPED,
- "Content stream operations only work if PWCs and the the test type is not versionable. Test skipped!"));
+ "The test document does not accept a new content stream. Test skipped!"));
doc.delete(true);
return;
+ } else {
+ workDoc = (Document) session.getObject(doc.checkOut(), SELECT_ALL_NO_CACHE_OC);
+ checkedout = true;
+
+ if (!workDoc.getAllowableActions().getAllowableActions().contains(Action.CAN_SET_CONTENT_STREAM)) {
+ addResult(createResult(SKIPPED,
+ "The test PWC does not accept a new content stream. Test skipped!"));
+ workDoc.cancelCheckOut();
+ doc.delete(true);
+ return;
+ }
}
-
- workDoc = (Document) session.getObject(doc.checkOut(), SELECT_ALL_NO_CACHE_OC);
- checkedout = true;
}
+ // test if the content stream can be deleted
if (docType.getContentStreamAllowed() == ContentStreamAllowed.REQUIRED) {
addResult(createResult(SKIPPED,
"A content stream is required for this docuemnt type. deleteContentStream() test skipped!"));