chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject svn commit: r1511094 - in /chemistry/opencmis/branches/inmemory-refactoring/src: main/java/org/apache/chemistry/opencmis/inmemory/types/ test/java/org/apache/chemistry/opencmis/inmemory/ test/java/org/apache/chemistry/opencmis/inmemory/query/
Date Tue, 06 Aug 2013 19:45:33 GMT
Author: jens
Date: Tue Aug  6 19:45:32 2013
New Revision: 1511094

URL: http://svn.apache.org/r1511094
Log:
InMemory: adapt incompatible changes of TypeFactpry

Modified:
    chemistry/opencmis/branches/inmemory-refactoring/src/main/java/org/apache/chemistry/opencmis/inmemory/types/DefaultTypeSystemCreator.java
    chemistry/opencmis/branches/inmemory-refactoring/src/test/java/org/apache/chemistry/opencmis/inmemory/ObjectServiceTest.java
    chemistry/opencmis/branches/inmemory-refactoring/src/test/java/org/apache/chemistry/opencmis/inmemory/TypeValidationTest.java
    chemistry/opencmis/branches/inmemory-refactoring/src/test/java/org/apache/chemistry/opencmis/inmemory/UnitTestTypeSystemCreator.java
    chemistry/opencmis/branches/inmemory-refactoring/src/test/java/org/apache/chemistry/opencmis/inmemory/VersionTestTypeSystemCreator.java
    chemistry/opencmis/branches/inmemory-refactoring/src/test/java/org/apache/chemistry/opencmis/inmemory/query/AbstractQueryTest.java

Modified: chemistry/opencmis/branches/inmemory-refactoring/src/main/java/org/apache/chemistry/opencmis/inmemory/types/DefaultTypeSystemCreator.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/branches/inmemory-refactoring/src/main/java/org/apache/chemistry/opencmis/inmemory/types/DefaultTypeSystemCreator.java?rev=1511094&r1=1511093&r2=1511094&view=diff
==============================================================================
--- chemistry/opencmis/branches/inmemory-refactoring/src/main/java/org/apache/chemistry/opencmis/inmemory/types/DefaultTypeSystemCreator.java
(original)
+++ chemistry/opencmis/branches/inmemory-refactoring/src/main/java/org/apache/chemistry/opencmis/inmemory/types/DefaultTypeSystemCreator.java
Tue Aug  6 19:45:32 2013
@@ -29,6 +29,7 @@ import org.apache.chemistry.opencmis.com
 import org.apache.chemistry.opencmis.commons.definitions.MutablePolicyTypeDefinition;
 import org.apache.chemistry.opencmis.commons.definitions.MutableRelationshipTypeDefinition;
 import org.apache.chemistry.opencmis.commons.definitions.MutableSecondaryTypeDefinition;
+import org.apache.chemistry.opencmis.commons.definitions.MutableTypeDefinition;
 import org.apache.chemistry.opencmis.commons.definitions.PropertyDefinition;
 import org.apache.chemistry.opencmis.commons.definitions.TypeDefinition;
 import org.apache.chemistry.opencmis.commons.enums.CmisVersion;
@@ -103,93 +104,81 @@ public class DefaultTypeSystemCreator im
             cmisType2.setDescription("Builtin InMemory type definition MyDocType2");
             typesList.add(cmisType2);
 
-            MutableDocumentTypeDefinition cmisType11;        
-            cmisType11 = typeFactory.createChildDocumentTypeDefinition(cmisType1, null);
-            cmisType11.setId("MyDocType1.1");
+            MutableTypeDefinition cmisType11;        
+            cmisType11 = typeFactory.createChildTypeDefinition(cmisType1, "MyDocType1.1");
             cmisType11.setDisplayName("My Type 3 Level 2");
             cmisType11.setDescription("Builtin InMemory type definition MyDocType1.1");
             typesList.add(cmisType11);
 
-            MutableDocumentTypeDefinition cmisType111;        
-            cmisType111 = typeFactory.createChildDocumentTypeDefinition(cmisType11, null);
-            cmisType111.setId("MyDocType1.1.1");
+            MutableTypeDefinition cmisType111;        
+            cmisType111 = typeFactory.createChildTypeDefinition(cmisType11, "MyDocType1.1.1");
             cmisType111.setDisplayName("My Type 4 Level 3");
             cmisType111.setDescription("Builtin InMemory type definition MyDocType1.1.1");
             typesList.add(cmisType111);
 
-            MutableDocumentTypeDefinition cmisType112;        
-            cmisType112 = typeFactory.createChildDocumentTypeDefinition(cmisType11, null);
+            MutableTypeDefinition cmisType112;        
+            cmisType112 = typeFactory.createChildTypeDefinition(cmisType11, "MyDocType1.1.2");
             cmisType112.setId("MyDocType1.1.2");
             cmisType112.setDisplayName("My Type 5 Level 3");
             cmisType112.setDescription("Builtin InMemory type definition MyDocType1.1.2");
             typesList.add(cmisType112);
 
-            MutableDocumentTypeDefinition cmisType12;        
-            cmisType12 = typeFactory.createChildDocumentTypeDefinition(cmisType1, null);
-            cmisType12.setId("MyDocType1.2");
+            MutableTypeDefinition cmisType12;        
+            cmisType12 = typeFactory.createChildTypeDefinition(cmisType1, "MyDocType1.2");
             cmisType12.setDisplayName("My Type 6 Level 2");
             cmisType12.setDescription("Builtin InMemory type definition MyDocType1.2");
             typesList.add(cmisType12);
 
-            MutableDocumentTypeDefinition cmisType21;        
-            cmisType21 = typeFactory.createChildDocumentTypeDefinition(cmisType2, null);
-            cmisType21.setId("MyDocType2.1");
+            MutableTypeDefinition cmisType21;        
+            cmisType21 = typeFactory.createChildTypeDefinition(cmisType2, "MyDocType2.1");
             cmisType21.setDisplayName("My Type 7 Level 2");
             cmisType21.setDescription("Builtin InMemory type definition MyDocType2.1");
             typesList.add(cmisType21);
 
