You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@chemistry.apache.org by sf...@apache.org on 2011/04/24 18:12:31 UTC

svn commit: r1096340 [5/7] - in /chemistry/opencmis/trunk: chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/ chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/j...

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/types/InMemoryDocumentTypeDefinition.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/types/InMemoryDocumentTypeDefinition.java?rev=1096340&r1=1096339&r2=1096340&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/types/InMemoryDocumentTypeDefinition.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/types/InMemoryDocumentTypeDefinition.java Sun Apr 24 16:12:27 2011
@@ -31,9 +31,7 @@ import org.apache.chemistry.opencmis.inm
 
 /**
  * A small convenience class simplifying document type creation
- * 
  */
-
 public class InMemoryDocumentTypeDefinition extends DocumentTypeDefinitionImpl {
 
     private static final long serialVersionUID = 1L;
@@ -60,19 +58,20 @@ public class InMemoryDocumentTypeDefinit
     public InMemoryDocumentTypeDefinition(String id, String displayName, InMemoryDocumentTypeDefinition parentType) {
         // get root type
         init(id, displayName);
-        if (parentType != null)
+        if (parentType != null) {
             setBaseTypeId(parentType.getBaseTypeId());
-        else
+        } else {
             throw new IllegalArgumentException("Must provide a parent type when creating a document type definition");
+        }
         setParentTypeId(parentType.getId());
     }
 
-    /*
+    /**
      * Set the property definitions for this type. The parameter
      * propertyDefinitions should only contain the custom property definitions
      * for this type. The standard property definitions are added automatically.
-     * 
-     * @seeorg.apache.opencmis.commons.impl.dataobjects.AbstractTypeDefinition#
+     *
+     * @see org.apache.opencmis.commons.impl.dataobjects.AbstractTypeDefinition#
      * setPropertyDefinitions(java.util.Map)
      */
     public void addCustomPropertyDefinitions(Map<String, PropertyDefinition<?>> propertyDefinitions) {
@@ -86,13 +85,15 @@ public class InMemoryDocumentTypeDefinit
     // }
 
     private void init(String id, String displayName) {
-        if (!NameValidator.isValidId(id))
+        if (!NameValidator.isValidId(id)) {
             throw new CmisInvalidArgumentException(NameValidator.ERROR_ILLEGAL_ID);
+        }
 
         setBaseTypeId(BaseTypeId.CMIS_DOCUMENT);
         setId(id);
-        if (displayName == null)
+        if (displayName == null) {
             displayName = '#' + id + '#';
+        }
         setDisplayName(displayName);
         // create some suitable defaults for convenience
         setDescription("Description of " + getDisplayName() + " Type");

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/types/InMemoryFolderTypeDefinition.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/types/InMemoryFolderTypeDefinition.java?rev=1096340&r1=1096339&r2=1096340&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/types/InMemoryFolderTypeDefinition.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/types/InMemoryFolderTypeDefinition.java Sun Apr 24 16:12:27 2011
@@ -54,19 +54,20 @@ public class InMemoryFolderTypeDefinitio
     public InMemoryFolderTypeDefinition(String id, String displayName, InMemoryFolderTypeDefinition parentType) {
         // get root type
         init(id, displayName);
-        if (parentType != null)
+        if (parentType != null) {
             setBaseTypeId(parentType.getBaseTypeId());
-        else
+        } else {
             throw new IllegalArgumentException("Must provide a parent type when creating a folder type definition");
+        }
         setParentTypeId(parentType.getId());
     }
 
-    /*
+    /**
      * Set the property definitions for this type. The parameter
      * propertyDefinitions should only contain the custom property definitions
      * for this type. The standard property definitions are added automatically.
-     * 
-     * @seeorg.apache.opencmis.commons.impl.dataobjects.AbstractTypeDefinition#
+     *
+     * @see org.apache.opencmis.commons.impl.dataobjects.AbstractTypeDefinition#
      * setPropertyDefinitions(java.util.Map)
      */
     public void addCustomPropertyDefinitions(Map<String, PropertyDefinition<?>> propertyDefinitions) {
@@ -74,13 +75,15 @@ public class InMemoryFolderTypeDefinitio
     }
 
     private void init(String id, String displayName) {
-        if (!NameValidator.isValidId(id))
+        if (!NameValidator.isValidId(id)) {
             throw new CmisInvalidArgumentException(NameValidator.ERROR_ILLEGAL_NAME);
+        }
 
         setBaseTypeId(BaseTypeId.CMIS_FOLDER);
         setId(id);
-        if (displayName == null)
+        if (displayName == null) {
             displayName = '#' + id + '#';
+        }
         setDisplayName(displayName);
         // create some suitable defaults for convenience
         setDescription("Description of " + getDisplayName() + " Type");

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/types/InMemoryPolicyTypeDefinition.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/types/InMemoryPolicyTypeDefinition.java?rev=1096340&r1=1096339&r2=1096340&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/types/InMemoryPolicyTypeDefinition.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/types/InMemoryPolicyTypeDefinition.java Sun Apr 24 16:12:27 2011
@@ -54,19 +54,20 @@ public class InMemoryPolicyTypeDefinitio
     public InMemoryPolicyTypeDefinition(String id, String displayName, InMemoryPolicyTypeDefinition parentType) {
         // get root type
         init(id, displayName);
-        if (parentType != null)
+        if (parentType != null) {
             setBaseTypeId(parentType.getBaseTypeId());
-        else
+        } else {
             throw new IllegalArgumentException("Must provide a parent type when creating a policy definition");
+        }
         setParentTypeId(parentType.getId());
     }
 
-    /*
+    /**
      * Set the property definitions for this type. The parameter
      * propertyDefinitions should only contain the custom property definitions
      * for this type. The standard property definitions are added automatically.
-     * 
-     * @seeorg.apache.opencmis.commons.impl.dataobjects.AbstractTypeDefinition#
+     *
+     * @see org.apache.opencmis.commons.impl.dataobjects.AbstractTypeDefinition#
      * setPropertyDefinitions(java.util.Map)
      */
     public void addCustomPropertyDefinitions(Map<String, PropertyDefinition<?>> propertyDefinitions) {
@@ -74,13 +75,15 @@ public class InMemoryPolicyTypeDefinitio
     }
 
     private void init(String id, String displayName) {
-        if (!NameValidator.isValidId(id))
+        if (!NameValidator.isValidId(id)) {
             throw new CmisInvalidArgumentException(NameValidator.ERROR_ILLEGAL_NAME);
+        }
 
         setBaseTypeId(BaseTypeId.CMIS_POLICY);
         setId(id);
-        if (displayName == null)
+        if (displayName == null) {
             displayName = '#' + id + '#';
+        }
         setDisplayName(displayName);
         // create some suitable defaults for convenience
         setDescription("Description of " + getDisplayName() + " Type");

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/types/InMemoryRelationshipTypeDefinition.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/types/InMemoryRelationshipTypeDefinition.java?rev=1096340&r1=1096339&r2=1096340&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/types/InMemoryRelationshipTypeDefinition.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/types/InMemoryRelationshipTypeDefinition.java Sun Apr 24 16:12:27 2011
@@ -55,10 +55,11 @@ public class InMemoryRelationshipTypeDef
             InMemoryRelationshipTypeDefinition parentType) {
         // get root type
         init(id, displayName);
-        if (parentType != null)
+        if (parentType != null) {
             setBaseTypeId(parentType.getBaseTypeId());
-        else
+        } else {
             throw new IllegalArgumentException("Must provide a parent type when creating a relationship definition");
+        }
         setParentTypeId(parentType.getId());
     }
 
@@ -66,7 +67,7 @@ public class InMemoryRelationshipTypeDef
      * Set the property definitions for this type. The parameter
      * propertyDefinitions should only contain the custom property definitions
      * for this type. The standard property definitions are added automatically.
-     * 
+     *
      * @seeorg.apache.opencmis.commons.impl.dataobjects.AbstractTypeDefinition#
      * setPropertyDefinitions(java.util.Map)
      */
@@ -75,13 +76,15 @@ public class InMemoryRelationshipTypeDef
     }
 
     private void init(String id, String displayName) {
-        if (!NameValidator.isValidId(id))
+        if (!NameValidator.isValidId(id)) {
             throw new CmisInvalidArgumentException(NameValidator.ERROR_ILLEGAL_NAME);
+        }
 
         setBaseTypeId(BaseTypeId.CMIS_RELATIONSHIP);
         setId(id);
-        if (displayName == null)
+        if (displayName == null) {
             displayName = '#' + id + '#';
+        }
         setDisplayName(displayName);
         // create some suitable defaults for convenience
         setDescription("Description of " + getDisplayName() + " Type");

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/types/PropertyCreationHelper.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/types/PropertyCreationHelper.java?rev=1096340&r1=1096339&r2=1096340&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/types/PropertyCreationHelper.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/types/PropertyCreationHelper.java Sun Apr 24 16:12:27 2011
@@ -66,12 +66,15 @@ import org.apache.commons.logging.LogFac
 
 /**
  * @author Jens
- * 
+ *
  */
 public class PropertyCreationHelper {
 
     private static final Log log = LogFactory.getLog(PropertyCreationHelper.class);
 
+    private PropertyCreationHelper() {
+    }
+
     public static PropertyBooleanDefinitionImpl createBooleanDefinition(String id, String displayName) {
         PropertyBooleanDefinitionImpl prop = new PropertyBooleanDefinitionImpl();
         createStandardDefinition(prop, id, PropertyType.BOOLEAN, displayName, Cardinality.SINGLE);
@@ -209,7 +212,7 @@ public class PropertyCreationHelper {
         if (fillOptionalPropertyData) {  // add query name, local name, display name
             fillOptionalPropertyData(td, propertiesList);
         }
-        
+
         Properties props = objectFactory.createPropertiesData(propertiesList);
         return props;
     }
@@ -235,7 +238,7 @@ public class PropertyCreationHelper {
             }
         }
 
-        
+
         Map<String, PropertyData<?>> mappedProperties = new HashMap<String, PropertyData<?>>();
         if (requestedIds.containsKey("*")) {
             for (Map.Entry<String, PropertyData<?>> prop : properties.entrySet()) {
@@ -265,7 +268,7 @@ public class PropertyCreationHelper {
         // add functions:
         BindingsObjectFactory objFactory = new BindingsObjectFactoryImpl();
         for (Entry<String, String> funcEntry : requestedFuncs.entrySet()) {
-            PropertyInteger pi = objFactory.createPropertyIntegerData(funcEntry.getKey(), BigInteger.valueOf(100)); 
+            PropertyInteger pi = objFactory.createPropertyIntegerData(funcEntry.getKey(), BigInteger.valueOf(100));
               // fixed dummy value
             mappedProperties.put(funcEntry.getValue(), pi);
         }
@@ -273,15 +276,16 @@ public class PropertyCreationHelper {
         Properties props = new PropertiesImpl(mappedProperties.values());
         return props;
     }
-    
+
    public static ObjectData getObjectData(TypeDefinition typeDef, StoredObject so, String filter, String user,
             Boolean includeAllowableActions, IncludeRelationships includeRelationships, String renditionFilter,
             Boolean includePolicyIds, Boolean includeACL, ExtensionsData extension) {
 
         ObjectDataImpl od = new ObjectDataImpl();
 
-        if (so == null)
+        if (so == null) {
             throw new CmisObjectNotFoundException("Illegal object id: null");
+        }
 
         // build properties collection
         List<String> requestedIds = FilterParser.getRequestedIdsFromFilter(filter);
@@ -292,18 +296,22 @@ public class PropertyCreationHelper {
             AllowableActions allowableActions = DataObjectCreator.fillAllowableActions(so, user);
             od.setAllowableActions(allowableActions);
         }
-        if (null != includeACL && includeACL)
+        if (null != includeACL && includeACL) {
             od.setAcl(null);
+        }
         od.setIsExactAcl(true);
 
-        if (null != includePolicyIds && includePolicyIds)
+        if (null != includePolicyIds && includePolicyIds) {
             od.setPolicyIds(DataObjectCreator.fillPolicyIds(so));
+        }
 
-        if (null != includeRelationships && includeRelationships != IncludeRelationships.NONE)
+        if (null != includeRelationships && includeRelationships != IncludeRelationships.NONE) {
             od.setRelationships(DataObjectCreator.fillRelationships(includeRelationships, so));
+        }
 
-        if (renditionFilter != null && renditionFilter.length() > 0)
+        if (renditionFilter != null && renditionFilter.length() > 0) {
             od.setRenditions(DataObjectCreator.fillRenditions(so));
+        }
 
         od.setProperties(props);
 
@@ -311,7 +319,7 @@ public class PropertyCreationHelper {
         return od;
     }
 
-    public static ObjectData getObjectDataQueryResult(TypeDefinition typeDef, StoredObject so, String user, 
+    public static ObjectData getObjectDataQueryResult(TypeDefinition typeDef, StoredObject so, String user,
             Map<String, String> requestedProperties, Map<String, String> requestedFuncs,
             Boolean includeAllowableActions, IncludeRelationships includeRelationships, String renditionFilter
             ) {
@@ -326,31 +334,36 @@ public class PropertyCreationHelper {
             AllowableActions allowableActions = DataObjectCreator.fillAllowableActions(so, user);
             od.setAllowableActions(allowableActions);
         }
-        
-        if (null != includeRelationships && includeRelationships != IncludeRelationships.NONE)
+
+        if (null != includeRelationships && includeRelationships != IncludeRelationships.NONE) {
             od.setRelationships(DataObjectCreator.fillRelationships(includeRelationships, so));
+        }
 
-        if (renditionFilter != null && renditionFilter.length() > 0)
+        if (renditionFilter != null && renditionFilter.length() > 0) {
             od.setRenditions(DataObjectCreator.fillRenditions(so));
+        }
 
         od.setProperties(props);
 
         return od;
     }
-    
+
     // internal helpers
     private static void createStandardDefinition(AbstractPropertyDefinition<?> prop, String id, PropertyType propType,
             String displayName, Cardinality card) {
 
-        if (!NameValidator.isValidId(id))
-            if (!NameValidator.isValidId(id))
+        if (!NameValidator.isValidId(id)) {
+            if (!NameValidator.isValidId(id)) {
                 throw new CmisInvalidArgumentException(NameValidator.ERROR_ILLEGAL_NAME);
+            }
+        }
 
         prop.setId(id);
-        if (displayName == null)
+        if (displayName == null) {
             prop.setDisplayName("Sample " + prop.getId() + " boolean property");
-        else
+        } else {
             prop.setDisplayName(displayName);
+        }
         prop.setLocalName(id);
         prop.setLocalNamespace("local");
         prop.setQueryName(id);
@@ -364,10 +377,11 @@ public class PropertyCreationHelper {
     }
 
     private static void fillOptionalPropertyData(TypeDefinition td, List<PropertyData<?>> properties) {
-        for (PropertyData<?> pd : properties)
-            fillOptionalPropertyData(td, (AbstractPropertyData<?>) pd);        
+        for (PropertyData<?> pd : properties) {
+            fillOptionalPropertyData(td, (AbstractPropertyData<?>) pd);
+        }
     }
-    
+
     private static void fillOptionalPropertyData(TypeDefinition td, AbstractPropertyData<?> property) {
         PropertyDefinition<?> pd = td.getPropertyDefinitions().get(property.getId());
         if (null != pd) {
@@ -379,5 +393,5 @@ public class PropertyCreationHelper {
             property.setQueryName(queryName);
         }
     }
-    
+
 }

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/AbstractServiceTest.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/AbstractServiceTest.java?rev=1096340&r1=1096339&r2=1096340&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/AbstractServiceTest.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/AbstractServiceTest.java Sun Apr 24 16:12:27 2011
@@ -62,7 +62,7 @@ import org.apache.chemistry.opencmis.inm
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
-public class AbstractServiceTest /* extends TestCase */{
+public class AbstractServiceTest {
 
     private static final Log LOG = LogFactory.getLog(AbstractServiceTest.class);
 
@@ -97,7 +97,7 @@ public class AbstractServiceTest /* exte
         fTypeCreatorClassName = typeCreatorClassName;
     }
 
-    protected void setUp() throws Exception {
+    protected void setUp() {
         // super.setUp();
         LOG.debug("Initializing InMemory Test with type creator class: " + fTypeCreatorClassName);
         Map<String, String> parameters = new HashMap<String, String>();
@@ -138,7 +138,7 @@ public class AbstractServiceTest /* exte
     protected void addParameters(Map<String, String> parameters) {
     }
 
-    protected void tearDown() throws Exception {
+    protected void tearDown() {
         // super.tearDown();
     }
 
@@ -151,8 +151,9 @@ public class AbstractServiceTest /* exte
         String id = null;
         try {
             id = createFolderNoCatch(folderName, parentFolderId, typeId);
-            if (null == id)
+            if (null == id) {
                 fail("createFolder failed.");
+            }
         } catch (Exception e) {
             fail("createFolder() failed with exception: " + e);
         }
@@ -175,8 +176,9 @@ public class AbstractServiceTest /* exte
 
         Properties props = createDocumentProperties(name, typeId);
 
-        if (withContent)
+        if (withContent) {
             contentStream = createContent();
+        }
 
         String id = fObjSvc.createDocument(fRepositoryId, props, folderId, contentStream, versioningState, policies,
                 addACEs, removeACEs, extension);
@@ -188,8 +190,9 @@ public class AbstractServiceTest /* exte
         String id = null;
         try {
             id = createDocumentNoCatch(name , folderId, typeId, versioningState, withContent);
-            if (null == id)
+            if (null == id) {
                 fail("createDocument failed.");
+            }
         } catch (Exception e) {
             fail("createDocument() failed with exception: " + e);
         }
@@ -220,11 +223,11 @@ public class AbstractServiceTest /* exte
     protected ContentStream createContent() {
         return createContent(32);
     }
-    
+
     protected ContentStream createContent(int sizeInKB) {
         return createContent(sizeInKB, 0);
     }
-    
+
     protected ContentStream createContent(int sizeInKB, long maxSizeInKB) {
         ContentStreamDataImpl content = new ContentStreamDataImpl(maxSizeInKB);
         content.setFileName("data.txt");
@@ -233,11 +236,12 @@ public class AbstractServiceTest /* exte
         byte[] b = { 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x0c, 0x0a,
                 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x0c, 0x0a }; // 32
         int noBlocks = len / b.length;
-        
+
         ByteArrayOutputStream ba = new ByteArrayOutputStream(len);
         try {
-            for (int i = 0; i < noBlocks; i++)
+            for (int i = 0; i < noBlocks; i++) {
                 ba.write(b);
+            }
             content.setContent(new ByteArrayInputStream(ba.toByteArray()));
         } catch (IOException e) {
             throw new RuntimeException("Failed to fill content stream with data", e);
@@ -251,12 +255,14 @@ public class AbstractServiceTest /* exte
         content.setMimeType("text/plain");
         int len = 32 * 1024;
         byte[] b = new byte[32];
-        for (int i = 0; i < 32; i++)
+        for (int i = 0; i < 32; i++) {
             b[i] = (byte) Character.getNumericValue(ch);
+        }
         ByteArrayOutputStream ba = new ByteArrayOutputStream(len);
         try {
-            for (int i = 0; i < 1024; i++)
+            for (int i = 0; i < 1024; i++) {
                 ba.write(b);
+            }
             content.setContent(new ByteArrayInputStream(ba.toByteArray()));
         } catch (IOException e) {
             throw new RuntimeException("Failed to fill content stream with data", e);

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/DiscoveryServiceTest.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/DiscoveryServiceTest.java?rev=1096340&r1=1096339&r2=1096340&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/DiscoveryServiceTest.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/DiscoveryServiceTest.java Sun Apr 24 16:12:27 2011
@@ -43,13 +43,13 @@ public class DiscoveryServiceTest extend
 
     @Override
     @Before
-    public void setUp() throws Exception {
+    public void setUp() {
         super.setTypeCreatorClass(ObjectTestTypeSystemCreator.class.getName());
         super.setUp();
     }
 
     @Test
-    public void testQuery() throws Exception {
+    public void testQuery() {
         log.info("starting testQuery() ...");
 
         ObjectGenerator gen = new ObjectGenerator(fFactory, fNavSvc, fObjSvc, fRepositoryId);
@@ -78,7 +78,7 @@ public class DiscoveryServiceTest extend
         ObjectList res = fDiscSvc.query(fRepositoryId, statement, searchAllVersions, includeAllowableActions,
                 includeRelationships, renditionFilter, maxItems, skipCount, null);
         assertEquals(1, res.getObjects().size());
-        
+
         statement = "SELECT " + TEST_DOCUMENT_STRING_PROP_ID + " FROM " + TEST_DOCUMENT_TYPE_ID + " WHERE " + TEST_DOCUMENT_STRING_PROP_ID + "='My Doc StringProperty 1'";
         res = fDiscSvc.query(fRepositoryId, statement, searchAllVersions, includeAllowableActions,
                 includeRelationships, renditionFilter, maxItems, skipCount, null);
@@ -92,7 +92,7 @@ public class DiscoveryServiceTest extend
         assertEquals(7, res.getObjects().size());
 
 
-        /*        
+        /*
         assertEquals(BigInteger.valueOf(9), res.getNumItems());
 
         statement = "SELECT * FROM cmis:folder";
@@ -116,7 +116,7 @@ public class DiscoveryServiceTest extend
     }
 
     @Test
-    public void testQueryPaging() throws Exception {
+    public void testQueryPaging() {
         log.info("starting testQuery() ...");
 
         String statement;
@@ -151,8 +151,9 @@ public class DiscoveryServiceTest extend
                     includeRelationships, renditionFilter, maxItems, skipCount, null);
             hasMoreItems = res.hasMoreItems();
             assertEquals(3, res.getObjects().size());
-            if (res.getNumItems() != null)
+            if (res.getNumItems() != null) {
                 assertEquals(9L, res.getNumItems().longValue());
+            }
             skipCount = skipCount.add(maxItems);
             ++count;
         }

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/MultiFilingTest.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/MultiFilingTest.java?rev=1096340&r1=1096339&r2=1096340&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/MultiFilingTest.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/MultiFilingTest.java Sun Apr 24 16:12:27 2011
@@ -58,13 +58,15 @@ public class MultiFilingTest extends Abs
     private String fId2;
     private String fId11;
 
+    @Override
     @Before
-    public void setUp() throws Exception {
+    public void setUp() {
         super.setUp();
     }
 
+    @Override
     @After
-    public void tearDown() throws Exception {
+    public void tearDown() {
         super.tearDown();
     }
 
@@ -131,10 +133,12 @@ public class MultiFilingTest extends Abs
         boolean foundNewParent = false;
         boolean foundOldParent = false;
         for (ObjectParentData parentData : parents) {
-            if (parentData.getObject().getId().equals(newFolderId))
+            if (parentData.getObject().getId().equals(newFolderId)) {
                 foundNewParent = true;
-            if (parentData.getObject().getId().equals(fId11))
+            }
+            if (parentData.getObject().getId().equals(fId11)) {
                 foundOldParent = true;
+            }
         }
         assertTrue("After move new target should be a parent", foundNewParent);
         assertFalse("After move old source should no longer be a parent", foundOldParent);

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/NavigationServiceTest.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/NavigationServiceTest.java?rev=1096340&r1=1096339&r2=1096340&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/NavigationServiceTest.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/NavigationServiceTest.java Sun Apr 24 16:12:27 2011
@@ -51,13 +51,15 @@ public class NavigationServiceTest exten
     private static final int NUM_ROOT_FOLDERS = 10;
     private String fLevel1FolderId;
 
+    @Override
     @Before
-    public void setUp() throws Exception {
+    public void setUp() {
         super.setUp();
     }
 
+    @Override
     @After
-    public void tearDown() throws Exception {
+    public void tearDown() {
         super.tearDown();
     }
 
@@ -120,8 +122,9 @@ public class NavigationServiceTest exten
 
     private void logFolderContainer(ObjectInFolderContainer folder, int depth) {
         StringBuilder prefix = new StringBuilder();
-        for (int i = 0; i < depth; i++)
+        for (int i = 0; i < depth; i++) {
             prefix.append("   ");
+        }
 
         log.info(prefix + "name: " + folder.getObject().getPathSegment());
         List<ObjectInFolderContainer> children = folder.getChildren();
@@ -202,8 +205,9 @@ public class NavigationServiceTest exten
         if (null != objs) {
             sum = objs.size();
             for (ObjectInFolderContainer obj : objs) {
-                if (null != obj.getChildren())
+                if (null != obj.getChildren()) {
                     sum += getSizeOfDescendants(obj.getChildren());
+                }
             }
         }
         return sum;
@@ -217,8 +221,9 @@ public class NavigationServiceTest exten
                     .getRootFolderType().getId()));
             Properties props = fFactory.createPropertiesData(properties);
             String id = fObjSvc.createFolder(fRepositoryId, props, fRootFolderId, null, null, null, null);
-            if (i == 3) // store one
+            if (i == 3) {
                 fLevel1FolderId = id;
+            }
         }
     }
 

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/ObjectCreator.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/ObjectCreator.java?rev=1096340&r1=1096339&r2=1096340&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/ObjectCreator.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/ObjectCreator.java Sun Apr 24 16:12:27 2011
@@ -69,8 +69,9 @@ public class ObjectCreator {
         String id = null;
         id = fObjSvc.createDocument(fRepositoryId, props, folderId, contentStream, versioningState, policies, addACEs,
                 removeACEs, extension);
-        if (null == id)
+        if (null == id) {
             Assert.fail("createDocument failed.");
+        }
 
         return id;
     }
@@ -79,10 +80,11 @@ public class ObjectCreator {
         List<PropertyData<?>> properties = new ArrayList<PropertyData<?>>();
         properties.add(fFactory.createPropertyIdData(PropertyIds.NAME, name));
         properties.add(fFactory.createPropertyIdData(PropertyIds.OBJECT_TYPE_ID, typeId));
-        if (null != propsToSet)
+        if (null != propsToSet) {
             for (Entry<String, String> propToSet : propsToSet.entrySet()) {
                 properties.add(fFactory.createPropertyStringData(propToSet.getKey(), propToSet.getValue()));
             }
+        }
         Properties props = fFactory.createPropertiesData(properties);
         return props;
     }
@@ -97,8 +99,9 @@ public class ObjectCreator {
         // Bytes
         ByteArrayOutputStream ba = new ByteArrayOutputStream(len);
         try {
-            for (int i = 0; i < 1024; i++)
+            for (int i = 0; i < 1024; i++) {
                 ba.write(b);
+            }
         } catch (IOException e) {
             throw new RuntimeException("Failed to fill content stream with data", e);
         }
@@ -117,8 +120,9 @@ public class ObjectCreator {
         // Bytes
         ByteArrayOutputStream ba = new ByteArrayOutputStream(len);
         try {
-            for (int i = 0; i < 1024; i++)
+            for (int i = 0; i < 1024; i++) {
                 ba.write(b);
+            }
         } catch (IOException e) {
             throw new RuntimeException("Failed to fill content stream with data", e);
         }
@@ -131,12 +135,15 @@ public class ObjectCreator {
      * Compare two streams and return true if they are equal.
      */
     public boolean verifyContent(ContentStream csd1, ContentStream csd2) {
-        if (!csd1.getFileName().equals(csd2.getFileName()))
+        if (!csd1.getFileName().equals(csd2.getFileName())) {
             return false;
-        if (!csd1.getBigLength().equals(csd2.getBigLength()))
+        }
+        if (!csd1.getBigLength().equals(csd2.getBigLength())) {
             return false;
-        if (!csd1.getMimeType().equals(csd2.getMimeType()))
+        }
+        if (!csd1.getMimeType().equals(csd2.getMimeType())) {
             return false;
+        }
         long len = csd1.getBigLength().longValue();
         InputStream s1 = csd1.getStream();
         InputStream s2 = csd2.getStream();
@@ -144,8 +151,9 @@ public class ObjectCreator {
             for (int i = 0; i < len; i++) {
                 int val1 = s1.read();
                 int val2 = s2.read();
-                if (val1 != val2)
+                if (val1 != val2) {
                     return false;
+                }
             }
         } catch (IOException e) {
             e.printStackTrace();

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/ObjectServiceTest.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/ObjectServiceTest.java?rev=1096340&r1=1096339&r2=1096340&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/ObjectServiceTest.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/ObjectServiceTest.java Sun Apr 24 16:12:27 2011
@@ -104,29 +104,32 @@ public class ObjectServiceTest extends A
 
     ObjectCreator fCreator;
 
+    @Override
     @Before
-    public void setUp() throws Exception {
+    public void setUp() {
         super.setTypeCreatorClass(ObjectTestTypeSystemCreator.class.getName());
         super.setUp();
         fCreator = new ObjectCreator(fFactory, fObjSvc, fRepositoryId);
     }
-    
+
+    @Override
     @After
-    public void tearDown() throws Exception {
+    public void tearDown() {
         super.tearDown();
     }
-    
+
     @Override
     protected void addParameters(Map<String, String> parameters) {
         parameters.put(ConfigConstants.MAX_CONTENT_SIZE_KB, Integer.valueOf(MAX_SIZE).toString());
     }
-    
+
     @Test
     public void testCreateDocument() {
         log.info("starting testCreateObject() ...");
         String id = createDocument(fRootFolderId, false);
-        if (id != null)
+        if (id != null) {
             log.info("createDocument succeeded with created id: " + id);
+        }
         log.info("... testCreateObject() finished.");
 
         // test create a document with a folder type, should fail:
@@ -159,14 +162,14 @@ public class ObjectServiceTest extends A
         } catch (Exception e) {
             assertTrue(e instanceof CmisInvalidArgumentException);
         }
-        
+
         try {
             createDocumentNoCatch("", fRootFolderId, DOCUMENT_TYPE_ID, VersioningState.NONE, false);
             fail("Document creation with empty name should fail.");
         } catch (Exception e) {
             assertTrue(e instanceof CmisInvalidArgumentException);
         }
- 
+
         try {
             createDocumentNoCatch("/(%#$�", fRootFolderId, DOCUMENT_TYPE_ID, VersioningState.NONE, false);
             fail("Document creation with ilegal name should fail.");
@@ -182,7 +185,7 @@ public class ObjectServiceTest extends A
             assertTrue(e instanceof CmisNameConstraintViolationException);
         }
     }
-    
+
     @Test
     public void testCreateFolderInvalidNames() {
         try {
@@ -191,14 +194,14 @@ public class ObjectServiceTest extends A
         } catch (Exception e) {
             assertTrue(e instanceof CmisInvalidArgumentException);
         }
-        
+
         try {
             createFolderNoCatch("", fRootFolderId, FOLDER_TYPE_ID);
             fail("Folder creation with empty name should fail.");
         } catch (Exception e) {
             assertTrue(e instanceof CmisInvalidArgumentException);
         }
- 
+
         try {
             createFolderNoCatch("/(%#$�", fRootFolderId, FOLDER_TYPE_ID);
             fail("Folder creation with ilegal name should fail.");
@@ -214,14 +217,15 @@ public class ObjectServiceTest extends A
             assertTrue(e instanceof CmisNameConstraintViolationException);
         }
     }
-     
+
     @Test
     public void testGetObject() {
         log.info("starting testGetObject() ...");
         log.info("  creating object");
         String id = createDocument(fRootFolderId, false);
-        if (id != null)
+        if (id != null) {
             log.info("  createDocument succeeded with created id: " + id);
+        }
 
         log.info("  getting object");
         retrieveDocument(id);
@@ -282,8 +286,9 @@ public class ObjectServiceTest extends A
     public void testCreateDocumentWithContent() {
         log.info("starting testCreateDocumentWithContent() ...");
         String id = createDocument(fRootFolderId, true);
-        if (id != null)
+        if (id != null) {
             log.info("createDocument succeeded with created id: " + id);
+        }
 
         ContentStream sd = fObjSvc.getContentStream(fRepositoryId, id, null, BigInteger.valueOf(-1) /* offset */,
                 BigInteger.valueOf(-1) /* length */, null);
@@ -339,8 +344,9 @@ public class ObjectServiceTest extends A
         try {
             id = fObjSvc.createDocument(fRepositoryId, props, fRootFolderId, contentStream, VersioningState.NONE, policies,
                     addACEs, removeACEs, extension);
-            if (null == id)
+            if (null == id) {
                 fail("createDocument failed.");
+            }
 
             ContentStream sd = fObjSvc.getContentStream(fRepositoryId, id, null, BigInteger.valueOf(-1) /* offset */,
                     BigInteger.valueOf(-1) /* length */, null);
@@ -350,7 +356,7 @@ public class ObjectServiceTest extends A
             fail("createDocument() failed with exception: " + e);
         }
     }
-    
+
     @Test
     public void testCreateDocumentFromSource() {
         log.info("starting testCreateDocumentFromSource() ...");
@@ -363,8 +369,9 @@ public class ObjectServiceTest extends A
             Properties props = createDocumentPropertiesForDocumentFromSource("Document From Source");
             id2 = fObjSvc.createDocumentFromSource(fRepositoryId, id1, props, fRootFolderId, versioningState, null,
                     null, null, null);
-            if (null == id2)
+            if (null == id2) {
                 fail("createDocumentFromSource failed.");
+            }
         } catch (Exception e) {
             fail("createDocumentFromSource() failed with exception: " + e);
         }
@@ -387,8 +394,9 @@ public class ObjectServiceTest extends A
         log.info("  creating object");
 
         String id = createDocumentInheritedProperties(fRootFolderId, false);
-        if (id != null)
+        if (id != null) {
             log.info("  createDocument succeeded with created id: " + id);
+        }
 
         log.info("  getting object");
         try {
@@ -473,8 +481,9 @@ public class ObjectServiceTest extends A
         log.info("Testing to delete a document");
         log.info("  creating object");
         String id = createDocument(fRootFolderId, false);
-        if (id != null)
+        if (id != null) {
             log.info("  createDocument succeeded with created id: " + id);
+        }
 
         log.info("  getting object");
         retrieveDocument(id);
@@ -606,8 +615,9 @@ public class ObjectServiceTest extends A
         log.info("starting testUpdateProperties() ...");
         String oldChangeToken, newChangeToken;
         String id = createDocumentWithCustomType(fRootFolderId, false);
-        if (id != null)
+        if (id != null) {
             log.info("createDocument succeeded with created id: " + id);
+        }
 
         log.info("  getting object");
         try {
@@ -793,8 +803,9 @@ public class ObjectServiceTest extends A
     public void testDefaultPropertiesDocument() {
         log.info("starting testDefaultPropertiesDocument() ...");
         String id = createDocument("DefPropDoc", fRootFolderId, TEST_DOC_TYPE_WITH_DEFAULTS_ID, false);
-        if (id != null)
+        if (id != null) {
             log.info("createDocument succeeded with created id: " + id);
+        }
         ObjectData res = getDocumentObjectData(id);
         Map<String, PropertyData<?>> props = res.getProperties().getProperties();
         PropertyData<?> pd =  props.get(TEST_DOCUMENT_MY_INT_PROP_ID);
@@ -802,29 +813,30 @@ public class ObjectServiceTest extends A
         Object bi = pd.getFirstValue();
         assertNotNull(bi);
         assertEquals(BigInteger.valueOf(100), bi);
-        
+
         pd =  props.get(TEST_DOCUMENT_MY_MULTI_STRING_PROP_ID);
         assertNotNull(pd);
         List<String> valueList = (List<String>) pd.getValues();
         assertNotNull(valueList);
         assertTrue(valueList.contains("Apache"));
         assertTrue(valueList.contains("CMIS"));
-        
+
         pd =  props.get(TEST_DOCUMENT_MY_INT_PROP_ID_MANDATORY_DEFAULT);
         assertNotNull(pd);
         bi = pd.getFirstValue();
         assertNotNull(bi);
         assertEquals(BigInteger.valueOf(100), bi);
-   
+
         log.info("... testDefaultPropertiesDocument() finished.");
     }
-    
+
     @Test
     public void testDefaultPropertiesFolder() {
         log.info("starting testDefaultPropertiesFolder() ...");
         String id = createFolder("DefPropFolder", fRootFolderId, TEST_FOLDER_TYPE_WITH_DEFAULTS_ID);
-        if (id != null)
+        if (id != null) {
             log.info("createDocument succeeded with created id: " + id);
+        }
         ObjectData res = getDocumentObjectData(id);
         Map<String, PropertyData<?>> props = res.getProperties().getProperties();
         PropertyData<?> pd =  props.get(TEST_FOLDER_MY_INT_PROP_ID);
@@ -832,20 +844,20 @@ public class ObjectServiceTest extends A
         Object bi = pd.getFirstValue();
         assertNotNull(bi);
         assertEquals(BigInteger.valueOf(100), bi);
-        
+
         pd =  props.get(TEST_FOLDER_MY_MULTI_STRING_PROP_ID);
         assertNotNull(pd);
         List<String> valueList = (List<String>) pd.getValues();
         assertNotNull(valueList);
         assertTrue(valueList.contains("Apache"));
         assertTrue(valueList.contains("CMIS"));
-        
+
         pd =  props.get(TEST_FOLDER_MY_INT_PROP_ID_MANDATORY_DEFAULT);
         assertNotNull(pd);
         bi = pd.getFirstValue();
         assertNotNull(bi);
         assertEquals(BigInteger.valueOf(100), bi);
-   
+
         log.info("... testDefaultPropertiesFolder() finished.");
     }
 
@@ -854,8 +866,9 @@ public class ObjectServiceTest extends A
         log.info("starting testGetObjectNoObjectIdInFilter() ...");
         log.info("  creating object");
         String id = createDocument(fRootFolderId, false);
-        if (id != null)
+        if (id != null) {
             log.info("  createDocument succeeded with created id: " + id);
+        }
 
         log.info("  getting object");
         String filter = PropertyIds.NAME + "," + PropertyIds.CREATION_DATE + "," + PropertyIds.LAST_MODIFICATION_DATE;
@@ -866,7 +879,7 @@ public class ObjectServiceTest extends A
         log.info("... testGetObjectNoObjectIdInFilter() finished.");
     }
 
-    private void verifyAllowableActionsDocument(Set<Action> actions, boolean isVersioned, boolean hasContent) {
+    private static void verifyAllowableActionsDocument(Set<Action> actions, boolean isVersioned, boolean hasContent) {
         assertTrue(actions.contains(Action.CAN_DELETE_OBJECT));
         assertTrue(actions.contains(Action.CAN_UPDATE_PROPERTIES));
         assertTrue(actions.contains(Action.CAN_GET_PROPERTIES));
@@ -947,8 +960,9 @@ public class ObjectServiceTest extends A
         gen.dumpFolder(fRootFolderId, propertyFilter);
         Holder<String> holder = new Holder<String>();
         String sourceIdToMove = gen.getFolderId(rootFolderId, 2, 1);
-        if (!isFolder) // get first document in this folder
+        if (!isFolder) {
             sourceIdToMove = gen.getDocumentId(sourceIdToMove, 0);
+        }
         holder.setValue(sourceIdToMove); // "/Folder_1/My Folder 0/My Folder 1");
         String sourceFolderId = getSourceFolder(sourceIdToMove);
         log.info("Id before moveObject: " + holder.getValue());
@@ -1032,15 +1046,17 @@ public class ObjectServiceTest extends A
 
         Properties props = fFactory.createPropertiesData(properties);
 
-        if (withContent)
+        if (withContent) {
             contentStream = createContent();
+        }
 
         // create the document
         String id = null;
         id = fObjSvc.createDocument(fRepositoryId, props, folderId, contentStream, versioningState, policies, addACEs,
                 removeACEs, extension);
-        if (null == id)
+        if (null == id) {
             throw new RuntimeException("createDocument failed.");
+        }
         return id;
     }
 
@@ -1065,15 +1081,17 @@ public class ObjectServiceTest extends A
 
         Properties props = fFactory.createPropertiesData(properties);
 
-        if (withContent)
+        if (withContent) {
             contentStream = createContent();
+        }
 
         // create the document
         String id = null;
         id = fObjSvc.createDocument(fRepositoryId, props, folderId, contentStream, versioningState, policies, addACEs,
                 removeACEs, extension);
-        if (null == id)
+        if (null == id) {
             throw new RuntimeException("createDocument failed.");
+        }
         return id;
     }
 
@@ -1163,7 +1181,7 @@ public class ObjectServiceTest extends A
             cmisDocumentType.addCustomPropertyDefinitions(propertyDefinitions);
             return cmisDocumentType;
         }
-        
+
         private static InMemoryDocumentTypeDefinition createDocumentTypeWithDefault() {
             InMemoryDocumentTypeDefinition cmisDocumentType = new InMemoryDocumentTypeDefinition(
                     TEST_DOC_TYPE_WITH_DEFAULTS_ID, "Document Type With default values", InMemoryDocumentTypeDefinition
@@ -1182,16 +1200,16 @@ public class ObjectServiceTest extends A
             List<BigInteger> defVal = new ArrayList<BigInteger>() {{ add(BigInteger.valueOf(100)); }};
             prop2.setDefaultValue(defVal);
             propertyDefinitions.put(prop2.getId(), prop2);
-            
+
             PropertyIntegerDefinitionImpl prop3 = PropertyCreationHelper.createIntegerDefinition(
                     TEST_DOCUMENT_MY_INT_PROP_ID_MANDATORY_DEFAULT, "Test Integer Property Mandatory default");
             prop3.setIsRequired(true);
             List<BigInteger> defVal2 = new ArrayList<BigInteger>() {{ add(BigInteger.valueOf(100)); }};
             prop3.setDefaultValue(defVal2);
-            propertyDefinitions.put(prop3.getId(), prop3);          
+            propertyDefinitions.put(prop3.getId(), prop3);
 
             cmisDocumentType.addCustomPropertyDefinitions(propertyDefinitions);
-            
+
             return cmisDocumentType;
         }
 
@@ -1213,16 +1231,16 @@ public class ObjectServiceTest extends A
             List<BigInteger> defVal = new ArrayList<BigInteger>() {{ add(BigInteger.valueOf(100)); }};
             prop2.setDefaultValue(defVal);
             propertyDefinitions.put(prop2.getId(), prop2);
-            
+
             PropertyIntegerDefinitionImpl prop3 = PropertyCreationHelper.createIntegerDefinition(
                     TEST_FOLDER_MY_INT_PROP_ID_MANDATORY_DEFAULT, "Test Integer Property Mandatory default");
             prop3.setIsRequired(true);
             List<BigInteger> defVal2 = new ArrayList<BigInteger>() {{ add(BigInteger.valueOf(100)); }};
             prop3.setDefaultValue(defVal2);
-            propertyDefinitions.put(prop3.getId(), prop3);          
+            propertyDefinitions.put(prop3.getId(), prop3);
 
             cmisFolderType.addCustomPropertyDefinitions(propertyDefinitions);
-            
+
             return cmisFolderType;
         }
     }
@@ -1231,7 +1249,7 @@ public class ObjectServiceTest extends A
     public void testMaxContentSize() {
         log.info("starting testMaxContentSize() ...");
         try {
-            createContent(MAX_SIZE + 1, MAX_SIZE); 
+            createContent(MAX_SIZE + 1, MAX_SIZE);
             fail("createContent with exceeded content size should fail.");
         } catch (CmisInvalidArgumentException e) {
             log.debug("createDocument with exceeded failed as excpected.");
@@ -1239,7 +1257,7 @@ public class ObjectServiceTest extends A
             log.debug("createDocument with exceeded failed with wrong exception (expected CmisInvalidArgumentException, got "
                     + e1.getClass().getName() + ").");
         }
-        
+
         try {
             ContentStream contentStream = createContent(MAX_SIZE + 1);
             Properties props = createDocumentProperties("TestMaxContentSize", DOCUMENT_TYPE_ID);
@@ -1253,5 +1271,5 @@ public class ObjectServiceTest extends A
                     + e1.getClass().getName() + ").");
         }
     }
-    
+
 }

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/RepositoryServiceTest.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/RepositoryServiceTest.java?rev=1096340&r1=1096339&r2=1096340&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/RepositoryServiceTest.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/RepositoryServiceTest.java Sun Apr 24 16:12:27 2011
@@ -118,19 +118,21 @@ public class RepositoryServiceTest exten
         }
     }
 
+    @Override
     @Before
-    public void setUp() throws Exception {
+    public void setUp() {
         super.setTypeCreatorClass(RepositoryTestTypeSystemCreator.class.getName());
         super.setUp();
     }
 
+    @Override
     @After
-    public void tearDown() throws Exception {
+    public void tearDown() {
         super.tearDown();
     }
 
     @Test
-    public void testRepositoryInfo() throws Exception {
+    public void testRepositoryInfo() {
         log.info("starting testRepositoryInfo() ...");
         List<RepositoryInfo> repositories = fRepSvc.getRepositoryInfos(null);
         assertNotNull(repositories);
@@ -149,7 +151,7 @@ public class RepositoryServiceTest exten
     }
 
     @Test
-    public void testTypeDefinition() throws Exception {
+    public void testTypeDefinition() {
         log.info("");
         log.info("starting testTypeDefinition() ...");
         String repositoryId = getRepositoryId();
@@ -358,7 +360,7 @@ public class RepositoryServiceTest exten
 
         log.info("... testGetTypeChildrenNoProperties() finished.");
     }
-    
+
     @Test
     public void testGetWrongParameters() {
         log.info("");
@@ -497,24 +499,27 @@ public class RepositoryServiceTest exten
 
     private boolean containsTypeByIdRecursive(String typeId, List<TypeDefinitionContainer> types) {
         for (TypeDefinitionContainer type : types) {
-            if (containsTypeByIdRecursive(typeId, type))
+            if (containsTypeByIdRecursive(typeId, type)) {
                 return true;
+            }
         }
         return false;
     }
 
     private boolean containsTypeByIdRecursive(String typeId, TypeDefinitionContainer typeContainer) {
-        if (typeId.equals(typeContainer.getTypeDefinition().getId()))
+        if (typeId.equals(typeContainer.getTypeDefinition().getId())) {
             return true;
+        }
 
         for (TypeDefinitionContainer type : typeContainer.getChildren()) {
-            if (containsTypeByIdRecursive(typeId, type))
+            if (containsTypeByIdRecursive(typeId, type)) {
                 return true;
+            }
         }
         return false;
     }
 
-    private void containsAllBasePropertyDefinitions(TypeDefinition typeDef) {
+    private static void containsAllBasePropertyDefinitions(TypeDefinition typeDef) {
         Map<String, PropertyDefinition<?>> propDefs = typeDef.getPropertyDefinitions();
         String baseTypeId = typeDef.getBaseTypeId().value();
 
@@ -553,17 +558,20 @@ public class RepositoryServiceTest exten
         } else if (baseTypeId.equals(BaseTypeId.CMIS_RELATIONSHIP.value())) {
             assertTrue(propDefs.containsKey(PropertyIds.SOURCE_ID));
             assertTrue(propDefs.containsKey(PropertyIds.TARGET_ID));
-        } else
+        } else {
             fail("Unknown base type id in type definition");
+        }
     }
 
     private int getRecursiveSize(List<TypeDefinitionContainer> types) {
-        if (null == types)
+        if (null == types) {
             return 0;
+        }
 
         int size = types.size();
-        for (TypeDefinitionContainer type : types)
+        for (TypeDefinitionContainer type : types) {
             size += getRecursiveSize(type.getChildren());
+        }
 
         return size;
     }
@@ -773,9 +781,11 @@ public class RepositoryServiceTest exten
         }
 
         public static TypeDefinition getTypeById(String typeId) {
-            for (TypeDefinition typeDef : singletonTypes)
-                if (typeDef.getId().equals(typeId))
+            for (TypeDefinition typeDef : singletonTypes) {
+                if (typeDef.getId().equals(typeId)) {
                     return typeDef;
+                }
+            }
             return null;
         }
 

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/TypeValidationTest.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/TypeValidationTest.java?rev=1096340&r1=1096339&r2=1096340&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/TypeValidationTest.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/TypeValidationTest.java Sun Apr 24 16:12:27 2011
@@ -51,8 +51,6 @@ import org.apache.chemistry.opencmis.inm
 import org.apache.chemistry.opencmis.inmemory.types.PropertyCreationHelper;
 import org.apache.chemistry.opencmis.server.support.TypeManager;
 import org.apache.chemistry.opencmis.server.support.TypeValidator;
-import org.junit.After;
-import org.junit.Before;
 import org.junit.Test;
 
 /**
@@ -75,7 +73,7 @@ public class TypeValidationTest extends 
     private static final String STRING_PROP_TYPE_SUB = "StringPropSub";
     private static final BindingsObjectFactory FACTORY = new BindingsObjectFactoryImpl();
 
-    private List<PropertyData<?>> createPropertiesWithNameAndTypeId(String typeId) {
+    private static List<PropertyData<?>> createPropertiesWithNameAndTypeId(String typeId) {
         List<PropertyData<?>> properties = new ArrayList<PropertyData<?>>();
         properties.add(FACTORY.createPropertyIdData(PropertyIds.NAME, "Document_1"));
         properties.add(FACTORY.createPropertyIdData(PropertyIds.OBJECT_TYPE_ID, typeId));
@@ -402,7 +400,7 @@ public class TypeValidationTest extends 
 
     /**
      * create sample type
-     * 
+     *
      * @return type definition of sample type
      */
     private static InMemoryDocumentTypeDefinition buildMyType() {

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/VersionTestTypeSystemCreator.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/VersionTestTypeSystemCreator.java?rev=1096340&r1=1096339&r2=1096340&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/VersionTestTypeSystemCreator.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/VersionTestTypeSystemCreator.java Sun Apr 24 16:12:27 2011
@@ -47,15 +47,17 @@ public class VersionTestTypeSystemCreato
     }
 
     public static TypeDefinition getTypeById(String typeId) {
-        for (TypeDefinition typeDef : singletonTypes)
-            if (typeDef.getId().equals(typeId))
+        for (TypeDefinition typeDef : singletonTypes) {
+            if (typeDef.getId().equals(typeId)) {
                 return typeDef;
+            }
+        }
         return null;
     }
 
     /**
      * create root types and a collection of sample types
-     * 
+     *
      * @return typesMap map filled with created types
      */
     private static List<TypeDefinition> buildTypesList() {

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/VersioningTest.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/VersioningTest.java?rev=1096340&r1=1096339&r2=1096340&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/VersioningTest.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/VersioningTest.java Sun Apr 24 16:12:27 2011
@@ -70,16 +70,18 @@ public class VersioningTest extends Abst
 
     ObjectCreator fCreator;
 
+    @Override
     @Before
-    public void setUp() throws Exception {
+    public void setUp() {
         super.setTypeCreatorClass(VersionTestTypeSystemCreator.class.getName());
         super.setUp();
         fCreator = new ObjectCreator(fFactory, fObjSvc, fRepositoryId);
         setRuntimeContext(TEST_USER);
     }
 
+    @Override
     @After
-    public void tearDown() throws Exception {
+    public void tearDown() {
         super.tearDown();
     }
 
@@ -480,7 +482,7 @@ public class VersioningTest extends Abst
         checkVersionProperties(verId, versioningState, allVersions.get(0).getProperties().getProperties(), null);
     }
 
-    private String getVersionSeriesId(String docId, Map<String, PropertyData<?>> props) {
+    private static String getVersionSeriesId(String docId, Map<String, PropertyData<?>> props) {
         PropertyId pdid = (PropertyId) props.get(PropertyIds.VERSION_SERIES_ID);
         assertNotNull(pdid);
         String sVal = pdid.getFirstValue();
@@ -493,12 +495,11 @@ public class VersioningTest extends Abst
         return isCheckedOut(props.getProperties());
     }
 
-    private boolean isCheckedOut(Map<String, PropertyData<?>> props) {
+    private static boolean isCheckedOut(Map<String, PropertyData<?>> props) {
         PropertyBoolean pdb = (PropertyBoolean) props.get(PropertyIds.IS_VERSION_SERIES_CHECKED_OUT);
         assertNotNull(pdb);
         boolean bVal = pdb.getFirstValue();
         return bVal;
-
     }
 
     private void checkVersionProperties(String docId, VersioningState versioningState,
@@ -535,10 +536,11 @@ public class VersioningTest extends Abst
         PropertyId pdid = (PropertyId) props.get(PropertyIds.VERSION_SERIES_ID);
         assertNotNull(pdb);
         String sVal = pdid.getFirstValue();
-        if (typeDef.isVersionable())
+        if (typeDef.isVersionable()) {
             assertFalse(docId.equals(sVal));
-        else
+        } else {
             assertEquals(docId, sVal);
+        }
 
         pdb = (PropertyBoolean) props.get(PropertyIds.IS_VERSION_SERIES_CHECKED_OUT);
         assertNotNull(pdb);
@@ -548,29 +550,33 @@ public class VersioningTest extends Abst
         PropertyString pds = (PropertyString) props.get(PropertyIds.VERSION_SERIES_CHECKED_OUT_BY);
         assertNotNull(pdb);
         sVal = pds.getFirstValue();
-        if (versioningState == VersioningState.CHECKEDOUT)
+        if (versioningState == VersioningState.CHECKEDOUT) {
             assertTrue(sVal != null && sVal.length() > 0);
-        else
+        } else {
             assertTrue(null == sVal || sVal.equals(""));
+        }
 
         pdid = (PropertyId) props.get(PropertyIds.VERSION_SERIES_CHECKED_OUT_ID);
         assertNotNull(pdid);
         sVal = pdid.getFirstValue();
-        if (versioningState == VersioningState.CHECKEDOUT)
+        if (versioningState == VersioningState.CHECKEDOUT) {
             assertTrue(sVal != null && sVal.length() > 0);
-        else
+        } else {
             assertTrue(null == sVal || sVal.equals(""));
+        }
 
         pds = (PropertyString) props.get(PropertyIds.CHECKIN_COMMENT);
         assertNotNull(pdb);
         sVal = pds.getFirstValue();
-        if (checkinComment == null)
+        if (checkinComment == null) {
             assertTrue(null == sVal);
-        else
+        } else {
             assertEquals(checkinComment, sVal);
+        }
 
     }
 
+    @Override
     public String getDocument(String id) {
         String returnedId = null;
         try {
@@ -586,7 +592,7 @@ public class VersioningTest extends Abst
         return returnedId;
     }
 
-    private void testReturnedProperties(Map<String, PropertyData<?>> props) {
+    private static void testReturnedProperties(Map<String, PropertyData<?>> props) {
         for (PropertyData<?> pd : props.values()) {
             log.info("return property id: " + pd.getId() + ", value: " + pd.getValues());
         }

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/query/AbstractQueryConditionProcessor.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/query/AbstractQueryConditionProcessor.java?rev=1096340&r1=1096339&r2=1096340&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/query/AbstractQueryConditionProcessor.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/query/AbstractQueryConditionProcessor.java Sun Apr 24 16:12:27 2011
@@ -45,6 +45,7 @@ import org.apache.commons.logging.LogFac
 public abstract class AbstractQueryConditionProcessor implements QueryConditionProcessor {
 
     private static final Log LOG = LogFactory.getLog(ProcessQueryTest.class);
+
     public abstract void onStartProcessing(Tree whereNode);
     public abstract void onStopProcessing();
 
@@ -122,7 +123,7 @@ public abstract class AbstractQueryCondi
             evalWhereNode(whereNode);
             onStopProcessing();
         }
-        return null; // unused 
+        return null; // unused
     }
 
     // ///////////////////////////////////////////////////////
@@ -285,10 +286,11 @@ public abstract class AbstractQueryCondi
         case CmisQlStrictLexer.BOOL_LIT:
             return Boolean.parseBoolean(node.getText());
         case CmisQlStrictLexer.NUM_LIT:
-            if (text.contains(".") || text.contains("e") || text.contains("E"))
+            if (text.contains(".") || text.contains("e") || text.contains("E")) {
                 return Double.parseDouble(text);
-            else
+            } else {
                 return Long.parseLong(text);
+            }
         case CmisQlStrictLexer.STRING_LIT:
             return text.substring(1, text.length()-1);
         case CmisQlStrictLexer.TIME_LIT:

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/query/AbstractQueryTest.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/query/AbstractQueryTest.java?rev=1096340&r1=1096339&r2=1096340&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/query/AbstractQueryTest.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/query/AbstractQueryTest.java Sun Apr 24 16:12:27 2011
@@ -49,7 +49,7 @@ public abstract class AbstractQueryTest 
     PredicateWalkerBase predicateWalker;
     protected TypeDefinition myType, myTypeCopy, bookType;
     protected QueryUtil queryUtil;
-    
+
     protected static final String MY_DOC_TYPE = "MyDocType";
     protected static final String MY_DOC_TYPE_COPY = "MyDocTypeCopy";
     protected static final String BOOL_PROP = "MyBooleanProp";
@@ -70,19 +70,19 @@ public abstract class AbstractQueryTest 
 
     protected CmisQueryWalker traverseStatement(String statement) throws UnsupportedEncodingException, IOException, RecognitionException {
         walker =  queryUtil.traverseStatement(statement,queryObj, predicateWalker);
-        return walker;        
+        return walker;
     }
-    
+
     protected CmisQueryWalker traverseStatementAndCatchExc(String statement) {
         walker = queryUtil.traverseStatementAndCatchExc(statement, queryObj, predicateWalker);
         return walker;
     }
-    
-    protected CmisQueryWalker getWalker(String statement) throws UnsupportedEncodingException, IOException, RecognitionException {
-        walker = queryUtil.getWalker(statement);
+
+    protected CmisQueryWalker getWalker(String statement) throws RecognitionException {
+        walker = QueryUtil.getWalker(statement);
         return walker;
     }
-    
+
     protected Tree getWhereTree(Tree root) {
         int count = root.getChildCount();
         for (int i=0; i<count; i++) {
@@ -99,7 +99,7 @@ public abstract class AbstractQueryTest 
     protected  List<TypeDefinition> createTypes() {
 
         List<TypeDefinition> typeDefs = new ArrayList<TypeDefinition>();
-        
+
         // First test type
         InMemoryDocumentTypeDefinition cmisType = new InMemoryDocumentTypeDefinition(MY_DOC_TYPE,
                 "Document Type for Validation", InMemoryDocumentTypeDefinition.getRootDocumentType());
@@ -154,10 +154,10 @@ public abstract class AbstractQueryTest 
         propertyDefinitions.put(prop4.getId(), prop4);
 
         cmisType.setPropertyDefinitions(propertyDefinitions);
-        
+
         typeDefs.add(cmisType);
         bookType = cmisType;
-        
+
         return typeDefs;
     }