chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sklev...@apache.org
Subject svn commit: r915349 - in /incubator/chemistry/trunk/opencmis: opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/ opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/repository/ openc...
Date Tue, 23 Feb 2010 13:55:19 GMT
Author: sklevenz
Date: Tue Feb 23 13:55:18 2010
New Revision: 915349

URL: http://svn.apache.org/viewvc?rev=915349&view=rev
Log:
Continuous Runtime Implementation and Unit Tests
- runtime implementation
- make unit test suite parameterizable by system properties and properties files
https://issues.apache.org/jira/browse/CMIS-124

Added:
    incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/AclPermissionImpl.java
  (with props)
    incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/repository/AclPermissionMappingImpl.java
  (with props)
    incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/repository/RepositoryAclCapabilitiesImpl.java
  (with props)
    incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/test/java/org/apache/opencmis/client/runtime/suite/GenericTestSuite.java
  (with props)
Modified:
    incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/PersistentFolderImpl.java
    incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/PersistentSessionImpl.java
    incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/RepositoryInfoImpl.java
    incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/test/java/org/apache/opencmis/client/runtime/Fixture.java
    incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/test/java/org/apache/opencmis/client/runtime/suite/otx/OtxInMemoryCmisTestSuite.java
    incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-api/src/main/java/org/apache/opencmis/commons/enums/BindingType.java

Added: incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/AclPermissionImpl.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/AclPermissionImpl.java?rev=915349&view=auto
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/AclPermissionImpl.java
(added)
+++ incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/AclPermissionImpl.java
Tue Feb 23 13:55:18 2010
@@ -0,0 +1,46 @@
+/*
+ * 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.opencmis.client.runtime;
+
+import java.io.Serializable;
+
+import org.apache.opencmis.client.api.AclPermission;
+
+public class AclPermissionImpl implements AclPermission, Serializable {
+
+	/**
+	 * serialization
+	 */
+	private static final long serialVersionUID = -3820947135577677874L;
+
+	private String description = null;
+
+	public AclPermissionImpl(String descr) {
+		this.description = descr;
+	}
+
+	public String getDescription() {
+		return this.description;
+	}
+
+	public String getName() {
+		return this.description;
+	}
+
+}

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

