chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From f...@apache.org
Subject svn commit: r1214422 - in /chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck: impl/ tests/control/ tests/crud/ tests/versioning/
Date Wed, 14 Dec 2011 19:46:10 GMT
Author: fmui
Date: Wed Dec 14 19:46:09 2011
New Revision: 1214422

URL: http://svn.apache.org/viewvc?rev=1214422&view=rev
Log:
TCK fixes: CMIS-476, CMIS-477, CMIS-478, CMIS-484, CMIS-485, CMIS-486

Added:
    chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/tests/versioning/VersioningStateCreateTest.java
      - copied, changed from r1214359, chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/tests/versioning/VersioingStateCreateTest.java
Removed:
    chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/tests/versioning/VersioingStateCreateTest.java
Modified:
    chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/impl/AbstractSessionTest.java
    chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/impl/TestParameters.java
    chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/tests/control/ACLSmokeTest.java
    chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/tests/crud/UpdateSmokeTest.java
    chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/tests/versioning/VersioningSmokeTest.java
    chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/tests/versioning/VersioningTestGroup.java

Modified: chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/impl/AbstractSessionTest.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/impl/AbstractSessionTest.java?rev=1214422&r1=1214421&r2=1214422&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/impl/AbstractSessionTest.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/impl/AbstractSessionTest.java
Wed Dec 14 19:46:09 2011
@@ -619,24 +619,34 @@ public abstract class AbstractSessionTes
 
                 // known properties that are strings and must be set
                 if (PropertyIds.OBJECT_ID.equals(propId) || PropertyIds.BASE_TYPE_ID.equals(propId)
-                        || PropertyIds.OBJECT_TYPE_ID.equals(propId) || PropertyIds.CREATED_BY.equals(propId)
-                        || PropertyIds.LAST_MODIFIED_BY.equals(propId) || PropertyIds.PATH.equals(propId)
+                        || PropertyIds.OBJECT_TYPE_ID.equals(propId) || PropertyIds.PATH.equals(propId)
                         || PropertyIds.SOURCE_ID.equals(propId) || PropertyIds.TARGET_ID.equals(propId)
                         || PropertyIds.POLICY_TEXT.equals(propId)) {
                     propertyCheck = PropertyCheckEnum.STRING_MUST_NOT_BE_EMPTY;
                 }
 
+                if (!(object instanceof Relationship)) {
+                    if (PropertyIds.CREATED_BY.equals(propId) || PropertyIds.LAST_MODIFIED_BY.equals(propId))
{
+                        propertyCheck = PropertyCheckEnum.STRING_MUST_NOT_BE_EMPTY;
+                    }
+                }
+
                 // known properties that are strings and should be set
                 if (PropertyIds.NAME.equals(propId)) {
                     propertyCheck = PropertyCheckEnum.STRING_SHOULD_NOT_BE_EMPTY;
                 }
 
                 // known properties that are not strings and must be set