-            MutableDocumentTypeDefinition cmisType22;        
-            cmisType22 = typeFactory.createChildDocumentTypeDefinition(cmisType2, null);
-            cmisType22.setId("MyDocType2.2");
+            MutableTypeDefinition cmisType22;        
+            cmisType22 = typeFactory.createChildTypeDefinition(cmisType2, "MyDocType2.2");
             cmisType22.setDisplayName("My Type 8 Level 2");
             cmisType22.setDescription("Builtin InMemory type definition MyDocType2.2");
             typesList.add(cmisType22);
 
-            MutableDocumentTypeDefinition cmisType23;        
-            cmisType23 = typeFactory.createChildDocumentTypeDefinition(cmisType2, null);
-            cmisType23.setId("MyDocType2.3");
+            MutableTypeDefinition cmisType23;        
+            cmisType23 = typeFactory.createChildTypeDefinition(cmisType2, "MyDocType2.3");
             cmisType23.setDisplayName("My Type 9 Level 2");
             cmisType23.setDescription("Builtin InMemory type definition MyDocType2.3");
             typesList.add(cmisType23);
 
-            MutableDocumentTypeDefinition cmisType24;        
-            cmisType24 = typeFactory.createChildDocumentTypeDefinition(cmisType2, null);
-            cmisType24.setId("MyDocType2.4");
+            MutableTypeDefinition cmisType24;        
+            cmisType24 = typeFactory.createChildTypeDefinition(cmisType2, "MyDocType2.4");
             cmisType24.setDisplayName("My Type 10 Level 2");
             cmisType24.setDescription("Builtin InMemory type definition MyDocType2.4");
             typesList.add(cmisType24);
 
-            MutableDocumentTypeDefinition cmisType25;        
-            cmisType25 = typeFactory.createChildDocumentTypeDefinition(cmisType2, null);
-            cmisType25.setId("MyDocType2.5");
+            MutableTypeDefinition cmisType25;        
+            cmisType25 = typeFactory.createChildTypeDefinition(cmisType2, "MyDocType2.5");
             cmisType25.setDisplayName("My Type 11 Level 2");
             cmisType25.setDescription("Builtin InMemory type definition MyDocType2.5");
             typesList.add(cmisType25);
 
-            MutableDocumentTypeDefinition cmisType26;        
-            cmisType26 = typeFactory.createChildDocumentTypeDefinition(cmisType2, null);
-            cmisType26.setId("MyDocType2.6");
+            MutableTypeDefinition cmisType26;        
+            cmisType26 = typeFactory.createChildTypeDefinition(cmisType2, "MyDocType2.6");
             cmisType26.setDisplayName("My Type 12 Level 2");
             cmisType26.setDescription("Builtin InMemory type definition MyDocType2.6");
             typesList.add(cmisType26);
 
-            MutableDocumentTypeDefinition cmisType27;        
-            cmisType27 = typeFactory.createChildDocumentTypeDefinition(cmisType2, null);
-            cmisType27.setId("MyDocType2.7");
+            MutableTypeDefinition cmisType27;        
+            cmisType27 = typeFactory.createChildTypeDefinition(cmisType2, "MyDocType2.7");
             cmisType27.setDisplayName("My Type 13 Level 2");
             cmisType27.setDescription("Builtin InMemory type definition MyDocType2.7");
             typesList.add(cmisType27);
 
-            MutableDocumentTypeDefinition cmisType28;        
-            cmisType28 = typeFactory.createChildDocumentTypeDefinition(cmisType2, null);
-            cmisType28.setId("MyDocType2.8");
+            MutableTypeDefinition cmisType28;        
+            cmisType28 = typeFactory.createChildTypeDefinition(cmisType2, "MyDocType2.8");
             cmisType28.setDisplayName("My Type 14 Level 2");
             cmisType28.setDescription("Builtin InMemory type definition MyDocType2.8");
             typesList.add(cmisType28);
 
-            MutableDocumentTypeDefinition cmisType29;        
-            cmisType29 = typeFactory.createChildDocumentTypeDefinition(cmisType2, null);
-            cmisType29.setId("MyDocType2.9");
+            MutableTypeDefinition cmisType29;        
+            cmisType29 = typeFactory.createChildTypeDefinition(cmisType2, "MyDocType2.9");
             cmisType29.setDisplayName("My Type 15 Level 2");
             cmisType29.setDescription("Builtin InMemory type definition MyDocType2.9");
             typesList.add(cmisType29);
@@ -298,15 +287,13 @@ public class DefaultTypeSystemCreator im
             cmisDocTypeTopLevel.setDisplayName("Document type with properties, Level 1");
             cmisDocTypeTopLevel.setDescription("Builtin InMemory type definition " + TOPLEVEL_TYPE);
 
