chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From f...@apache.org
Subject svn commit: r1458940 - in /chemistry/opencmis/trunk: chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/json/ chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/...
Date Wed, 20 Mar 2013 16:49:55 GMT
Author: fmui
Date: Wed Mar 20 16:49:55 2013
New Revision: 1458940

URL: http://svn.apache.org/r1458940
Log:
TCK: extended type creation tests

Modified:
    chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/json/JSONObject.java
    chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/tests/types/CreateAndDeleteTypeTest.java

Modified: chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/json/JSONObject.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/json/JSONObject.java?rev=1458940&r1=1458939&r2=1458940&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/json/JSONObject.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/json/JSONObject.java
Wed Mar 20 16:49:55 2013
@@ -20,11 +20,11 @@ package org.apache.chemistry.opencmis.co
 
 import java.io.IOException;
 import java.io.Writer;
-import java.util.HashMap;
+import java.util.LinkedHashMap;
 import java.util.Map;
 
 /**
- * A JSON object. Key value pairs are unordered. JSONObject supports
+ * A JSON object. Key value pairs are order by insertion. JSONObject supports
  * java.util.Map interface.
  * 
  * (Taken from JSON.simple <http://code.google.com/p/json-simple/> and modified
@@ -32,7 +32,7 @@ import java.util.Map;
  * 
  * @author FangYidong<fangyidong@yahoo.com.cn>
  */
-public class JSONObject extends HashMap<String, Object> implements Map<String, Object>,
JSONAware, JSONStreamAware {
+public class JSONObject extends LinkedHashMap<String, Object> implements Map<String,
Object>, JSONAware, JSONStreamAware {
 
     private static final long serialVersionUID = 1;
 

Modified: chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/tests/types/CreateAndDeleteTypeTest.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/types/CreateAndDeleteTypeTest.java?rev=1458940&r1=1458939&r2=1458940&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/tests/types/CreateAndDeleteTypeTest.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/tests/types/CreateAndDeleteTypeTest.java
Wed Mar 20 16:49:55 2013
@@ -155,6 +155,22 @@ public class CreateAndDeleteTypeTest ext
                 "The number of defined properties and the number of non-inherited properties
don't match!");
         addResult(assertEquals(newTypeDef.getPropertyDefinitions().size(), newPropDefs.size(),
null, failure));
 
+        // check the order of the properties, which must match the order of the original
type definition
+        // (OpenCMIS keeps the order of the property definitions.)
+        int i = 0;
+        for (Map.Entry<String, PropertyDefinition<?>> propDef : newTypeDef.getPropertyDefinitions().entrySet())
{
+            PropertyDefinition<?> newPropDef = newPropDefs.get(i);
+
+            failure = createResult(FAILURE, "Property " + (i + 1) + " must be of type "
+                    + propDef.getValue().getPropertyType() + " but is of type " + newPropDef.getPropertyType()
+ "!");
+            addResult(assertEquals(propDef.getValue().getPropertyType(), newPropDef.getPropertyType(),
null, failure));
+
+            addResult(createInfoResult("Repository assigned the property '" + propDef.getValue().getId()
+                    + "' the following property id: " + newPropDef.getId()));
+
+            i++;
+        }
+
         // delete the type
         deleteType(session, newType.getId());
     }



Mime
View raw message