-                if (PropertyIds.CREATION_DATE.equals(propId) || PropertyIds.LAST_MODIFICATION_DATE.equals(propId)
-                        || PropertyIds.IS_IMMUTABLE.equals(propId)) {
+                if (PropertyIds.IS_IMMUTABLE.equals(propId)) {
                     propertyCheck = PropertyCheckEnum.MUST_BE_SET;
                 }
 
+                if (!(object instanceof Relationship)) {
+                    if (PropertyIds.CREATION_DATE.equals(propId) || PropertyIds.LAST_MODIFICATION_DATE.equals(propId))
{
+                        propertyCheck = PropertyCheckEnum.MUST_BE_SET;
+                    }
+                }
+
                 // special case: parent
                 if (PropertyIds.PARENT_ID.equals(propId)) {
                     if (object instanceof Folder) {

Modified: chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/impl/TestParameters.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/impl/TestParameters.java?rev=1214422&r1=1214421&r2=1214422&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/impl/TestParameters.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/impl/TestParameters.java
Wed Dec 14 19:46:09 2011
@@ -30,4 +30,7 @@ public class TestParameters {
 
     public static final String DEFAULT_TEST_FOLDER_PARENT = "org.apache.chemistry.opencmis.tck.default.testFolderParent";
     public static final String DEFAULT_TEST_FOLDER_PARENT_VALUE = "/";
+
+    public static final String DEFAULT_ACL_PRINCIPAL = "org.apache.chemistry.opencmis.tck.default.principal";
+    public static final String DEFAULT_ACL_PRINCIPAL_VALUE = "cmis:user";
 }

Modified: chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/tests/control/ACLSmokeTest.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/control/ACLSmokeTest.java?rev=1214422&r1=1214421&r2=1214422&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/tests/control/ACLSmokeTest.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/tests/control/ACLSmokeTest.java
Wed Dec 14 19:46:09 2011
@@ -35,6 +35,7 @@ import org.apache.chemistry.opencmis.com
 import org.apache.chemistry.opencmis.commons.enums.CapabilityAcl;
 import org.apache.chemistry.opencmis.tck.CmisTestResult;
 import org.apache.chemistry.opencmis.tck.impl.AbstractSessionTest;
+import org.apache.chemistry.opencmis.tck.impl.TestParameters;
 
 /**
  * Query smoke test.
@@ -91,8 +92,10 @@ public class ACLSmokeTest extends Abstra
 
                 // apply permission "cmis:read"
                 if (getAclCapability(session) == CapabilityAcl.MANAGE) {
-                    // see CMIS spec section "2.2.1.5 ACLs"
-                    String principal = "cmis:user";
+                    String principal = getParameters().get(TestParameters.DEFAULT_ACL_PRINCIPAL);
+                    if (principal == null) {
+                        principal = TestParameters.DEFAULT_ACL_PRINCIPAL_VALUE;
+                    }
 
                     List<Ace> aces = new ArrayList<Ace>();
                     aces.add(session.getObjectFactory().createAce(principal, Collections.singletonList("cmis:read")));

Modified: chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/tests/crud/UpdateSmokeTest.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/UpdateSmokeTest.java?rev=1214422&r1=1214421&r2=1214422&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/tests/crud/UpdateSmokeTest.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/tests/crud/UpdateSmokeTest.java
Wed Dec 14 19:46:09 2011
@@ -93,7 +93,9 @@ public class UpdateSmokeTest extends Abs
             // delete
             deleteObject(doc2);
             if (!doc1.getId().equals(doc2.getId())) {
-                deleteObject(doc1);
+                if (exists(doc1)) {
+                    deleteObject(doc1);
+                }
             }
         } finally {
             // clean up

Modified: chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/tests/versioning/VersioningSmokeTest.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/versioning/VersioningSmokeTest.java?rev=1214422&r1=1214421&r2=1214422&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/tests/versioning/VersioningSmokeTest.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/tests/versioning/VersioningSmokeTest.java
Wed Dec 14 19:46:09 2011
@@ -121,7 +121,7 @@ public class VersioningSmokeTest extends
         f = createResult(FAILURE, "Version series has a PWC but cmis:isVersionSeriesCheckedOut
is not TRUE!");
         addResult(assertIsTrue(pwc.isVersionSeriesCheckedOut(), null, f));
 
-        f = createResult(FAILURE, "PWC id and cmis:versionSeriesCheckedOutId don't match!");
+        f = createResult(WARNING, "PWC id and cmis:versionSeriesCheckedOutId don't match!");
         addResult(assertEquals(pwc.getId(), pwc.getVersionSeriesCheckedOutId(), null, f));
 
         f = createResult(WARNING, "PWC does not have a value for cmis:versionSeriesCheckedOutBy!");

Copied: chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/tests/versioning/VersioningStateCreateTest.java
(from r1214359, chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/tests/versioning/VersioingStateCreateTest.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/versioning/VersioningStateCreateTest.java?p2=chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/tests/versioning/VersioningStateCreateTest.java&p1=chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/tests/versioning/VersioingStateCreateTest.java&r1=1214359&r2=1214422&rev=1214422&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/tests/versioning/VersioingStateCreateTest.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/tests/versioning/VersioningStateCreateTest.java
Wed Dec 14 19:46:09 2011
@@ -41,7 +41,7 @@ import org.apache.chemistry.opencmis.com
 import org.apache.chemistry.opencmis.tck.CmisTestResult;
 import org.apache.chemistry.opencmis.tck.impl.AbstractSessionTest;
 
-public class VersioingStateCreateTest extends AbstractSessionTest {
+public class VersioningStateCreateTest extends AbstractSessionTest {
 
     @Override
     public void init(Map<String, String> parameters) {
@@ -68,7 +68,7 @@ public class VersioingStateCreateTest ex
 
             // major version
             Document docMajor = testFolder.createDocument(getProperties("major.txt"), getContentStream(),
-                    VersioningState.MAJOR);
+                    VersioningState.MAJOR, null, null, null, SELECT_ALL_NO_CACHE_OC);
             addResult(checkObject(session, docMajor, getAllProperties(docMajor), "Major version
compliance"));
 
             f = createResult(FAILURE, "Document should be major version.");
@@ -84,7 +84,7 @@ public class VersioingStateCreateTest ex
             // minor version
             try {
                 Document docMinor = testFolder.createDocument(getProperties("minor.txt"),
getContentStream(),
-                        VersioningState.MINOR);
+                        VersioningState.MINOR, null, null, null, SELECT_ALL_NO_CACHE_OC);
                 addResult(checkObject(session, docMinor, getAllProperties(docMinor), "Minor
version compliance"));
 
                 f = createResult(FAILURE, "Document should be minor version.");
@@ -107,7 +107,7 @@ public class VersioingStateCreateTest ex
             // checked out version
             try {
                 Document docCheckedOut = testFolder.createDocument(getProperties("checkout.txt"),
getContentStream(),
-                        VersioningState.CHECKEDOUT);
+                        VersioningState.CHECKEDOUT, null, null, null, SELECT_ALL_NO_CACHE_OC);
                 addResult(checkObject(session, docCheckedOut, getAllProperties(docCheckedOut),
                         "Checked out version compliance"));
 

Modified: chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/tests/versioning/VersioningTestGroup.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/versioning/VersioningTestGroup.java?rev=1214422&r1=1214421&r2=1214422&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/tests/versioning/VersioningTestGroup.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/tests/versioning/VersioningTestGroup.java
Wed Dec 14 19:46:09 2011
@@ -35,7 +35,7 @@ public class VersioningTestGroup extends
 
         addTest(new VersioningSmokeTest());
         addTest(new VersionDeleteTest());
-        addTest(new VersioingStateCreateTest());
+        addTest(new VersioningStateCreateTest());
         addTest(new CheckedOutTest());
     }
 }



Mime
View raw message