Modified: incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/PersistentFolderImpl.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/PersistentFolderImpl.java?rev=915349&r1=915348&r2=915349&view=diff
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/PersistentFolderImpl.java
(original)
+++ incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/PersistentFolderImpl.java
Tue Feb 23 13:55:18 2010
@@ -44,9 +44,13 @@
 
 public class PersistentFolderImpl implements Folder {
 
-	public PersistentFolderImpl(PersistentSessionImpl persistentSessionImpl,
-			ObjectData od) {
-		throw new CmisRuntimeException("not implemented");
+	private PersistentSessionImpl session;
+	private ObjectData objectData;
+
+	public PersistentFolderImpl(PersistentSessionImpl session, ObjectData od) {
+
+		this.session = session;
+		this.objectData = od;
 	}
 
 	public Document createDocument(String name) {
@@ -167,7 +171,7 @@
 	}
 
 	public String getId() {
-		throw new CmisRuntimeException("not implemented");
+		return this.objectData.getId();
 	}
 
 	public GregorianCalendar getLastModificationDate() {

Modified: incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/PersistentSessionImpl.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/PersistentSessionImpl.java?rev=915349&r1=915348&r2=915349&view=diff
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/PersistentSessionImpl.java
(original)
+++ incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/PersistentSessionImpl.java
Tue Feb 23 13:55:18 2010
@@ -353,13 +353,13 @@
 
 		switch (bt) {
 		case ATOM:
-			this.provider = this.creaetAtomPubProvider(this.parameters);
+			this.provider = this.createAtomPubProvider(this.parameters);
 			break;
-		case SOAP:
-			this.provider = this.creaetWebServiceProvider(this.parameters);
+		case WEBSERVICE:
+			this.provider = this.createWebServiceProvider(this.parameters);
 			break;
 		case UNSPECIFIC:
-			this.provider = this.creaetUnspecificProvider(this.parameters);
+			this.provider = this.createUnspecificProvider(this.parameters);
 			break;
 		default:
 			throw new CmisRuntimeException("Ambiguous session parameter: "
@@ -367,13 +367,13 @@
 		}
 	}
 
-	private CmisProvider creaetUnspecificProvider(Map<String, String> parameters) {
+	private CmisProvider createUnspecificProvider(Map<String, String> parameters) {
 		CmisProviderFactory factory = CmisProviderFactory.newInstance();
 		CmisProvider provider = factory.createCmisProvider(parameters);
 		return provider;
 	}
 
-	private CmisProvider creaetWebServiceProvider(Map<String, String> parameters) {
+	private CmisProvider createWebServiceProvider(Map<String, String> parameters) {
 		CmisProviderFactory factory = CmisProviderFactory.newInstance();
 		CmisProvider provider = factory
 				.createCmisWebServicesProvider(parameters);
@@ -381,10 +381,10 @@
 		return provider;
 	}
 
-	private CmisProvider creaetAtomPubProvider(Map<String, String> parameters) {
+	private CmisProvider createAtomPubProvider(Map<String, String> parameters) {
 		CmisProviderFactory factory = CmisProviderFactory.newInstance();
 		CmisProvider provider = factory.createCmisAtomPubProvider(parameters);
-
+		
 		return provider;
 	}
 

Modified: incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/RepositoryInfoImpl.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/RepositoryInfoImpl.java?rev=915349&r1=915348&r2=915349&view=diff
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/RepositoryInfoImpl.java
(original)
+++ incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/RepositoryInfoImpl.java
Tue Feb 23 13:55:18 2010
@@ -6,6 +6,7 @@
 import org.apache.opencmis.client.api.repository.RepositoryAclCapabilities;
 import org.apache.opencmis.client.api.repository.RepositoryCapabilities;
 import org.apache.opencmis.client.api.repository.RepositoryInfo;
+import org.apache.opencmis.client.runtime.repository.RepositoryAclCapabilitiesImpl;
 import org.apache.opencmis.commons.enums.BaseObjectTypeIds;
 import org.apache.opencmis.commons.exceptions.CmisRuntimeException;
 import org.apache.opencmis.commons.provider.RepositoryInfoData;
@@ -27,6 +28,11 @@
 	 */
 	private PersistentSessionImpl session;
 
+	/*
+	 * acl capabilities (serializable)
+	 */
+	private RepositoryAclCapabilities aclCapabilites = null;
+
 	public RepositoryInfoImpl(PersistentSessionImpl session,
 			RepositoryInfoData riData) {
 		this.riData = riData;
@@ -38,7 +44,11 @@
 	}
 
 	public RepositoryAclCapabilities getAclCapabilities() {
-		throw new CmisRuntimeException("not implemented");
+		if (this.aclCapabilites == null) {
+			this.aclCapabilites = new RepositoryAclCapabilitiesImpl(this.riData
+					.getAclCapabilities());
+		}
+		return this.aclCapabilites;
 	}
 
 	public RepositoryCapabilities getCapabilities() {

Added: incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/repository/AclPermissionMappingImpl.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/repository/AclPermissionMappingImpl.java?rev=915349&view=auto
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/repository/AclPermissionMappingImpl.java
(added)
+++ incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/repository/AclPermissionMappingImpl.java
Tue Feb 23 13:55:18 2010
@@ -0,0 +1,68 @@
+/*
+ * 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.opencmis.client.runtime.repository;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.opencmis.client.api.AclPermission;
+import org.apache.opencmis.client.api.repository.AclPermissionMapping;
+import org.apache.opencmis.client.runtime.AclPermissionImpl;
+import org.apache.opencmis.commons.provider.PermissionMappingData;
+
+public class AclPermissionMappingImpl implements AclPermissionMapping,
+		Serializable {
+
+	/**
+	 * serialization
+	 */
+	private static final long serialVersionUID = -8682418497088386853L;
+
+	/*
+	 * permission mapping data (serializable)
+	 */
+	private PermissionMappingData pmd = null;
+
+	/*
+	 * permission list (serializable)
+	 */
+	private List<AclPermission> permissionList = null;
+
+	public AclPermissionMappingImpl(PermissionMappingData pmd) {
+		this.pmd = pmd;
+	}
+
+	public String getKey() {
+		return this.pmd.getKey();
+	}
+
+	public List<AclPermission> getPermissions() {
+		if (this.permissionList == null) {
+			this.permissionList = new ArrayList<AclPermission>();
+
+			for (String descr : this.pmd.getPermissions()) {
+				AclPermission acl = new AclPermissionImpl(descr);
+				this.permissionList.add(acl);
+			}
+		}
+		return permissionList;
+	}
+
+}

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

Added: incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/repository/RepositoryAclCapabilitiesImpl.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/repository/RepositoryAclCapabilitiesImpl.java?rev=915349&view=auto
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/repository/RepositoryAclCapabilitiesImpl.java
(added)
+++ incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/repository/RepositoryAclCapabilitiesImpl.java
Tue Feb 23 13:55:18 2010
@@ -0,0 +1,237 @@
+/*
+ * 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.opencmis.client.runtime.repository;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Hashtable;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.opencmis.client.api.AclPermission;
+import org.apache.opencmis.client.api.repository.AclPermissionMapping;
+import org.apache.opencmis.client.api.repository.RepositoryAclCapabilities;
+import org.apache.opencmis.commons.enums.AclPropagation;
+import org.apache.opencmis.commons.exceptions.CmisRuntimeException;
+import org.apache.opencmis.commons.provider.AclCapabilitiesData;
+import org.apache.opencmis.commons.provider.PermissionMappingData;
+
+public class RepositoryAclCapabilitiesImpl implements
+		RepositoryAclCapabilities, Serializable {
+
+	/*
+	 * serialization
+	 */
+	private static final long serialVersionUID = 2824818352611088504L;
+
+	/*
+	 * provider data (serializable)
+	 */
+	private AclCapabilitiesData aclCapabilities;
+
+	/*
+	 * permission mapping (serializable)
+	 */
+	private Map<String, AclPermissionMapping> aclPermissionMapping = null;
+
+	/*
+	 * permissions (serializable)
+	 */
+	List<AclPermission> aclPermissions = null;
+
+	public RepositoryAclCapabilitiesImpl(AclCapabilitiesData aclCapabilities) {
+		this.aclCapabilities = aclCapabilities;
+	}
+
+	public AclPropagation getAclPropagation() {
+		return this.aclCapabilities.getAclPropagation();
+	}
+
+	public AclPermissionMapping getAddPolicyObjectPermissions() {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public AclPermissionMapping getAddPolicyPolicyPermissions() {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public AclPermissionMapping getAddToFolderFolderPermissions() {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public AclPermissionMapping getAddToFolderObjectPermissions() {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public AclPermissionMapping getApplyAclObjectPermissions() {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public AclPermissionMapping getCancelCheckoutDocumentPermissions() {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public AclPermissionMapping getCheckinDocumentPermissions() {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public AclPermissionMapping getCheckoutDocumentPermissions() {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public AclPermissionMapping getCreateDocumentFolderPermissions() {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public AclPermissionMapping getCreateDocumentTypePermissions() {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public AclPermissionMapping getCreateFolderFolderPermissions() {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public AclPermissionMapping getCreateFolderTypePermissions() {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public AclPermissionMapping getCreatePolicyTypePermissions() {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public AclPermissionMapping getCreateRelationshipSourcePermissions() {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public AclPermissionMapping getCreateRelationshipTargetPermissions() {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public AclPermissionMapping getCreateRelationshipTypePermissions() {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public AclPermissionMapping getDeleteContentDocumentPermissions() {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public AclPermissionMapping getDeleteObjectPermissions() {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public AclPermissionMapping getDeleteTreeFolderPermissions() {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public AclPermissionMapping getGetAclObjectPermissions() {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public AclPermissionMapping getGetAllVersionsVersionSeriesPermissions() {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public AclPermissionMapping getGetAppliedPoliciesObjectPermissions() {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public AclPermissionMapping getGetChildrenFolderPermissions() {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public AclPermissionMapping getGetDescendentsFolderPermissions() {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public AclPermissionMapping getGetFolderParentObjectPermissions() {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public AclPermissionMapping getGetObjectRelationshipsObjectPermissions() {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public AclPermissionMapping getGetParentsFolderPermissions() {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public AclPermissionMapping getGetPropertiesObjectPermissions() {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public AclPermissionMapping getMoveObjectPermissions() {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public AclPermissionMapping getMoveSourcePermissions() {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public AclPermissionMapping getMoveTargetPermissions() {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public Map<String, AclPermissionMapping> getPermissionMapping() {
+		if (this.aclPermissionMapping == null) {
+			this.aclPermissionMapping = new Hashtable<String, AclPermissionMapping>();
+			AclPermissionMapping apm = null;
+			for (PermissionMappingData pmd : this.aclCapabilities
+					.getPermissionMappingData()) {
+				apm = new AclPermissionMappingImpl(pmd);
+				this.aclPermissionMapping.put(pmd.getKey(), apm);
+			}
+		}
+		return this.aclPermissionMapping;
+	}
+
+	public List<AclPermission> getPermissions() {
+		if (this.aclPermissions == null) {
+			this.aclPermissions = new ArrayList<AclPermission>();
+		}
+		return this.aclPermissions;
+	}
+
+	public AclPermissionMapping getRemoveFromFolderFolderPermissions() {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public AclPermissionMapping getRemoveFromFolderObjectPermissions() {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public AclPermissionMapping getRemovePolicyObjectPermissions() {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public AclPermissionMapping getRemovePolicyPolicyPermissions() {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public AclPermissionMapping getSetContentDocumentPermissions() {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public AclPermissionMapping getUpdatePropertiesObjectPermissions() {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public AclPermissionMapping getViewContentObjectPermissions() {
+		throw new CmisRuntimeException("not implemented");
+	}
+}

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

Modified: incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/test/java/org/apache/opencmis/client/runtime/Fixture.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/test/java/org/apache/opencmis/client/runtime/Fixture.java?rev=915349&r1=915348&r2=915349&view=diff
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/test/java/org/apache/opencmis/client/runtime/Fixture.java
(original)
+++ incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/test/java/org/apache/opencmis/client/runtime/Fixture.java
Tue Feb 23 13:55:18 2010
@@ -49,6 +49,7 @@
 	public static String FOLDER_TYPE_ID = "test.folder";
 	public static String DOCUMENT_TYPE_ID = "test.file";
 	public static String QUERY = "SELECT * FROM cmis:document";
+
 	/*
 	 * cmis objects
 	 */
@@ -73,7 +74,7 @@
 	public static String PROPERTY_NAME_ID = "DoubleProperty";
 	public static String PROPERTY_VALUE_ID = "xyz";
 	public static String PROPERTY_NAME_HTML = "HtmlProperty";
-	public static String PROPERTY_VALUE_HTML = "<body>";
+	public static String PROPERTY_VALUE_HTML = "<html><body>html value</body></html>";
 	public static String PROPERTY_NAME_DATETIME = "DateTimeProperty";
 	public static Calendar PROPERTY_VALUE_DATETIME = GregorianCalendar
 			.getInstance();
@@ -81,6 +82,12 @@
 	public static URI PROPERTY_VALUE_URI = URI.create("http://foo.com");
 	public static final String PROPERTY_NAME_STRING_MULTI_VALUED = "MultiValuedStringProperty";
 
+	/*
+	 * session parameter
+	 */
+	private static final String X_FOLDER_TYPE_ID = "org.apache.opencmis.fixture.folder.type.id";
+	private static final String X_DOCUMENT_TYPE_ID = "org.apache.opencmis.fixture.document.type.id";
+
 	static {
 		Fixture.TEST_ROOT_FOLDER_NAME = "test_" + UUID.randomUUID().toString();
 	}
@@ -99,7 +106,18 @@
 	 */
 	public static void setParamter(Map<String, String> paramter) {
 		Fixture.paramter = paramter;
-	}
+
+		/* overload fixture values */
+		String value;
+
+		value = Fixture.paramter.get(Fixture.X_DOCUMENT_TYPE_ID);
+		Fixture.DOCUMENT_TYPE_ID = (value != null ? value
+				: Fixture.DOCUMENT_TYPE_ID);
+
+		value = Fixture.paramter.get(Fixture.X_FOLDER_TYPE_ID);
+		Fixture.FOLDER_TYPE_ID = (value != null ? value
+				: Fixture.FOLDER_TYPE_ID);
+}
 
 	/**
 	 * session parameter.

Added: incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/test/java/org/apache/opencmis/client/runtime/suite/GenericTestSuite.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/test/java/org/apache/opencmis/client/runtime/suite/GenericTestSuite.java?rev=915349&view=auto
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/test/java/org/apache/opencmis/client/runtime/suite/GenericTestSuite.java
(added)
+++ incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/test/java/org/apache/opencmis/client/runtime/suite/GenericTestSuite.java
Tue Feb 23 13:55:18 2010
@@ -0,0 +1,130 @@
+/*
+ * 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.opencmis.client.runtime.suite;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.util.Hashtable;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Map.Entry;
+
+import org.apache.opencmis.client.api.SessionFactory;
+import org.apache.opencmis.client.runtime.Fixture;
+import org.apache.opencmis.client.runtime.ReadOnlyAclCapabilityTest;
+import org.apache.opencmis.client.runtime.ReadOnlyContentStreamTest;
+import org.apache.opencmis.client.runtime.ReadOnlyCreateSessionTest;
+import org.apache.opencmis.client.runtime.ReadOnlyDiscoverTest;
+import org.apache.opencmis.client.runtime.ReadOnlyNavigationTest;
+import org.apache.opencmis.client.runtime.ReadOnlyObjectTest;
+import org.apache.opencmis.client.runtime.ReadOnlyRepositoryInfoTest;
+import org.apache.opencmis.client.runtime.ReadOnlySessionTest;
+import org.apache.opencmis.client.runtime.ReadOnlyTypeTest;
+import org.apache.opencmis.client.runtime.SessionFactoryImpl;
+import org.apache.opencmis.client.runtime.misc.CacheTest;
+import org.apache.opencmis.commons.exceptions.CmisRuntimeException;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite.SuiteClasses;
+import org.junit.runners.model.InitializationError;
+import org.junit.runners.model.RunnerBuilder;
+
+/**
+ * All session parameters have to be configured as environment variables.
+ */
+/**
+ * SessionParameter are build from environment variables. If a config file
+ * parameter is specified then session parameters are read from this file else
+ * the whole environment variable map is used for session parameter. All entries
+ * have to follow the {@code org.apache.opencmis...} convention as defined in
+ * class {@code SessionParameter0
+ */
+@RunWith(GenericTestSuite.class)
+@SuiteClasses( { CacheTest.class, ReadOnlyCreateSessionTest.class,
+		ReadOnlySessionTest.class, ReadOnlyRepositoryInfoTest.class,
+		ReadOnlyAclCapabilityTest.class, ReadOnlyObjectTest.class,
+		ReadOnlyTypeTest.class, ReadOnlyNavigationTest.class,
+		ReadOnlyContentStreamTest.class, ReadOnlyDiscoverTest.class })
+public class GenericTestSuite extends AbstractCmisTestSuite {
+
+	private static final String CONFIG_PATH = "org.apache.opencmis.client.runtime.suite.config.path";
+	private static final String SESSION_FACTORY = "org.apache.opencmis.client.runtime.suite.session.factory";
+
+	public GenericTestSuite(Class<?> klass, RunnerBuilder r)
+			throws InitializationError {
+		super(klass, r);
+	}
+
+	@Override
+	protected void initializeFixture() {
+		/* get optional path from system properties */
+		String pathname = System.getProperty(GenericTestSuite.CONFIG_PATH)
+				.trim();
+		Properties properties = null;
+		Map<String, String> sessionParameter = null;
+		SessionFactory factory = null;
+		String factoryClassName = null;
+		try {
+			if (pathname != null && !"".equalsIgnoreCase(pathname)) {
+				// read from file
+				properties = new Properties();
+				FileInputStream in = new FileInputStream(new File(pathname));
+				properties.load(in);
+			} else {
+				// take all system properties
+				properties = System.getProperties();
+			}
+
+			/* convert to map, filter empty values */
+			sessionParameter = new Hashtable<String, String>();
+			for (Entry<Object, Object> se : properties.entrySet()) {
+				String key = (String) se.getKey();
+				String value = ((String) se.getValue()).trim();
+				if (value != null && !"".equalsIgnoreCase(value)) {
+					sessionParameter.put(key, value);
+				}
+			}
+
+			/* load factory class */
+			factoryClassName = sessionParameter
+					.get(GenericTestSuite.SESSION_FACTORY);
+			if (factoryClassName != null
+					&& !"".equalsIgnoreCase(factoryClassName)) {
+				Class<?> clazz = Class.forName(factoryClassName);
+				factory = (SessionFactory) clazz.newInstance();
+			} else {
+				/* default */
+				factory = SessionFactoryImpl.newInstance();
+			}
+
+			/* activate fixture and done */
+			Fixture.setParamter(sessionParameter);
+			Fixture.setSessionFactory(factory);
+
+		} catch (InstantiationException e) {
+			throw new CmisRuntimeException(factoryClassName, e);
+		} catch (IllegalAccessException e) {
+			throw new CmisRuntimeException(factoryClassName, e);
+		} catch (ClassNotFoundException e) {
+			throw new CmisRuntimeException(factoryClassName, e);
+		} catch (IOException e) {
+			throw new CmisRuntimeException(pathname, e);
+		}
+	}
+}

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

Modified: incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/test/java/org/apache/opencmis/client/runtime/suite/otx/OtxInMemoryCmisTestSuite.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/test/java/org/apache/opencmis/client/runtime/suite/otx/OtxInMemoryCmisTestSuite.java?rev=915349&r1=915348&r2=915349&view=diff
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/test/java/org/apache/opencmis/client/runtime/suite/otx/OtxInMemoryCmisTestSuite.java
(original)
+++ incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/test/java/org/apache/opencmis/client/runtime/suite/otx/OtxInMemoryCmisTestSuite.java
Tue Feb 23 13:55:18 2010
@@ -19,41 +19,63 @@
 package org.apache.opencmis.client.runtime.suite.otx;
 
 import java.util.HashMap;
+import java.util.Locale;
 import java.util.Map;
 
 import org.junit.runner.RunWith;
 import org.junit.runners.Suite.SuiteClasses;
 import org.junit.runners.model.InitializationError;
 import org.junit.runners.model.RunnerBuilder;
+import org.apache.opencmis.client.provider.factory.CmisProviderFactory;
 import org.apache.opencmis.client.runtime.Fixture;
 import org.apache.opencmis.client.runtime.ReadOnlyAclCapabilityTest;
 import org.apache.opencmis.client.runtime.ReadOnlyCreateSessionTest;
-import org.apache.opencmis.client.runtime.ReadOnlyObjectTest;
 import org.apache.opencmis.client.runtime.ReadOnlyRepositoryInfoTest;
+import org.apache.opencmis.client.runtime.ReadOnlySessionTest;
+import org.apache.opencmis.client.runtime.SessionFactoryImpl;
+import org.apache.opencmis.client.runtime.misc.CacheTest;
 import org.apache.opencmis.client.runtime.suite.AbstractCmisTestSuite;
+import org.apache.opencmis.commons.SessionParameter;
+import org.apache.opencmis.commons.enums.BindingType;
+import org.apache.opencmis.commons.enums.SessionType;
 
 /**
  * Test suite to run InMemory binding.
  */
 @RunWith(OtxInMemoryCmisTestSuite.class)
-@SuiteClasses( { ReadOnlyCreateSessionTest.class, ReadOnlyRepositoryInfoTest.class,
-    ReadOnlyAclCapabilityTest.class, ReadOnlyObjectTest.class })
+@SuiteClasses( { CacheTest.class, ReadOnlyCreateSessionTest.class, ReadOnlySessionTest.class,
+		ReadOnlyRepositoryInfoTest.class,
+		ReadOnlyAclCapabilityTest.class, })
 public class OtxInMemoryCmisTestSuite extends AbstractCmisTestSuite {
 
-  public OtxInMemoryCmisTestSuite(Class<?> klass, RunnerBuilder r) throws InitializationError
{
-    super(klass, r);
-  }
-
-  @Override
-  protected void initializeFixture() {
-    Map<String, String> parameter = new HashMap<String, String>();
-    // parameter.put(Session.USER, "test");
-    // parameter.put(Session.BINDING, "inmemory");
-    // parameter.put(Session.PROVIDER, "otx");
-    // parameter.put(Session.REPOSITORY_ID, "InMemory");
-
-    Fixture.setParamter(parameter);
-    Fixture.setSessionFactory(null);
-  }
+	public OtxInMemoryCmisTestSuite(Class<?> klass, RunnerBuilder r)
+			throws InitializationError {
+		super(klass, r);
+	}
+
+	@Override
+	protected void initializeFixture() {
+		Map<String, String> parameter = new HashMap<String, String>();
+
+		parameter.put(SessionParameter.USER, "test");
+		parameter.put(SessionParameter.PASSWORD, "test");
+		parameter.put(SessionParameter.SESSION_TYPE, SessionType.PERSISTENT
+				.value());
+		parameter.put(SessionParameter.LOCALE_ISO3166_COUNTRY, Locale.GERMANY
+				.getISO3Country());
+		parameter.put(SessionParameter.LOCALE_ISO639_LANGUAGE, Locale.GERMANY
+				.getISO3Language());
+		parameter.put(SessionParameter.BINDING_TYPE, BindingType.UNSPECIFIC
+				.value());
+		parameter.put(SessionParameter.REPOSITORY_ID, "InMemory");
+		parameter.put(SessionParameter.BINDING_SPI_CLASS,
+				CmisProviderFactory.BINDING_SPI_INMEMORY);
+
+		Fixture.DOCUMENT_TYPE_ID = "cmis:document";
+		Fixture.FOLDER_TYPE_ID = "cmis:folder";
+
+		Fixture.setParamter(parameter);
+		Fixture.setSessionFactory(SessionFactoryImpl.newInstance());
+	}
 
 }

Modified: incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-api/src/main/java/org/apache/opencmis/commons/enums/BindingType.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-api/src/main/java/org/apache/opencmis/commons/enums/BindingType.java?rev=915349&r1=915348&r2=915349&view=diff
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-api/src/main/java/org/apache/opencmis/commons/enums/BindingType.java
(original)
+++ incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-api/src/main/java/org/apache/opencmis/commons/enums/BindingType.java
Tue Feb 23 13:55:18 2010
@@ -25,7 +25,7 @@
  */
 public enum BindingType {
 
-  SOAP("soap"), ATOM("atom"), UNSPECIFIC("unspecific");
+  WEBSERVICE("webservice"), ATOM("atom"), UNSPECIFIC("unspecific");
   private final String value;
 
   BindingType(String v) {



Mime
View raw message