-            MutableDocumentTypeDefinition cmisDocTypeLevel1;        
-            cmisDocTypeLevel1 = typeFactory.createChildDocumentTypeDefinition(cmisDocTypeTopLevel,
null);
-            cmisDocTypeLevel1.setId(LEVEL1_TYPE);
+            MutableTypeDefinition cmisDocTypeLevel1;        
+            cmisDocTypeLevel1 = typeFactory.createChildTypeDefinition(cmisDocTypeTopLevel,
LEVEL1_TYPE);
             cmisDocTypeLevel1.setDisplayName("Document type with inherited properties, Level
2");
             cmisDocTypeLevel1 .setDescription("Builtin InMemory type definition " + LEVEL1_TYPE);
 
-            MutableDocumentTypeDefinition cmisDocTypeLevel2;        
-            cmisDocTypeLevel2 = typeFactory.createChildDocumentTypeDefinition(cmisDocTypeLevel1,
null);
-            cmisDocTypeLevel2.setId(LEVEL2_TYPE);
+            MutableTypeDefinition cmisDocTypeLevel2;        
+            cmisDocTypeLevel2 = typeFactory.createChildTypeDefinition(cmisDocTypeLevel1,
LEVEL2_TYPE);
             cmisDocTypeLevel2.setDisplayName("Document type with inherited properties, Level
3");
             cmisDocTypeLevel2.setDescription("Builtin InMemory type definition " + LEVEL2_TYPE);
 
@@ -346,7 +333,7 @@ public class DefaultTypeSystemCreator im
             // CMIS 1.1 create an item item type
 
             MutableItemTypeDefinition itemType;        
-            itemType = typeFactory.createItemTypeDefinition(CmisVersion.CMIS_1_1, DocumentTypeCreationHelper.getCmisItemType().getId());
// ??? DocumentTypeCreationHelper.getCmisItemType());
+            itemType = typeFactory.createItemTypeDefinition(CmisVersion.CMIS_1_1, DocumentTypeCreationHelper.getCmisItemType().getId());
             itemType.setId(ITEM_TYPE);
             itemType.setDisplayName("MyItemType");
             itemType.setDescription("Builtin InMemory type definition " + ITEM_TYPE);

Modified: chemistry/opencmis/branches/inmemory-refactoring/src/test/java/org/apache/chemistry/opencmis/inmemory/ObjectServiceTest.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/branches/inmemory-refactoring/src/test/java/org/apache/chemistry/opencmis/inmemory/ObjectServiceTest.java?rev=1511094&r1=1511093&r2=1511094&view=diff
==============================================================================
--- chemistry/opencmis/branches/inmemory-refactoring/src/test/java/org/apache/chemistry/opencmis/inmemory/ObjectServiceTest.java
(original)
+++ chemistry/opencmis/branches/inmemory-refactoring/src/test/java/org/apache/chemistry/opencmis/inmemory/ObjectServiceTest.java
Tue Aug  6 19:45:32 2013
@@ -57,6 +57,7 @@ import org.apache.chemistry.opencmis.com
 import org.apache.chemistry.opencmis.commons.definitions.MutablePolicyTypeDefinition;
 import org.apache.chemistry.opencmis.commons.definitions.MutableRelationshipTypeDefinition;
 import org.apache.chemistry.opencmis.commons.definitions.MutableSecondaryTypeDefinition;
+import org.apache.chemistry.opencmis.commons.definitions.MutableTypeDefinition;
 import org.apache.chemistry.opencmis.commons.definitions.PropertyDefinition;
 import org.apache.chemistry.opencmis.commons.definitions.TypeDefinition;
 import org.apache.chemistry.opencmis.commons.enums.Action;
@@ -1695,9 +1696,8 @@ public class ObjectServiceTest extends A
             List<TypeDefinition> typesList = new LinkedList<TypeDefinition>();
  
             try {
-                MutableDocumentTypeDefinition cmisDocumentType;        
-                cmisDocumentType = typeFactory.createChildDocumentTypeDefinition(DocumentTypeCreationHelper.getCmisDocumentType(),
null);
-                cmisDocumentType.setId(TEST_DOCUMENT_TYPE_ID);
+                MutableTypeDefinition cmisDocumentType;        
+                cmisDocumentType = typeFactory.createChildTypeDefinition(DocumentTypeCreationHelper.getCmisDocumentType(),
TEST_DOCUMENT_TYPE_ID);
                 cmisDocumentType.setDisplayName("My Document Type");
                 cmisDocumentType.setDescription("InMemory test type definition " + TEST_DOCUMENT_TYPE_ID);
     
@@ -1752,8 +1752,7 @@ public class ObjectServiceTest extends A
 
         private static DocumentTypeDefinition createCustomTypeWithStringIntProperty() throws
InstantiationException, IllegalAccessException {
             MutableDocumentTypeDefinition cmisDocumentType;        
-            cmisDocumentType = typeFactory.createChildDocumentTypeDefinition(DocumentTypeCreationHelper.getCmisDocumentType(),
null);
-            cmisDocumentType.setId(TEST_CUSTOM_DOCUMENT_TYPE_ID);
+            cmisDocumentType = (MutableDocumentTypeDefinition) typeFactory.createChildTypeDefinition(DocumentTypeCreationHelper.getCmisDocumentType(),
TEST_CUSTOM_DOCUMENT_TYPE_ID);
             cmisDocumentType.setDisplayName("My Custom Document Type");
             cmisDocumentType.setDescription("InMemory test type definition " + TEST_CUSTOM_DOCUMENT_TYPE_ID);
  
@@ -1773,9 +1772,8 @@ public class ObjectServiceTest extends A
         }
 
         private static TypeDefinition createCustomInheritedType(DocumentTypeDefinition baseType)
 throws InstantiationException, IllegalAccessException {
-            MutableDocumentTypeDefinition cmisDocumentType;        
-            cmisDocumentType = typeFactory.createChildDocumentTypeDefinition(baseType, null);
-            cmisDocumentType.setId(TEST_INHERITED_CUSTOM_DOCUMENT_TYPE_ID);
+            MutableTypeDefinition cmisDocumentType;        
+            cmisDocumentType = typeFactory.createChildTypeDefinition(baseType, TEST_INHERITED_CUSTOM_DOCUMENT_TYPE_ID);
             cmisDocumentType.setDisplayName("My Custom Document Type");
             cmisDocumentType.setDescription("InMemory test type definition " + TEST_INHERITED_CUSTOM_DOCUMENT_TYPE_ID);
            
@@ -1792,9 +1790,8 @@ public class ObjectServiceTest extends A
         }
 
         private static TypeDefinition createDocumentTypeWithDefault()  throws InstantiationException,
IllegalAccessException {
-            MutableDocumentTypeDefinition cmisDocumentType;        
-            cmisDocumentType = typeFactory.createChildDocumentTypeDefinition(DocumentTypeCreationHelper.getCmisDocumentType(),
null);
-            cmisDocumentType.setId(TEST_DOC_TYPE_WITH_DEFAULTS_ID);
+            MutableTypeDefinition cmisDocumentType;        
+            cmisDocumentType = typeFactory.createChildTypeDefinition(DocumentTypeCreationHelper.getCmisDocumentType(),
TEST_DOC_TYPE_WITH_DEFAULTS_ID);
             cmisDocumentType.setDisplayName("Document Type With default values");
             cmisDocumentType.setDescription("InMemory test type definition " + TEST_DOC_TYPE_WITH_DEFAULTS_ID);
 
@@ -1824,8 +1821,7 @@ public class ObjectServiceTest extends A
 
         private static TypeDefinition createCustomTypeNoContent()  throws InstantiationException,
IllegalAccessException {
             MutableDocumentTypeDefinition cmisDocumentType;        
-            cmisDocumentType = typeFactory.createChildDocumentTypeDefinition(DocumentTypeCreationHelper.getCmisDocumentType(),
null);
-            cmisDocumentType.setId(TEST_CUSTOM_NO_CONTENT_TYPE_ID);
+            cmisDocumentType = (MutableDocumentTypeDefinition) typeFactory.createChildTypeDefinition(DocumentTypeCreationHelper.getCmisDocumentType(),
TEST_CUSTOM_NO_CONTENT_TYPE_ID);
             cmisDocumentType.setDisplayName("No Content Document Type");
             cmisDocumentType.setDescription("InMemory test type definition " + TEST_CUSTOM_NO_CONTENT_TYPE_ID);
             cmisDocumentType.setContentStreamAllowed(ContentStreamAllowed.NOTALLOWED);
@@ -1834,8 +1830,7 @@ public class ObjectServiceTest extends A
         
         private static TypeDefinition createCustomTypeMustHaveContent()  throws InstantiationException,
IllegalAccessException {
             MutableDocumentTypeDefinition cmisDocumentType;        
-            cmisDocumentType = typeFactory.createChildDocumentTypeDefinition(DocumentTypeCreationHelper.getCmisDocumentType(),
null);
-            cmisDocumentType.setId(TEST_CUSTOM_MUST_CONTENT_TYPE_ID);
+            cmisDocumentType = (MutableDocumentTypeDefinition) typeFactory.createChildTypeDefinition(DocumentTypeCreationHelper.getCmisDocumentType(),
TEST_CUSTOM_MUST_CONTENT_TYPE_ID);
             cmisDocumentType.setDisplayName("Must Have Content Document Type");
             cmisDocumentType.setDescription("InMemory test type definition " + TEST_CUSTOM_MUST_CONTENT_TYPE_ID);
             cmisDocumentType.setContentStreamAllowed(ContentStreamAllowed.NOTALLOWED);
@@ -1951,8 +1946,7 @@ public class ObjectServiceTest extends A
         private static TypeDefinition createVersionableType()  throws InstantiationException,
IllegalAccessException {
             // create a complex type with properties
             MutableDocumentTypeDefinition verType;        
-            verType = typeFactory.createChildDocumentTypeDefinition(DocumentTypeCreationHelper.getCmisDocumentType(),
null);
-            verType.setId(TEST_VERSION_DOCUMENT_TYPE_ID);
+            verType = (MutableDocumentTypeDefinition) typeFactory.createChildTypeDefinition(DocumentTypeCreationHelper.getCmisDocumentType(),
TEST_VERSION_DOCUMENT_TYPE_ID);
             verType.setDisplayName("VersionedType");
             verType.setDescription("InMemory test type definition " + TEST_VERSION_DOCUMENT_TYPE_ID);
 

Modified: chemistry/opencmis/branches/inmemory-refactoring/src/test/java/org/apache/chemistry/opencmis/inmemory/TypeValidationTest.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/branches/inmemory-refactoring/src/test/java/org/apache/chemistry/opencmis/inmemory/TypeValidationTest.java?rev=1511094&r1=1511093&r2=1511094&view=diff
==============================================================================
--- chemistry/opencmis/branches/inmemory-refactoring/src/test/java/org/apache/chemistry/opencmis/inmemory/TypeValidationTest.java
(original)
+++ chemistry/opencmis/branches/inmemory-refactoring/src/test/java/org/apache/chemistry/opencmis/inmemory/TypeValidationTest.java
Tue Aug  6 19:45:32 2013
@@ -472,8 +472,7 @@ public class TypeValidationTest extends 
 
         try {
             MutableDocumentTypeDefinition cmisType;        
-            cmisType = typeFactory.createChildDocumentTypeDefinition(DocumentTypeCreationHelper.getCmisDocumentType(),
null);
-            cmisType.setId(MY_DOC_TYPE);
+            cmisType = (MutableDocumentTypeDefinition) typeFactory.createChildTypeDefinition(DocumentTypeCreationHelper.getCmisDocumentType(),
MY_DOC_TYPE);
             cmisType.setDisplayName("Document Type for Validation");
             cmisType.setDescription("InMemory test type definition " + MY_DOC_TYPE);
  
@@ -559,8 +558,7 @@ public class TypeValidationTest extends 
     private static DocumentTypeDefinition buildTypeWithStringProp() {
         try {
             MutableDocumentTypeDefinition cmisType;        
-            cmisType = typeFactory.createChildDocumentTypeDefinition(DocumentTypeCreationHelper.getCmisDocumentType(),
null);
-            cmisType.setId(STRING_DOC_TYPE);
+            cmisType = (MutableDocumentTypeDefinition) typeFactory.createChildTypeDefinition(DocumentTypeCreationHelper.getCmisDocumentType(),
STRING_DOC_TYPE);
             cmisType.setDisplayName("String Document Type for Validation");
             cmisType.setDescription("InMemory test type definition " + STRING_DOC_TYPE);
 
@@ -579,8 +577,7 @@ public class TypeValidationTest extends 
     private static DocumentTypeDefinition buildTypeWithIntegerProp() {
         try {
             MutableDocumentTypeDefinition cmisType;        
-            cmisType = typeFactory.createChildDocumentTypeDefinition(DocumentTypeCreationHelper.getCmisDocumentType(),
null);
-            cmisType.setId(INT_DOC_TYPE);
+            cmisType = (MutableDocumentTypeDefinition) typeFactory.createChildTypeDefinition(DocumentTypeCreationHelper.getCmisDocumentType(),
INT_DOC_TYPE);
             cmisType.setDisplayName("Int Document Type for Validation");
             cmisType.setDescription("InMemory test type definition " + INT_DOC_TYPE);
 
@@ -601,8 +598,7 @@ public class TypeValidationTest extends 
     private static DocumentTypeDefinition buildTypeWithDecimalProp() {
         try {
             MutableDocumentTypeDefinition cmisType;        
-            cmisType = typeFactory.createChildDocumentTypeDefinition(DocumentTypeCreationHelper.getCmisDocumentType(),
null);
-            cmisType.setId(DECIMAL_DOC_TYPE);
+            cmisType = (MutableDocumentTypeDefinition) typeFactory.createChildTypeDefinition(DocumentTypeCreationHelper.getCmisDocumentType(),
DECIMAL_DOC_TYPE);
             cmisType.setDisplayName("Decimal Type for Validation");
             cmisType.setDescription("InMemory test type definition " + DECIMAL_DOC_TYPE);
 
@@ -623,8 +619,7 @@ public class TypeValidationTest extends 
     public static DocumentTypeDefinition buildTypeWithPickList(Cardinality cardinality) {
         try {
             MutableDocumentTypeDefinition cmisType;        
-            cmisType = typeFactory.createChildDocumentTypeDefinition(DocumentTypeCreationHelper.getCmisDocumentType(),
null);
-            cmisType.setId(PICK_LIST_DOC_TYPE);
+            cmisType = (MutableDocumentTypeDefinition) typeFactory.createChildTypeDefinition(DocumentTypeCreationHelper.getCmisDocumentType(),
PICK_LIST_DOC_TYPE);
             cmisType.setDisplayName("PickList Type for Validation");
             cmisType.setDescription("InMemory test type definition " + PICK_LIST_DOC_TYPE);
 
@@ -662,8 +657,7 @@ public class TypeValidationTest extends 
     public static DocumentTypeDefinition buildTypeWithMultiPickList() {
         try {
             MutableDocumentTypeDefinition cmisType;        
-            cmisType = typeFactory.createChildDocumentTypeDefinition(DocumentTypeCreationHelper.getCmisDocumentType(),
null);
-            cmisType.setId(PICK_LIST_DOC_TYPE);
+            cmisType = (MutableDocumentTypeDefinition) typeFactory.createChildTypeDefinition(DocumentTypeCreationHelper.getCmisDocumentType(),
PICK_LIST_DOC_TYPE);
             cmisType.setDisplayName("MDocument Type for Validation");
             cmisType.setDescription("PickList test type definition " + PICK_LIST_DOC_TYPE);
 
@@ -704,8 +698,7 @@ public class TypeValidationTest extends 
     public static DocumentTypeDefinition buildTypeWithHierachicalPickList(Cardinality cardinality)
{
         try {
             MutableDocumentTypeDefinition cmisType;        
-            cmisType = typeFactory.createChildDocumentTypeDefinition(DocumentTypeCreationHelper.getCmisDocumentType(),
null);
-            cmisType.setId(PICK_LIST_DOC_TYPE);
+            cmisType = (MutableDocumentTypeDefinition) typeFactory.createChildTypeDefinition(DocumentTypeCreationHelper.getCmisDocumentType(),
PICK_LIST_DOC_TYPE);
             cmisType.setDisplayName("PickList Type for Validation");
             cmisType.setDescription("InMemory test type definition " + PICK_LIST_DOC_TYPE);
 
@@ -772,8 +765,7 @@ public class TypeValidationTest extends 
 
             // create super type
             MutableDocumentTypeDefinition cmisSuperType;        
-            cmisSuperType = typeFactory.createChildDocumentTypeDefinition(DocumentTypeCreationHelper.getCmisDocumentType(),
null);
-            cmisSuperType.setId(DOC_TYPE_SUPER);
+            cmisSuperType = (MutableDocumentTypeDefinition) typeFactory.createChildTypeDefinition(DocumentTypeCreationHelper.getCmisDocumentType(),
DOC_TYPE_SUPER);
             cmisSuperType.setDisplayName("Document Type With a child");
             cmisSuperType.setDescription("InMemory test type definition " + DOC_TYPE_SUPER);
 
@@ -787,8 +779,7 @@ public class TypeValidationTest extends 
 
             // create sub type
             MutableDocumentTypeDefinition cmisSubType;        
-            cmisSubType = typeFactory.createChildDocumentTypeDefinition(cmisSuperType, null);
-            cmisSubType.setId(DOC_TYPE_SUB);
+            cmisSubType = (MutableDocumentTypeDefinition) typeFactory.createChildTypeDefinition(cmisSuperType,
DOC_TYPE_SUB);
             cmisSubType.setDisplayName("Document Type With a parent");
             cmisSubType.setDescription("InMemory test type definition " + DOC_TYPE_SUB);
 

Modified: chemistry/opencmis/branches/inmemory-refactoring/src/test/java/org/apache/chemistry/opencmis/inmemory/UnitTestTypeSystemCreator.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/branches/inmemory-refactoring/src/test/java/org/apache/chemistry/opencmis/inmemory/UnitTestTypeSystemCreator.java?rev=1511094&r1=1511093&r2=1511094&view=diff
==============================================================================
--- chemistry/opencmis/branches/inmemory-refactoring/src/test/java/org/apache/chemistry/opencmis/inmemory/UnitTestTypeSystemCreator.java
(original)
+++ chemistry/opencmis/branches/inmemory-refactoring/src/test/java/org/apache/chemistry/opencmis/inmemory/UnitTestTypeSystemCreator.java
Tue Aug  6 19:45:32 2013
@@ -32,6 +32,7 @@ import org.apache.chemistry.opencmis.com
 import org.apache.chemistry.opencmis.commons.definitions.MutableDocumentTypeDefinition;
 import org.apache.chemistry.opencmis.commons.definitions.MutableFolderTypeDefinition;
 import org.apache.chemistry.opencmis.commons.definitions.MutableSecondaryTypeDefinition;
+import org.apache.chemistry.opencmis.commons.definitions.MutableTypeDefinition;
 import org.apache.chemistry.opencmis.commons.definitions.PropertyDefinition;
 import org.apache.chemistry.opencmis.commons.definitions.TypeDefinition;
 import org.apache.chemistry.opencmis.commons.enums.CmisVersion;
@@ -111,112 +112,96 @@ public class UnitTestTypeSystemCreator i
         List<TypeDefinition> typesList = new LinkedList<TypeDefinition>();
 
         try {
-            MutableDocumentTypeDefinition cmisType1;        
-            cmisType1 = typeFactory.createChildDocumentTypeDefinition(DocumentTypeCreationHelper.getCmisDocumentType(),
null);
-            cmisType1.setId(LEVEL1_TYPE);
+            MutableTypeDefinition cmisType1;        
+            cmisType1 = typeFactory.createChildTypeDefinition(DocumentTypeCreationHelper.getCmisDocumentType(),
LEVEL1_TYPE);
             cmisType1.setDisplayName("Document type with inherited properties, Level 2");
             cmisType1.setDescription("Builtin InMemory type definition " + LEVEL1_TYPE);
 
-            cmisType1 = typeFactory.createChildDocumentTypeDefinition(DocumentTypeCreationHelper.getCmisDocumentType(),
null);
-            cmisType1.setId("MyDocType1");
+            cmisType1 = typeFactory.createChildTypeDefinition(DocumentTypeCreationHelper.getCmisDocumentType(),
"MyDocType1");
             cmisType1.setDisplayName("My Type 1 Level 1");
             cmisType1.setDescription("Builtin InMemory type definition MyDocType1");
             typesList.add(cmisType1);
 
-            MutableDocumentTypeDefinition cmisType2;        
-            cmisType2 = typeFactory.createChildDocumentTypeDefinition(DocumentTypeCreationHelper.getCmisDocumentType(),
null);
-            cmisType2.setId("MyDocType2");
+            MutableTypeDefinition cmisType2;        
+            cmisType2 = typeFactory.createChildTypeDefinition(DocumentTypeCreationHelper.getCmisDocumentType(),
"MyDocType2");
             cmisType2.setDisplayName("My Type 2 Level 1");
             cmisType2.setDescription("Builtin InMemory type definition MyDocType2");
             typesList.add(cmisType2);
 
-            MutableDocumentTypeDefinition cmisType11;        
-            cmisType11 = typeFactory.createChildDocumentTypeDefinition(cmisType1, null);
-            cmisType11.setId("MyDocType1.1");
+            MutableTypeDefinition cmisType11;        
+            cmisType11 = typeFactory.createChildTypeDefinition(cmisType1, "MyDocType1.1");
             cmisType11.setDisplayName("My Type 3 Level 2");
             cmisType11.setDescription("Builtin InMemory type definition MyDocType1.1");
             typesList.add(cmisType11);
 
-            MutableDocumentTypeDefinition cmisType111;        
-            cmisType111 = typeFactory.createChildDocumentTypeDefinition(cmisType11, null);
-            cmisType111.setId("MyDocType1.1.1");
+            MutableTypeDefinition cmisType111;        
+            cmisType111 = typeFactory.createChildTypeDefinition(cmisType11, "MyDocType1.1.1");
             cmisType111.setDisplayName("My Type 4 Level 3");
             cmisType111.setDescription("Builtin InMemory type definition MyDocType1.1.1");
             typesList.add(cmisType111);
 
-            MutableDocumentTypeDefinition cmisType112;        
-            cmisType112 = typeFactory.createChildDocumentTypeDefinition(cmisType11, null);
-            cmisType112.setId("MyDocType1.1.2");
+            MutableTypeDefinition cmisType112;        
+            cmisType112 = typeFactory.createChildTypeDefinition(cmisType11, "MyDocType1.1.2");
             cmisType112.setDisplayName("My Type 5 Level 3");
             cmisType112.setDescription("Builtin InMemory type definition MyDocType1.1.2");
             typesList.add(cmisType112);
 
-            MutableDocumentTypeDefinition cmisType12;        
-            cmisType12 = typeFactory.createChildDocumentTypeDefinition(cmisType1, null);
-            cmisType12.setId("MyDocType1.2");
+            MutableTypeDefinition cmisType12;        
+            cmisType12 = typeFactory.createChildTypeDefinition(cmisType1, "MyDocType1.2");
             cmisType12.setDisplayName("My Type 6 Level 2");
             cmisType12.setDescription("Builtin InMemory type definition MyDocType1.2");
             typesList.add(cmisType12);
 
-            MutableDocumentTypeDefinition cmisType21;        
-            cmisType21 = typeFactory.createChildDocumentTypeDefinition(cmisType2, null);
-            cmisType21.setId("MyDocType2.1");
+            MutableTypeDefinition cmisType21;        
+            cmisType21 = typeFactory.createChildTypeDefinition(cmisType2, "MyDocType2.1");
             cmisType21.setDisplayName("My Type 7 Level 2");
             cmisType21.setDescription("Builtin InMemory type definition MyDocType2.1");
             typesList.add(cmisType21);
 
-            MutableDocumentTypeDefinition cmisType22;        
-            cmisType22 = typeFactory.createChildDocumentTypeDefinition(cmisType2, null);
-            cmisType22.setId("MyDocType2.2");
+            MutableTypeDefinition cmisType22;        
+            cmisType22 = typeFactory.createChildTypeDefinition(cmisType2, "MyDocType2.2");
             cmisType22.setDisplayName("My Type 8 Level 2");
             cmisType22.setDescription("Builtin InMemory type definition MyDocType2.2");
             typesList.add(cmisType22);
 
-            MutableDocumentTypeDefinition cmisType23;        
-            cmisType23 = typeFactory.createChildDocumentTypeDefinition(cmisType2, null);
-            cmisType23.setId("MyDocType2.3");
+            MutableTypeDefinition cmisType23;        
+            cmisType23 = typeFactory.createChildTypeDefinition(cmisType2, "MyDocType2.3");
             cmisType23.setDisplayName("My Type 9 Level 2");
             cmisType23.setDescription("Builtin InMemory type definition MyDocType2.3");
             typesList.add(cmisType23);
 
-            MutableDocumentTypeDefinition cmisType24;        
-            cmisType24 = typeFactory.createChildDocumentTypeDefinition(cmisType2, null);
-            cmisType24.setId("MyDocType2.4");
+            MutableTypeDefinition cmisType24;        
+            cmisType24 = typeFactory.createChildTypeDefinition(cmisType2, "MyDocType2.4");
             cmisType24.setDisplayName("My Type 10 Level 2");
             cmisType24.setDescription("Builtin InMemory type definition MyDocType2.4");
             typesList.add(cmisType24);
 
-            MutableDocumentTypeDefinition cmisType25;        
-            cmisType25 = typeFactory.createChildDocumentTypeDefinition(cmisType2, null);
-            cmisType25.setId("MyDocType2.5");
+            MutableTypeDefinition cmisType25;        
+            cmisType25 = typeFactory.createChildTypeDefinition(cmisType2, "MyDocType2.5");
             cmisType25.setDisplayName("My Type 11 Level 2");
             cmisType25.setDescription("Builtin InMemory type definition MyDocType2.5");
             typesList.add(cmisType25);
 
-            MutableDocumentTypeDefinition cmisType26;        
-            cmisType26 = typeFactory.createChildDocumentTypeDefinition(cmisType2, null);
-            cmisType26.setId("MyDocType2.6");
+            MutableTypeDefinition cmisType26;        
+            cmisType26 = typeFactory.createChildTypeDefinition(cmisType2, "MyDocType2.6");
             cmisType26.setDisplayName("My Type 12 Level 2");
             cmisType26.setDescription("Builtin InMemory type definition MyDocType2.6");
             typesList.add(cmisType26);
 
-            MutableDocumentTypeDefinition cmisType27;        
-            cmisType27 = typeFactory.createChildDocumentTypeDefinition(cmisType2, null);
-            cmisType27.setId("MyDocType2.7");
+            MutableTypeDefinition cmisType27;        
+            cmisType27 = typeFactory.createChildTypeDefinition(cmisType2, "MyDocType2.7");
             cmisType27.setDisplayName("My Type 13 Level 2");
             cmisType27.setDescription("Builtin InMemory type definition MyDocType2.7");
             typesList.add(cmisType27);
 
-            MutableDocumentTypeDefinition cmisType28;        
-            cmisType28 = typeFactory.createChildDocumentTypeDefinition(cmisType2, null);
-            cmisType28.setId("MyDocType2.8");
+            MutableTypeDefinition cmisType28;        
+            cmisType28 = typeFactory.createChildTypeDefinition(cmisType2, "MyDocType2.8");
             cmisType28.setDisplayName("My Type 14 Level 2");
             cmisType28.setDescription("Builtin InMemory type definition MyDocType2.8");
             typesList.add(cmisType28);
 
-            MutableDocumentTypeDefinition cmisType29;        
-            cmisType29 = typeFactory.createChildDocumentTypeDefinition(cmisType2, null);
-            cmisType29.setId("MyDocType2.9");
+            MutableTypeDefinition cmisType29;        
+            cmisType29 = typeFactory.createChildTypeDefinition(cmisType2, "MyDocType2.9");
             cmisType29.setDisplayName("My Type 15 Level 2");
             cmisType29.setDescription("Builtin InMemory type definition MyDocType2.9");
             typesList.add(cmisType29);
@@ -316,15 +301,13 @@ public class UnitTestTypeSystemCreator i
             cmisDocTypeTopLevel.setDisplayName("Document type with properties, Level 1");
             cmisDocTypeTopLevel.setDescription("Builtin InMemory type definition " + TOPLEVEL_TYPE);
 
-            MutableDocumentTypeDefinition cmisDocTypeLevel1;        
-            cmisDocTypeLevel1 = typeFactory.createChildDocumentTypeDefinition(cmisDocTypeTopLevel,
null);
-            cmisDocTypeLevel1.setId(LEVEL1_TYPE);
+            MutableTypeDefinition cmisDocTypeLevel1;        
+            cmisDocTypeLevel1 = typeFactory.createChildTypeDefinition(cmisDocTypeTopLevel,
LEVEL1_TYPE);
             cmisDocTypeLevel1.setDisplayName("Document type with inherited properties, Level
2");
             cmisDocTypeLevel1 .setDescription("Builtin InMemory type definition " + LEVEL1_TYPE);
 
-            MutableDocumentTypeDefinition cmisDocTypeLevel2;        
-            cmisDocTypeLevel2 = typeFactory.createChildDocumentTypeDefinition(cmisDocTypeLevel1,
null);
-            cmisDocTypeLevel2.setId(LEVEL2_TYPE);
+            MutableTypeDefinition cmisDocTypeLevel2;        
+            cmisDocTypeLevel2 = typeFactory.createChildTypeDefinition(cmisDocTypeLevel1,
LEVEL2_TYPE);
             cmisDocTypeLevel2.setDisplayName("Document type with inherited properties, Level
3");
             cmisDocTypeLevel2.setDescription("Builtin InMemory type definition " + LEVEL2_TYPE);
 
@@ -342,8 +325,7 @@ public class UnitTestTypeSystemCreator i
 
             // create a versioned type with properties
             MutableDocumentTypeDefinition cmisVersionedType;        
-            cmisVersionedType = typeFactory.createChildDocumentTypeDefinition(DocumentTypeCreationHelper.getCmisDocumentType(),
null);
-            cmisVersionedType.setId(VERSIONED_TYPE);
+            cmisVersionedType = (MutableDocumentTypeDefinition) typeFactory.createChildTypeDefinition(DocumentTypeCreationHelper.getCmisDocumentType(),
VERSIONED_TYPE);
             cmisVersionedType.setDisplayName("Versioned Type");
             cmisVersionedType.setDescription("Builtin InMemory type definition " + VERSIONED_TYPE);
             cmisVersionedType.setIsVersionable(true); // make it a versionable type;

Modified: chemistry/opencmis/branches/inmemory-refactoring/src/test/java/org/apache/chemistry/opencmis/inmemory/VersionTestTypeSystemCreator.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/branches/inmemory-refactoring/src/test/java/org/apache/chemistry/opencmis/inmemory/VersionTestTypeSystemCreator.java?rev=1511094&r1=1511093&r2=1511094&view=diff
==============================================================================
--- chemistry/opencmis/branches/inmemory-refactoring/src/test/java/org/apache/chemistry/opencmis/inmemory/VersionTestTypeSystemCreator.java
(original)
+++ chemistry/opencmis/branches/inmemory-refactoring/src/test/java/org/apache/chemistry/opencmis/inmemory/VersionTestTypeSystemCreator.java
Tue Aug  6 19:45:32 2013
@@ -70,8 +70,7 @@ public class VersionTestTypeSystemCreato
         try {
             // create a complex type with properties
             MutableDocumentTypeDefinition cmisComplexType;        
-            cmisComplexType = typeFactory.createChildDocumentTypeDefinition(DocumentTypeCreationHelper.getCmisDocumentType(),
null);
-            cmisComplexType.setId(VERSION_TEST_DOCUMENT_TYPE_ID);
+            cmisComplexType = (MutableDocumentTypeDefinition) typeFactory.createChildTypeDefinition(DocumentTypeCreationHelper.getCmisDocumentType(),
VERSION_TEST_DOCUMENT_TYPE_ID);
             cmisComplexType.setDisplayName("VersionedType");
             cmisComplexType.setDescription("InMemory test type definition " + VERSION_TEST_DOCUMENT_TYPE_ID);
             cmisComplexType.setIsVersionable(true); // make it a versionable type;

Modified: chemistry/opencmis/branches/inmemory-refactoring/src/test/java/org/apache/chemistry/opencmis/inmemory/query/AbstractQueryTest.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/branches/inmemory-refactoring/src/test/java/org/apache/chemistry/opencmis/inmemory/query/AbstractQueryTest.java?rev=1511094&r1=1511093&r2=1511094&view=diff
==============================================================================
--- chemistry/opencmis/branches/inmemory-refactoring/src/test/java/org/apache/chemistry/opencmis/inmemory/query/AbstractQueryTest.java
(original)
+++ chemistry/opencmis/branches/inmemory-refactoring/src/test/java/org/apache/chemistry/opencmis/inmemory/query/AbstractQueryTest.java
Tue Aug  6 19:45:32 2013
@@ -24,7 +24,7 @@ import java.util.ArrayList;
 import java.util.List;
 
 import org.antlr.runtime.RecognitionException;
-import org.apache.chemistry.opencmis.commons.definitions.MutableDocumentTypeDefinition;
+import org.apache.chemistry.opencmis.commons.definitions.MutableTypeDefinition;
 import org.apache.chemistry.opencmis.commons.definitions.PropertyBooleanDefinition;
 import org.apache.chemistry.opencmis.commons.definitions.PropertyStringDefinition;
 import org.apache.chemistry.opencmis.commons.definitions.TypeDefinition;
@@ -93,8 +93,8 @@ public abstract class AbstractQueryTest 
 
         try {
             // First test type
-            MutableDocumentTypeDefinition cmisType;        
-            cmisType = typeFactory.createChildDocumentTypeDefinition(DocumentTypeCreationHelper.getCmisDocumentType(),
null);
+            MutableTypeDefinition cmisType;        
+            cmisType = typeFactory.createChildTypeDefinition(DocumentTypeCreationHelper.getCmisDocumentType(),
MY_DOC_TYPE);
             cmisType.setId(MY_DOC_TYPE);
             cmisType.setDisplayName("Document Type for Validation");
 
@@ -116,8 +116,7 @@ public abstract class AbstractQueryTest 
             myType = cmisType;
 
             // add another type definition with exactly the same properties
-            cmisType = typeFactory.createChildDocumentTypeDefinition(DocumentTypeCreationHelper.getCmisDocumentType(),
null);
-            cmisType.setId(MY_DOC_TYPE_COPY);
+            cmisType = typeFactory.createChildTypeDefinition(DocumentTypeCreationHelper.getCmisDocumentType(),
MY_DOC_TYPE_COPY);
             cmisType.setDisplayName("Document Type for Duplicated");
 
             // add same properties
@@ -130,8 +129,7 @@ public abstract class AbstractQueryTest 
 
             // Second test type
 
-            cmisType = typeFactory.createChildDocumentTypeDefinition(DocumentTypeCreationHelper.getCmisDocumentType(),
null);
-            cmisType.setId(BOOK_TYPE);
+            cmisType = typeFactory.createChildTypeDefinition(DocumentTypeCreationHelper.getCmisDocumentType(),
BOOK_TYPE);
             cmisType.setDisplayName("Book Document Type");
 
 



Mime
View raw message