chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sklev...@apache.org
Subject svn commit: r945011 - in /incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/test/java/org/apache/chemistry/opencmis/client/runtime: CacheTest.java CmisObjectMock.java CmisObjectMockData.java
Date Mon, 17 May 2010 08:15:44 GMT
Author: sklevenz
Date: Mon May 17 08:15:44 2010
New Revision: 945011

URL: http://svn.apache.org/viewvc?rev=945011&view=rev
Log:
EasyMock dependency removed
- test case adapted

Added:
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/test/java/org/apache/chemistry/opencmis/client/runtime/CmisObjectMock.java
  (with props)
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/test/java/org/apache/chemistry/opencmis/client/runtime/CmisObjectMockData.java
  (with props)
Modified:
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/test/java/org/apache/chemistry/opencmis/client/runtime/CacheTest.java

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/test/java/org/apache/chemistry/opencmis/client/runtime/CacheTest.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/test/java/org/apache/chemistry/opencmis/client/runtime/CacheTest.java?rev=945011&r1=945010&r2=945011&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/test/java/org/apache/chemistry/opencmis/client/runtime/CacheTest.java
(original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/test/java/org/apache/chemistry/opencmis/client/runtime/CacheTest.java
Mon May 17 08:15:44 2010
@@ -18,9 +18,6 @@
  */
 package org.apache.chemistry.opencmis.client.runtime;
 
-import static org.easymock.EasyMock.createNiceMock;
-import static org.easymock.EasyMock.expect;
-import static org.easymock.EasyMock.replay;
 
 import java.io.IOException;
 import java.io.ObjectInputStream;
@@ -133,13 +130,7 @@ public class CacheTest {
      * @param path
      * @return a mocked object
      */
-    private CmisObject createCmisObject(String id) {
-        CmisObject obj = createNiceMock(CmisObject.class);
-
-        expect(obj.getId()).andReturn(id).anyTimes();
-
-        replay(obj);
-
-        return obj;
+    private CmisObject createCmisObject(final String id) {
+        return new CmisObjectMock(id);
     }
 }

Added: incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/test/java/org/apache/chemistry/opencmis/client/runtime/CmisObjectMock.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/test/java/org/apache/chemistry/opencmis/client/runtime/CmisObjectMock.java?rev=945011&view=auto
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/test/java/org/apache/chemistry/opencmis/client/runtime/CmisObjectMock.java
(added)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/test/java/org/apache/chemistry/opencmis/client/runtime/CmisObjectMock.java
Mon May 17 08:15:44 2010
@@ -0,0 +1,196 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.chemistry.opencmis.client.runtime;
+
+import java.io.Serializable;
+import java.util.GregorianCalendar;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.chemistry.opencmis.client.api.CmisObject;
+import org.apache.chemistry.opencmis.client.api.ItemIterable;
+import org.apache.chemistry.opencmis.client.api.ObjectId;
+import org.apache.chemistry.opencmis.client.api.ObjectType;
+import org.apache.chemistry.opencmis.client.api.OperationContext;
+import org.apache.chemistry.opencmis.client.api.Policy;
+import org.apache.chemistry.opencmis.client.api.Property;
+import org.apache.chemistry.opencmis.client.api.Relationship;
+import org.apache.chemistry.opencmis.client.api.Rendition;
+import org.apache.chemistry.opencmis.commons.api.Ace;
+import org.apache.chemistry.opencmis.commons.api.Acl;
+import org.apache.chemistry.opencmis.commons.api.AllowableActions;
+import org.apache.chemistry.opencmis.commons.enums.AclPropagation;
+import org.apache.chemistry.opencmis.commons.enums.BaseTypeId;
+import org.apache.chemistry.opencmis.commons.enums.RelationshipDirection;
+
+public class CmisObjectMock implements CmisObject, Serializable {
+
+    /**
+     * 
+     */
+    private static final long serialVersionUID = 1L;
+
+    private String id;
+    
+    public CmisObjectMock(String id) {
+        this.id = id;
+    }
+    
+    public void addAcl(List<Ace> addAces, AclPropagation aclPropagation) {
+    }
+
+    public Acl applyAcl(List<Ace> addAces, List<Ace> removeAces, AclPropagation
aclPropagation) {
+        return null;
+    }
+
+    public void applyPolicy(ObjectId policyId) {
+    }
+
+    public void delete(boolean allVersions) {
+    }
+
+    public Acl getAcl() {
+        return null;
+    }
+
+    public Acl getAcl(boolean onlyBasicPermissions) {
+        return null;
+    }
+
+    public AllowableActions getAllowableActions() {
+        return null;
+    }
+
+    public ObjectType getBaseType() {
+        return null;
+    }
+
+    public BaseTypeId getBaseTypeId() {
+        return null;
+    }
+
+    public String getChangeToken() {
+        return null;
+    }
+
+    public String getCreatedBy() {
+        return null;
+    }
+
+    public GregorianCalendar getCreationDate() {
+        return null;
+    }
+
+    public GregorianCalendar getLastModificationDate() {
+        return null;
+    }
+
+    public String getLastModifiedBy() {
+        return null;
+    }
+
+    public String getName() {
+        return null;
+    }
+
+    public List<Policy> getPolicies() {
+        return null;
+    }
+
+    public List<Property<?>> getProperties() {
+        return null;
+    }
+
+    public <T> Property<T> getProperty(String id) {
+        return null;
+    }
+
+    public <T> List<T> getPropertyMultivalue(String id) {
+        return null;
+    }
+
+    public <T> T getPropertyValue(String id) {
+        return null;
+    }
+
+    public long getRefreshTimestamp() {
+        return 0;
+    }
+
+    public List<Relationship> getRelationships() {
+        return null;
+    }
+
+    public ItemIterable<Relationship> getRelationships(boolean includeSubRelationshipTypes,
+            RelationshipDirection relationshipDirection, ObjectType type, OperationContext
context) {
+        return null;
+    }
+
+    public List<Rendition> getRenditions() {
+        return null;
+    }
+
+    public ObjectType getType() {
+        return null;
+    }
+
+    public boolean isChanged() {
+        return false;
+    }
+
+    public void refresh() {
+        
+    }
+
+    public void refreshIfOld(long durationInMillis) {
+        
+    }
+
+    public void removeAcl(List<Ace> removeAces, AclPropagation aclPropagation) {
+        
+    }
+
+    public void removePolicy(ObjectId policyId) {
+        
+    }
+
+    public void setName(String name) {
+        
+    }
+
+    public <T> void setProperty(String id, T value) {
+    }
+
+    public <T> void setPropertyMultivalue(String id, List<T> value) {
+        
+    }
+
+    public ObjectId updateProperties() {
+        return null;
+    }
+
+    public ObjectId updateProperties(Map<String, ?> properties) {
+        return null;
+    }
+
+    public String getId() {
+        return this.id;
+    }
+    
+};

Propchange: incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/test/java/org/apache/chemistry/opencmis/client/runtime/CmisObjectMock.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/test/java/org/apache/chemistry/opencmis/client/runtime/CmisObjectMockData.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/test/java/org/apache/chemistry/opencmis/client/runtime/CmisObjectMockData.java?rev=945011&view=auto
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/test/java/org/apache/chemistry/opencmis/client/runtime/CmisObjectMockData.java
(added)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/test/java/org/apache/chemistry/opencmis/client/runtime/CmisObjectMockData.java
Mon May 17 08:15:44 2010
@@ -0,0 +1,26 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.chemistry.opencmis.client.runtime;
+
+public class CmisObjectMockData {
+    public String id;
+
+    public CmisObjectMockData() {
+    }
+}
\ No newline at end of file

Propchange: incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/test/java/org/apache/chemistry/opencmis/client/runtime/CmisObjectMockData.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain



Mime
View raw message