chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From f...@apache.org
Subject svn commit: r1797858 - /chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/impl/AbstractSessionTest.java
Date Wed, 07 Jun 2017 07:28:04 GMT
Author: fmui
Date: Wed Jun  7 07:28:04 2017
New Revision: 1797858

URL: http://svn.apache.org/viewvc?rev=1797858&view=rev
Log:
TCK: added check for secondary type properties

Modified:
    chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/impl/AbstractSessionTest.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=1797858&r1=1797857&r2=1797858&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 Jun  7 07:28:04 2017
@@ -2603,7 +2603,26 @@ public abstract class AbstractSessionTes
             }
 
             // check properties
-            if (!BaseTypeId.CMIS_SECONDARY.equals(type.getBaseTypeId())) {
+            if (BaseTypeId.CMIS_SECONDARY.equals(type.getBaseTypeId())) {
+
+                // secondary types should not have a property in the
+                // cmis namespace
+                // this may lead to inconsistencies
+                Map<String, PropertyDefinition<?>> propDefs = type.getPropertyDefinitions();
+                if (propDefs != null) {
+                    for (PropertyDefinition<?> propDef : propDefs.values()) {
+                        if (propDef == null) {
+                            addResult(results, createResult(FAILURE, "A property definition
is null!"));
+                        } else if (propDef.getId() == null) {
+                            addResult(results, createResult(FAILURE, "A property definition
ID is null!"));
+                        } else if (propDef.getId().startsWith("cmis:")) {
+                            f = createResult(WARNING,
+                                    "Found a property definition in the cmis namspace: "
+ propDef.getId());
+                            addResult(results, f);
+                        }
+                    }
+                }
+            } else {
 
                 f = createResult(FAILURE, "Type has no property definitions!");
                 addResult(results, assertNotNull(type.getPropertyDefinitions(), null, f));



Mime
View raw message