You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@chemistry.apache.org by fg...@apache.org on 2010/07/29 19:18:22 UTC
svn commit: r980514 [1/4] - in
/incubator/chemistry/opencmis/trunk/chemistry-opencmis-test:
chemistry-opencmis-test-fit/src/main/webapp/WEB-INF/
chemistry-opencmis-test-fit/src/main/webapp/WEB-INF/classes/
chemistry-opencmis-test-fit/src/test/java/org/...
Author: fguillaume
Date: Thu Jul 29 17:18:20 2010
New Revision: 980514
URL: http://svn.apache.org/viewvc?rev=980514&view=rev
Log:
CMIS-225: proper svn eol-style on text files (native except for *.bat)
Modified:
incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/main/webapp/WEB-INF/classes/repository.properties (contents, props changed)
incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/main/webapp/WEB-INF/jetty-web.xml (contents, props changed)
incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/SessionFactory.java (contents, props changed)
incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/AbstractReadOnlyAclCapabilityIT.java (props changed)
incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/AbstractReadOnlyContentStreamIT.java (props changed)
incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/AbstractReadOnlyDiscoverIT.java (props changed)
incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/AbstractReadOnlyNavigationIT.java (props changed)
incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/AbstractReadOnlyObjectIT.java (props changed)
incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/AbstractReadOnlyRepositoryInfoIT.java (props changed)
incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/AbstractReadOnlySessionIT.java (props changed)
incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/AbstractReadOnlyTypeIT.java (props changed)
incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/AbstractSessionTest.java (props changed)
incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/AbstractWriteAclT.java (contents, props changed)
incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/AbstractWriteObjectIT.java (contents, props changed)
incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/AbstractWriteObjectRelationIT.java (contents, props changed)
incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/AbstractWriteObjectVersionIT.java (contents, props changed)
incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/Fixture.java (props changed)
incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/FixtureData.java (contents, props changed)
incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/FixtureSetup.java (contents, props changed)
incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/atom/ReadOnlyAclCapabilityAtomPubIT.java (props changed)
incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/atom/ReadOnlyContentStreamAtomPubIT.java (props changed)
incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/atom/ReadOnlyDiscoverAtomPubIT.java (props changed)
incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/atom/ReadOnlyNavigationAtomPubIT.java (props changed)
incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/atom/ReadOnlyObjectAtomPubIT.java (props changed)
incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/atom/ReadOnlyRepositoryInfoAtomPubIT.java (props changed)
incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/atom/ReadOnlySessionAtomPubIT.java (props changed)
incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/atom/ReadOnlyTypeAtomPubIT.java (props changed)
incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/atom/WriteAclAtomPubIT.java (contents, props changed)
incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/atom/WriteObjectAtomPubIT.java (contents, props changed)
incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/atom/WriteObjectRelationAtomPubIT.java (contents, props changed)
incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/atom/WriteObjectVersionAtomPubIT.java (contents, props changed)
incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/misc/AbstractReadOnlyCreateSessionIT.java (props changed)
incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/misc/ReadOnlyCreateSessionAtomPubIT.java (props changed)
incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/misc/ReadOnlyCreateSessionWebServicesIT.java (props changed)
incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/webservices/ReadOnlyAclCapabilityWebServicesIT.java (props changed)
incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/webservices/ReadOnlyContentStreamWebServicesIT.java (props changed)
incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/webservices/ReadOnlyDiscoverWebServicesIT.java (props changed)
incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/webservices/ReadOnlyNavigationWebServicesIT.java (props changed)
incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/webservices/ReadOnlyObjectWebServicesIT.java (props changed)
incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/webservices/ReadOnlyRepositoryInfoWebServicesIT.java (props changed)
incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/webservices/ReadOnlySessionWebServicesIT.java (props changed)
incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/webservices/ReadOnlyTypeWebServicesIT.java (props changed)
incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/webservices/WriteAclWebServicesIT.java (contents, props changed)
incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/webservices/WriteObjectRelationWebServicesIT.java (contents, props changed)
incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/webservices/WriteObjectVersionWebServicesIT.java (contents, props changed)
incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/webservices/WriteObjectWebServicesIT.java (contents, props changed)
incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/sample/AbstractSampleIT.java (contents, props changed)
incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/sample/AtomPubSampleIT.java (contents, props changed)
incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/sample/WebServicesSampleIT.java (contents, props changed)
incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/resources/inmemory.atom.properties (props changed)
incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/resources/inmemory.ws.properties (props changed)
incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/resources/log4j.properties (props changed)
incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-util/runCreate.bat (contents, props changed)
incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-util/runcmd.bat (contents, props changed)
incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-util/runfill.bat (contents, props changed)
incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-util/src/main/java/org/apache/chemistry/opencmis/util/repository/MultiThreadedObjectGenerator.java (contents, props changed)
incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-util/src/main/java/org/apache/chemistry/opencmis/util/repository/ObjGenApp.java (contents, props changed)
incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-util/src/main/java/org/apache/chemistry/opencmis/util/repository/TimeLogger.java (contents, props changed)
Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/main/webapp/WEB-INF/classes/repository.properties
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/main/webapp/WEB-INF/classes/repository.properties?rev=980514&r1=980513&r2=980514&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/main/webapp/WEB-INF/classes/repository.properties (original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/main/webapp/WEB-INF/classes/repository.properties Thu Jul 29 17:18:20 2010
@@ -1,45 +1,45 @@
-# 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.
-
-class=org.apache.chemistry.opencmis.inmemory.server.InMemoryServiceFactoryImpl
-
-# In Memory Settings
-InMemoryServer.RepositoryId=test
-# InMemoryServer.RepositoryInfoCreatorClass=org.apache.chemistry.opencmis.client.provider.inmemory.UnitTestRepositoryInfo
-InMemoryServer.User=test
-InMemoryServer.Password=test
-InMemoryServer.TypesCreatorClass=org.apache.chemistry.opencmis.inmemory.types.DefaultTypeSystemCreator
-
-# settings for init repository with data
- # enable or disable
-RepositoryFiller.Enable=false
- # Type id of documents that are created
-RepositoryFiller.DocumentTypeId=ComplexType
- # Type id of folders that are created
-RepositoryFiller.FolderTypeId=cmis:folder
- # Number of documents created per folder
-RepositoryFiller.DocsPerFolder=3
- # Number of folders created per folder
-RepositoryFiller.FolderPerFolder=2
- # number of folder levels created (depth of hierarchy)
-RepositoryFiller.Depth=3
- # Size of content for documents (0=do not create content), default=0
-RepositoryFiller.ContentSizeInKB=32
- # properties to set for a document
-RepositoryFiller.DocumentProperty.0=StringProp
-#RepositoryFiller.DocumentProperty.1=StringPropMV
- # properties to set for a folder
-#RepositoryFiller.FolderProperty.0=StringFolderProp
-
+# 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.
+
+class=org.apache.chemistry.opencmis.inmemory.server.InMemoryServiceFactoryImpl
+
+# In Memory Settings
+InMemoryServer.RepositoryId=test
+# InMemoryServer.RepositoryInfoCreatorClass=org.apache.chemistry.opencmis.client.provider.inmemory.UnitTestRepositoryInfo
+InMemoryServer.User=test
+InMemoryServer.Password=test
+InMemoryServer.TypesCreatorClass=org.apache.chemistry.opencmis.inmemory.types.DefaultTypeSystemCreator
+
+# settings for init repository with data
+ # enable or disable
+RepositoryFiller.Enable=false
+ # Type id of documents that are created
+RepositoryFiller.DocumentTypeId=ComplexType
+ # Type id of folders that are created
+RepositoryFiller.FolderTypeId=cmis:folder
+ # Number of documents created per folder
+RepositoryFiller.DocsPerFolder=3
+ # Number of folders created per folder
+RepositoryFiller.FolderPerFolder=2
+ # number of folder levels created (depth of hierarchy)
+RepositoryFiller.Depth=3
+ # Size of content for documents (0=do not create content), default=0
+RepositoryFiller.ContentSizeInKB=32
+ # properties to set for a document
+RepositoryFiller.DocumentProperty.0=StringProp
+#RepositoryFiller.DocumentProperty.1=StringPropMV
+ # properties to set for a folder
+#RepositoryFiller.FolderProperty.0=StringFolderProp
+
Propchange: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/main/webapp/WEB-INF/classes/repository.properties
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/main/webapp/WEB-INF/jetty-web.xml
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/main/webapp/WEB-INF/jetty-web.xml?rev=980514&r1=980513&r2=980514&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/main/webapp/WEB-INF/jetty-web.xml (original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/main/webapp/WEB-INF/jetty-web.xml Thu Jul 29 17:18:20 2010
@@ -1,30 +1,30 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting// DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd">
-<!--
- Licensed 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.
--->
-<Configure class="org.mortbay.jetty.webapp.WebAppContext">
-
- <Set name="parentLoaderPriority">true</Set>
-
- <Set name="systemClasses">
- <Array type="java.lang.String">
- <Item>java.</Item>
- <Item>javax.servlet.</Item>
- <Item>org.mortbay.</Item>
- <Item>org.xml.</Item>
- <Item>org.w3c.</Item>
- </Array>
- </Set>
-
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting// DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd">
+<!--
+ Licensed 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.
+-->
+<Configure class="org.mortbay.jetty.webapp.WebAppContext">
+
+ <Set name="parentLoaderPriority">true</Set>
+
+ <Set name="systemClasses">
+ <Array type="java.lang.String">
+ <Item>java.</Item>
+ <Item>javax.servlet.</Item>
+ <Item>org.mortbay.</Item>
+ <Item>org.xml.</Item>
+ <Item>org.w3c.</Item>
+ </Array>
+ </Set>
+
</Configure>
\ No newline at end of file
Propchange: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/main/webapp/WEB-INF/jetty-web.xml
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/SessionFactory.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/SessionFactory.java?rev=980514&r1=980513&r2=980514&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/SessionFactory.java (original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/SessionFactory.java Thu Jul 29 17:18:20 2010
@@ -1,150 +1,150 @@
-/*
- * 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.fit;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.chemistry.opencmis.client.api.Session;
-import org.apache.chemistry.opencmis.client.bindings.CmisBindingFactory;
-import org.apache.chemistry.opencmis.client.runtime.SessionFactoryImpl;
-import org.apache.chemistry.opencmis.commons.SessionParameter;
-import org.apache.chemistry.opencmis.commons.enums.BindingType;
-import org.apache.chemistry.opencmis.commons.spi.CmisBinding;
-
-/**
- * Session factory for integration tests.
- *
- * @author <a href="mailto:fmueller@opentext.com">Florian Müller</a>
- *
- */
-public class SessionFactory {
-
- private static final String HOST = "localhost";
- private static final int PORT = 19080;
-
- private static final String REPOSITORY_ID = "test";
- private static final String USER = "test";
- private static final String PASSWORD = "test";
-
- private static final String ATOMPUB_PATH = "/opencmis/atom";
- private static final String WEBSERVICES_PATH = "/opencmis/services/";
-
- /**
- * Returns the repository id of the test repository.
- */
- public static String getRepositoryId() {
- return REPOSITORY_ID;
- }
-
- /**
- * Returns the user that is logged in.
- */
- public static String getUsername() {
- return USER;
- }
-
- /**
- * Creates a new Session object that uses the AtomPub binding.
- */
- public static Session createAtomPubSession() {
- String url = "http://" + HOST + ":" + PORT + ATOMPUB_PATH;
-
- Map<String, String> parameters = new HashMap<String, String>();
-
- parameters.put(SessionParameter.BINDING_TYPE, BindingType.ATOMPUB.value());
-
- parameters.put(SessionParameter.ATOMPUB_URL, url);
- parameters.put(SessionParameter.REPOSITORY_ID, getRepositoryId());
-
- parameters.put(SessionParameter.USER, USER);
- parameters.put(SessionParameter.PASSWORD, PASSWORD);
-
- return SessionFactoryImpl.newInstance().createSession(parameters);
- }
-
- /**
- * Creates a new Session object that uses the Web Services binding.
- */
- public static Session createWebServicesSession() {
- String url = "http://" + HOST + ":" + PORT + WEBSERVICES_PATH;
-
- Map<String, String> parameters = new HashMap<String, String>();
-
- parameters.put(SessionParameter.BINDING_TYPE, BindingType.WEBSERVICES.value());
-
- parameters.put(SessionParameter.WEBSERVICES_REPOSITORY_SERVICE, url + "RepositoryService?wsdl");
- parameters.put(SessionParameter.WEBSERVICES_NAVIGATION_SERVICE, url + "NavigationService?wsdl");
- parameters.put(SessionParameter.WEBSERVICES_OBJECT_SERVICE, url + "ObjectService?wsdl");
- parameters.put(SessionParameter.WEBSERVICES_VERSIONING_SERVICE, url + "VersioningService?wsdl");
- parameters.put(SessionParameter.WEBSERVICES_DISCOVERY_SERVICE, url + "DiscoveryService?wsdl");
- parameters.put(SessionParameter.WEBSERVICES_RELATIONSHIP_SERVICE, url + "RelationshipService?wsdl");
- parameters.put(SessionParameter.WEBSERVICES_MULTIFILING_SERVICE, url + "MultiFilingService?wsdl");
- parameters.put(SessionParameter.WEBSERVICES_POLICY_SERVICE, url + "PolicyService?wsdl");
- parameters.put(SessionParameter.WEBSERVICES_ACL_SERVICE, url + "ACLService?wsdl");
-
- parameters.put(SessionParameter.REPOSITORY_ID, getRepositoryId());
- parameters.put(SessionParameter.USER, USER);
- parameters.put(SessionParameter.PASSWORD, PASSWORD);
-
- return SessionFactoryImpl.newInstance().createSession(parameters);
- }
-
- /**
- * Creates a new CmisProvider object that uses the AtomPub binding. For
- * low-level tests only!
- */
- public static CmisBinding createAtomPubBinding() {
- String url = "http://" + HOST + ":" + PORT + ATOMPUB_PATH;
-
- Map<String, String> parameters = new HashMap<String, String>();
-
- parameters.put(SessionParameter.USER, USER);
- parameters.put(SessionParameter.PASSWORD, PASSWORD);
-
- parameters.put(SessionParameter.ATOMPUB_URL, url);
-
- return CmisBindingFactory.newInstance().createCmisAtomPubBinding(parameters);
- }
-
- /**
- * Creates a new CmisProvider object that uses the Web Services binding. For
- * low-level tests only!
- */
- public static CmisBinding createWebServicesBinding() {
- String url = "http://" + HOST + ":" + PORT + WEBSERVICES_PATH;
-
- Map<String, String> parameters = new HashMap<String, String>();
-
- parameters.put(SessionParameter.USER, USER);
- parameters.put(SessionParameter.PASSWORD, PASSWORD);
-
- parameters.put(SessionParameter.WEBSERVICES_REPOSITORY_SERVICE, url + "RepositoryService?wsdl");
- parameters.put(SessionParameter.WEBSERVICES_NAVIGATION_SERVICE, url + "NavigationService?wsdl");
- parameters.put(SessionParameter.WEBSERVICES_OBJECT_SERVICE, url + "ObjectService?wsdl");
- parameters.put(SessionParameter.WEBSERVICES_VERSIONING_SERVICE, url + "VersioningService?wsdl");
- parameters.put(SessionParameter.WEBSERVICES_DISCOVERY_SERVICE, url + "DiscoveryService?wsdl");
- parameters.put(SessionParameter.WEBSERVICES_RELATIONSHIP_SERVICE, url + "RelationshipService?wsdl");
- parameters.put(SessionParameter.WEBSERVICES_MULTIFILING_SERVICE, url + "MultiFilingService?wsdl");
- parameters.put(SessionParameter.WEBSERVICES_POLICY_SERVICE, url + "PolicyService?wsdl");
- parameters.put(SessionParameter.WEBSERVICES_ACL_SERVICE, url + "ACLService?wsdl");
-
- return CmisBindingFactory.newInstance().createCmisWebServicesBinding(parameters);
- }
+/*
+ * 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.fit;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.chemistry.opencmis.client.api.Session;
+import org.apache.chemistry.opencmis.client.bindings.CmisBindingFactory;
+import org.apache.chemistry.opencmis.client.runtime.SessionFactoryImpl;
+import org.apache.chemistry.opencmis.commons.SessionParameter;
+import org.apache.chemistry.opencmis.commons.enums.BindingType;
+import org.apache.chemistry.opencmis.commons.spi.CmisBinding;
+
+/**
+ * Session factory for integration tests.
+ *
+ * @author <a href="mailto:fmueller@opentext.com">Florian Müller</a>
+ *
+ */
+public class SessionFactory {
+
+ private static final String HOST = "localhost";
+ private static final int PORT = 19080;
+
+ private static final String REPOSITORY_ID = "test";
+ private static final String USER = "test";
+ private static final String PASSWORD = "test";
+
+ private static final String ATOMPUB_PATH = "/opencmis/atom";
+ private static final String WEBSERVICES_PATH = "/opencmis/services/";
+
+ /**
+ * Returns the repository id of the test repository.
+ */
+ public static String getRepositoryId() {
+ return REPOSITORY_ID;
+ }
+
+ /**
+ * Returns the user that is logged in.
+ */
+ public static String getUsername() {
+ return USER;
+ }
+
+ /**
+ * Creates a new Session object that uses the AtomPub binding.
+ */
+ public static Session createAtomPubSession() {
+ String url = "http://" + HOST + ":" + PORT + ATOMPUB_PATH;
+
+ Map<String, String> parameters = new HashMap<String, String>();
+
+ parameters.put(SessionParameter.BINDING_TYPE, BindingType.ATOMPUB.value());
+
+ parameters.put(SessionParameter.ATOMPUB_URL, url);
+ parameters.put(SessionParameter.REPOSITORY_ID, getRepositoryId());
+
+ parameters.put(SessionParameter.USER, USER);
+ parameters.put(SessionParameter.PASSWORD, PASSWORD);
+
+ return SessionFactoryImpl.newInstance().createSession(parameters);
+ }
+
+ /**
+ * Creates a new Session object that uses the Web Services binding.
+ */
+ public static Session createWebServicesSession() {
+ String url = "http://" + HOST + ":" + PORT + WEBSERVICES_PATH;
+
+ Map<String, String> parameters = new HashMap<String, String>();
+
+ parameters.put(SessionParameter.BINDING_TYPE, BindingType.WEBSERVICES.value());
+
+ parameters.put(SessionParameter.WEBSERVICES_REPOSITORY_SERVICE, url + "RepositoryService?wsdl");
+ parameters.put(SessionParameter.WEBSERVICES_NAVIGATION_SERVICE, url + "NavigationService?wsdl");
+ parameters.put(SessionParameter.WEBSERVICES_OBJECT_SERVICE, url + "ObjectService?wsdl");
+ parameters.put(SessionParameter.WEBSERVICES_VERSIONING_SERVICE, url + "VersioningService?wsdl");
+ parameters.put(SessionParameter.WEBSERVICES_DISCOVERY_SERVICE, url + "DiscoveryService?wsdl");
+ parameters.put(SessionParameter.WEBSERVICES_RELATIONSHIP_SERVICE, url + "RelationshipService?wsdl");
+ parameters.put(SessionParameter.WEBSERVICES_MULTIFILING_SERVICE, url + "MultiFilingService?wsdl");
+ parameters.put(SessionParameter.WEBSERVICES_POLICY_SERVICE, url + "PolicyService?wsdl");
+ parameters.put(SessionParameter.WEBSERVICES_ACL_SERVICE, url + "ACLService?wsdl");
+
+ parameters.put(SessionParameter.REPOSITORY_ID, getRepositoryId());
+ parameters.put(SessionParameter.USER, USER);
+ parameters.put(SessionParameter.PASSWORD, PASSWORD);
+
+ return SessionFactoryImpl.newInstance().createSession(parameters);
+ }
+
+ /**
+ * Creates a new CmisProvider object that uses the AtomPub binding. For
+ * low-level tests only!
+ */
+ public static CmisBinding createAtomPubBinding() {
+ String url = "http://" + HOST + ":" + PORT + ATOMPUB_PATH;
+
+ Map<String, String> parameters = new HashMap<String, String>();
+
+ parameters.put(SessionParameter.USER, USER);
+ parameters.put(SessionParameter.PASSWORD, PASSWORD);
+
+ parameters.put(SessionParameter.ATOMPUB_URL, url);
+
+ return CmisBindingFactory.newInstance().createCmisAtomPubBinding(parameters);
+ }
+
+ /**
+ * Creates a new CmisProvider object that uses the Web Services binding. For
+ * low-level tests only!
+ */
+ public static CmisBinding createWebServicesBinding() {
+ String url = "http://" + HOST + ":" + PORT + WEBSERVICES_PATH;
+
+ Map<String, String> parameters = new HashMap<String, String>();
+
+ parameters.put(SessionParameter.USER, USER);
+ parameters.put(SessionParameter.PASSWORD, PASSWORD);
+
+ parameters.put(SessionParameter.WEBSERVICES_REPOSITORY_SERVICE, url + "RepositoryService?wsdl");
+ parameters.put(SessionParameter.WEBSERVICES_NAVIGATION_SERVICE, url + "NavigationService?wsdl");
+ parameters.put(SessionParameter.WEBSERVICES_OBJECT_SERVICE, url + "ObjectService?wsdl");
+ parameters.put(SessionParameter.WEBSERVICES_VERSIONING_SERVICE, url + "VersioningService?wsdl");
+ parameters.put(SessionParameter.WEBSERVICES_DISCOVERY_SERVICE, url + "DiscoveryService?wsdl");
+ parameters.put(SessionParameter.WEBSERVICES_RELATIONSHIP_SERVICE, url + "RelationshipService?wsdl");
+ parameters.put(SessionParameter.WEBSERVICES_MULTIFILING_SERVICE, url + "MultiFilingService?wsdl");
+ parameters.put(SessionParameter.WEBSERVICES_POLICY_SERVICE, url + "PolicyService?wsdl");
+ parameters.put(SessionParameter.WEBSERVICES_ACL_SERVICE, url + "ACLService?wsdl");
+
+ return CmisBindingFactory.newInstance().createCmisWebServicesBinding(parameters);
+ }
}
\ No newline at end of file
Propchange: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/SessionFactory.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/AbstractReadOnlyAclCapabilityIT.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/AbstractReadOnlyContentStreamIT.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/AbstractReadOnlyDiscoverIT.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/AbstractReadOnlyNavigationIT.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/AbstractReadOnlyObjectIT.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/AbstractReadOnlyRepositoryInfoIT.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/AbstractReadOnlySessionIT.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/AbstractReadOnlyTypeIT.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/AbstractSessionTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/AbstractWriteAclT.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/AbstractWriteAclT.java?rev=980514&r1=980513&r2=980514&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/AbstractWriteAclT.java (original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/AbstractWriteAclT.java Thu Jul 29 17:18:20 2010
@@ -1,102 +1,102 @@
-/*
- * 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.fit.runtime;
-
-import static org.junit.Assert.assertNotNull;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.UUID;
-
-import org.apache.chemistry.opencmis.client.api.Document;
-import org.apache.chemistry.opencmis.client.api.ObjectId;
-import org.apache.chemistry.opencmis.client.api.OperationContext;
-import org.apache.chemistry.opencmis.client.api.Property;
-import org.apache.chemistry.opencmis.commons.PropertyIds;
-import org.apache.chemistry.opencmis.commons.data.Ace;
-import org.apache.chemistry.opencmis.commons.data.Acl;
-import org.apache.chemistry.opencmis.commons.enums.AclPropagation;
-import org.apache.chemistry.opencmis.commons.enums.VersioningState;
-import org.junit.Test;
-
-public abstract class AbstractWriteAclT extends AbstractSessionTest {
-
- /**
- * Bug Scenario:
- *
- * - create file - apply ACL - read file by 2nd session - read properties <-
- * side effect with caching? - read ACL -> didn't work
- */
- @Test
- public void createFileApplyAclAndGetAclFromNewSession() {
- this.session.getDefaultContext().setIncludeAcls(true);
- this.session2.getDefaultContext().setIncludeAcls(true);
-
- ObjectId parentId = this.session.createObjectId(this.fixture.getTestRootId());
- String folderName = UUID.randomUUID().toString();
- String typeId = FixtureData.DOCUMENT_TYPE_ID.value();
-
- // properties
- Map<String, Object> properties = new HashMap<String, Object>();
- properties.put(PropertyIds.NAME, folderName);
- properties.put(PropertyIds.OBJECT_TYPE_ID, typeId);
-
- // permissions
- List<Ace> aces = new ArrayList<Ace>();
- ArrayList<String> permissions = new ArrayList<String>();
- permissions.add("cmis:read");
- aces.add(this.session.getObjectFactory().createAce("everyone", permissions));
-
- // create document
- ObjectId id = this.session.createDocument(properties, parentId, null, VersioningState.NONE, null, null, null);
- assertNotNull(id);
-
- // get document for id
- Document doc = (Document) this.session.getObject(id);
- assertNotNull(doc);
-
- // apply acl (not supported by InMemory?)
- Acl acl = doc.applyAcl(aces, null, AclPropagation.PROPAGATE);
- assertNotNull(acl);
-
- // read & check acls
- Acl acl2 = doc.getAcl();
- assertNotNull(acl2);
-
- /*
- * Session 2
- */
-
- // get document for id
- Document doc2 = (Document) this.session2.getObject(id);
- assertNotNull(doc2);
-
- // read properties (required to reproduce the bug)
- List<Property<?>> pl2 = doc2.getProperties();
- assertNotNull(pl2);
-
- // read & check acls
- Acl acl3 = doc2.getAcl();
- assertNotNull(acl3);
-
- }
-
-}
+/*
+ * 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.fit.runtime;
+
+import static org.junit.Assert.assertNotNull;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+
+import org.apache.chemistry.opencmis.client.api.Document;
+import org.apache.chemistry.opencmis.client.api.ObjectId;
+import org.apache.chemistry.opencmis.client.api.OperationContext;
+import org.apache.chemistry.opencmis.client.api.Property;
+import org.apache.chemistry.opencmis.commons.PropertyIds;
+import org.apache.chemistry.opencmis.commons.data.Ace;
+import org.apache.chemistry.opencmis.commons.data.Acl;
+import org.apache.chemistry.opencmis.commons.enums.AclPropagation;
+import org.apache.chemistry.opencmis.commons.enums.VersioningState;
+import org.junit.Test;
+
+public abstract class AbstractWriteAclT extends AbstractSessionTest {
+
+ /**
+ * Bug Scenario:
+ *
+ * - create file - apply ACL - read file by 2nd session - read properties <-
+ * side effect with caching? - read ACL -> didn't work
+ */
+ @Test
+ public void createFileApplyAclAndGetAclFromNewSession() {
+ this.session.getDefaultContext().setIncludeAcls(true);
+ this.session2.getDefaultContext().setIncludeAcls(true);
+
+ ObjectId parentId = this.session.createObjectId(this.fixture.getTestRootId());
+ String folderName = UUID.randomUUID().toString();
+ String typeId = FixtureData.DOCUMENT_TYPE_ID.value();
+
+ // properties
+ Map<String, Object> properties = new HashMap<String, Object>();
+ properties.put(PropertyIds.NAME, folderName);
+ properties.put(PropertyIds.OBJECT_TYPE_ID, typeId);
+
+ // permissions
+ List<Ace> aces = new ArrayList<Ace>();
+ ArrayList<String> permissions = new ArrayList<String>();
+ permissions.add("cmis:read");
+ aces.add(this.session.getObjectFactory().createAce("everyone", permissions));
+
+ // create document
+ ObjectId id = this.session.createDocument(properties, parentId, null, VersioningState.NONE, null, null, null);
+ assertNotNull(id);
+
+ // get document for id
+ Document doc = (Document) this.session.getObject(id);
+ assertNotNull(doc);
+
+ // apply acl (not supported by InMemory?)
+ Acl acl = doc.applyAcl(aces, null, AclPropagation.PROPAGATE);
+ assertNotNull(acl);
+
+ // read & check acls
+ Acl acl2 = doc.getAcl();
+ assertNotNull(acl2);
+
+ /*
+ * Session 2
+ */
+
+ // get document for id
+ Document doc2 = (Document) this.session2.getObject(id);
+ assertNotNull(doc2);
+
+ // read properties (required to reproduce the bug)
+ List<Property<?>> pl2 = doc2.getProperties();
+ assertNotNull(pl2);
+
+ // read & check acls
+ Acl acl3 = doc2.getAcl();
+ assertNotNull(acl3);
+
+ }
+
+}
Propchange: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/AbstractWriteAclT.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/AbstractWriteObjectIT.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/AbstractWriteObjectIT.java?rev=980514&r1=980513&r2=980514&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/AbstractWriteObjectIT.java (original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/AbstractWriteObjectIT.java Thu Jul 29 17:18:20 2010
@@ -1,383 +1,383 @@
-/*
- * 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.fit.runtime;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.UUID;
-
-import org.apache.chemistry.opencmis.client.api.Document;
-import org.apache.chemistry.opencmis.client.api.ObjectId;
-import org.apache.chemistry.opencmis.client.api.Property;
-import org.apache.chemistry.opencmis.commons.PropertyIds;
-import org.apache.chemistry.opencmis.commons.data.ContentStream;
-import org.apache.chemistry.opencmis.commons.enums.VersioningState;
-import org.apache.chemistry.opencmis.commons.exceptions.CmisContentAlreadyExistsException;
-import org.apache.chemistry.opencmis.commons.exceptions.CmisNotSupportedException;
-import org.junit.Ignore;
-import org.junit.Test;
-
-public abstract class AbstractWriteObjectIT extends AbstractSessionTest {
-
- @Test
- public void createFolder() {
- ObjectId parentId = this.session.createObjectId(this.fixture.getTestRootId());
- String folderName = UUID.randomUUID().toString();
- String typeId = FixtureData.FOLDER_TYPE_ID.value();
-
- Map<String, Object> properties = new HashMap<String, Object>();
- properties.put(PropertyIds.NAME, folderName);
- properties.put(PropertyIds.OBJECT_TYPE_ID, typeId);
-
- ObjectId id = this.session.createFolder(properties, parentId, null, null, null);
- assertNotNull(id);
- }
-
- @Test
- public void createDocument() throws IOException {
- ObjectId parentId = this.session.createObjectId(this.fixture.getTestRootId());
- String folderName = UUID.randomUUID().toString();
- String typeId = FixtureData.DOCUMENT_TYPE_ID.value();
-
- Map<String, Object> properties = new HashMap<String, Object>();
- properties.put(PropertyIds.NAME, folderName);
- properties.put(PropertyIds.OBJECT_TYPE_ID, typeId);
-
- String filename = UUID.randomUUID().toString();
- String mimetype = "text/html; charset=UTF-8";
- String content1 = "Im Walde rauscht ein Wasserfall. Wenn's nicht mehr rauscht ist's Wasser all.";
-
- byte[] buf1 = content1.getBytes("UTF-8");
- ByteArrayInputStream in1 = new ByteArrayInputStream(buf1);
- ContentStream contentStream = this.session.getObjectFactory().createContentStream(filename, buf1.length,
- mimetype, in1);
- assertNotNull(contentStream);
-
- ObjectId id = this.session.createDocument(properties, parentId, contentStream, VersioningState.NONE, null,
- null, null);
- assertNotNull(id);
-
- // verify content
- Document doc = (Document) this.session.getObject(id);
- assertNotNull(doc);
- // Assert.assertEquals(buf1.length, doc.getContentStreamLength());
- // Assert.assertEquals(mimetype, doc.getContentStreamMimeType());
- // Assert.assertEquals(filename, doc.getContentStreamFileName());
- String content2 = this.getContentAsString(doc.getContentStream());
- assertEquals(content1, content2);
- }
-
- @Test
- public void createDocumentFromSource() throws IOException {
- try {
- // verify content
- String path = "/" + Fixture.TEST_ROOT_FOLDER_NAME + "/" + FixtureData.DOCUMENT1_NAME;
- Document srcDocument = (Document) this.session.getObjectByPath(path);
- assertNotNull("Document not found: " + path, srcDocument);
- String srcContent = this.getContentAsString(srcDocument.getContentStream());
-
- ObjectId parentFolder = session.createObjectId(this.fixture.getTestRootId());
- String name = UUID.randomUUID().toString();
-
- Map<String, Object> properties = new HashMap<String, Object>();
- properties.put(PropertyIds.NAME, name);
-
- ObjectId dstDocumentId = this.session.createDocumentFromSource(srcDocument, properties, parentFolder,
- VersioningState.NONE, null, null, null);
- assertNotNull(dstDocumentId);
- Document dstDocument = (Document) this.session.getObject(dstDocumentId);
- String dstContent = this.getContentAsString(dstDocument.getContentStream());
- assertEquals(srcContent, dstContent);
-
- } catch (CmisNotSupportedException e) {
- // not an error
- this.log.info(e.getMessage());
- }
- }
-
- @Test
- public void deleteAndCreateContent() throws IOException {
- // verify content
-
- String path = "/" + Fixture.TEST_ROOT_FOLDER_NAME + "/" + FixtureData.DOCUMENT1_NAME;
- Document document = (Document) this.session.getObjectByPath(path);
- assertNotNull("Document not found: " + path, document);
-
- // check default content
- ContentStream contentStream = document.getContentStream();
- assertNotNull(contentStream);
- String contentString = this.getContentAsString(contentStream);
- assertNotNull(contentString);
-
- // delete and set new content
- // ObjectId id = (return id not supported by AtomPub)
- document.deleteContentStream();
- // assertNotNull(id);
-
- String filename = UUID.randomUUID().toString();
- String mimetype = "text/html; charset=UTF-8";
- String content1 = "Im Walde rauscht ein Wasserfall. Wenn's nicht mehr rauscht ist's Wasser all.";
-
- byte[] buf1 = content1.getBytes("UTF-8");
- ByteArrayInputStream in1 = new ByteArrayInputStream(buf1);
- contentStream = this.session.getObjectFactory().createContentStream(filename, buf1.length, mimetype, in1);
- assertNotNull(contentStream);
-
- document.setContentStream(contentStream, true);
-
- // check default content
- ContentStream contentStream2 = document.getContentStream();
- assertNotNull(contentStream2);
- String contentString2 = this.getContentAsString(contentStream2);
- assertNotNull(contentString2);
-
- assertEquals(content1, contentString2);
- }
-
- @Test
- public void updateProperties() {
- // verify content
- String path = "/" + Fixture.TEST_ROOT_FOLDER_NAME + "/" + FixtureData.DOCUMENT1_NAME;
- Document document = (Document) this.session.getObjectByPath(path);
- assertNotNull("Document not found: " + path, document);
-
- document.setProperty(PropertyIds.NAME, "Neuer Name");
- document.updateProperties();
- assertEquals("Neuer Name", document.getName());
- }
-
- @Test
- public void updateSinglePropertyAndCheckName() {
- // verify content
- String path = "/" + Fixture.TEST_ROOT_FOLDER_NAME + "/" + FixtureData.DOCUMENT1_NAME;
- Document document = (Document) this.session.getObjectByPath(path);
- assertNotNull("Document not found: " + path, document);
-
- String value = UUID.randomUUID().toString();
- Map<String, Object> properties = new HashMap<String, Object>();
- properties.put(PropertyIds.CHECKIN_COMMENT, value);
-
- String id = document.getId();
- assertNotNull(id);
-
- // update single property
- ObjectId newId = document.updateProperties(properties);
- assertNotNull(newId);
- assertEquals(id, newId.getId()); // should not be a new version
-
- session.clear();
-
- // verify
- String s1 = FixtureData.DOCUMENT1_NAME.toString();
- String s2 = document.getName();
- assertEquals(s1, s2);
-
- Property<String> p = document.getProperty(PropertyIds.NAME);
- String s3 = p.getFirstValue();
- assertEquals(s1, s3);
-
- Document document2 = (Document) this.session.getObjectByPath(path);
- assertNotNull("Document not found: " + path, document2);
- }
-
- private String getContentAsString(ContentStream stream) throws IOException {
- assertNotNull(stream);
- InputStream in2 = stream.getStream();
- assertNotNull(in2);
- StringBuffer sbuf = null;
- sbuf = new StringBuffer(in2.available());
- int count;
- byte[] buf2 = new byte[100];
- while ((count = in2.read(buf2)) != -1) {
- for (int i = 0; i < count; i++) {
- sbuf.append((char) buf2[i]);
- }
- }
- in2.close();
- return sbuf.toString();
- }
-
- @Test
- public void createDocumentAndSetContent() throws IOException {
- ObjectId parentId = this.session.createObjectId(this.fixture.getTestRootId());
- String folderName = UUID.randomUUID().toString();
- String typeId = FixtureData.DOCUMENT_TYPE_ID.value();
-
- Map<String, Object> properties = new HashMap<String, Object>();
- properties.put(PropertyIds.NAME, folderName);
- properties.put(PropertyIds.OBJECT_TYPE_ID, typeId);
-
- String filename = UUID.randomUUID().toString();
- String mimetype = "text/html; charset=UTF-8";
- String content1 = "Im Walde rauscht ein Wasserfall. Wenn's nicht mehr rauscht ist's Wasser all.";
-
- byte[] buf1 = content1.getBytes("UTF-8");
- ByteArrayInputStream in1 = new ByteArrayInputStream(buf1);
- ContentStream contentStream = this.session.getObjectFactory().createContentStream(filename, buf1.length,
- mimetype, in1);
- assertNotNull(contentStream);
-
- ObjectId id = this.session.createDocument(properties, parentId, null, VersioningState.NONE, null, null, null);
- assertNotNull(id);
-
- // set and verify content
- Document doc = (Document) this.session.getObject(id);
- assertNotNull(doc);
- doc.setContentStream(contentStream, true);
-
- // Assert.assertEquals(buf1.length, doc.getContentStreamLength());
- // Assert.assertEquals(mimetype, doc.getContentStreamMimeType());
- // Assert.assertEquals(filename, doc.getContentStreamFileName());
- String content2 = this.getContentAsString(doc.getContentStream());
- assertEquals(content1, content2);
- }
-
- @Ignore
- @Test
- public void createDocumentAndSetContentNoOverwrite() throws IOException {
- ObjectId parentId = this.session.createObjectId(this.fixture.getTestRootId());
- String folderName = UUID.randomUUID().toString();
- String typeId = FixtureData.DOCUMENT_TYPE_ID.value();
-
- Map<String, Object> properties = new HashMap<String, Object>();
- properties.put(PropertyIds.NAME, folderName);
- properties.put(PropertyIds.OBJECT_TYPE_ID, typeId);
-
- String filename = UUID.randomUUID().toString();
- String mimetype = "text/html; charset=UTF-8";
- String content1 = "Im Walde rauscht ein Wasserfall. Wenn's nicht mehr rauscht ist's Wasser all.";
-
- byte[] buf1 = content1.getBytes("UTF-8");
- ByteArrayInputStream in1 = new ByteArrayInputStream(buf1);
- ContentStream contentStream = this.session.getObjectFactory().createContentStream(filename, buf1.length,
- mimetype, in1);
- assertNotNull(contentStream);
-
- ObjectId id = this.session.createDocument(properties, parentId, null, VersioningState.NONE, null, null, null);
- assertNotNull(id);
-
- // set and verify content
- Document doc = (Document) this.session.getObject(id);
- assertNotNull(doc);
- doc.setContentStream(contentStream, false);
-
- // Assert.assertEquals(buf1.length, doc.getContentStreamLength());
- // Assert.assertEquals(mimetype, doc.getContentStreamMimeType());
- // Assert.assertEquals(filename, doc.getContentStreamFileName());
- String content2 = this.getContentAsString(doc.getContentStream());
- assertEquals(content1, content2);
- }
-
- @Test
- public void createDocumentAndUpdateContent() throws IOException {
- ObjectId parentId = this.session.createObjectId(this.fixture.getTestRootId());
- String folderName = UUID.randomUUID().toString();
- String typeId = FixtureData.DOCUMENT_TYPE_ID.value();
-
- Map<String, Object> properties = new HashMap<String, Object>();
- properties.put(PropertyIds.NAME, folderName);
- properties.put(PropertyIds.OBJECT_TYPE_ID, typeId);
-
- String filename1 = UUID.randomUUID().toString();
- String mimetype = "text/html; charset=UTF-8";
- String content1 = "Im Walde rauscht ein Wasserfall. Wenn's nicht mehr rauscht ist's Wasser all.";
-
- byte[] buf1 = content1.getBytes("UTF-8");
- ByteArrayInputStream in1 = new ByteArrayInputStream(buf1);
- ContentStream contentStream1 = this.session.getObjectFactory().createContentStream(filename1, buf1.length,
- mimetype, in1);
- assertNotNull(contentStream1);
-
- ObjectId id = this.session.createDocument(properties, parentId, contentStream1, VersioningState.NONE, null,
- null, null);
- assertNotNull(id);
-
- // set and verify content
- String filename2 = UUID.randomUUID().toString();
- String content2 = "abc";
-
- byte[] buf2 = content2.getBytes("UTF-8");
- ByteArrayInputStream in2 = new ByteArrayInputStream(buf2);
- ContentStream contentStream2 = this.session.getObjectFactory().createContentStream(filename2, buf2.length,
- mimetype, in2);
- assertNotNull(contentStream2);
-
- Document doc = (Document) this.session.getObject(id);
- assertNotNull(doc);
- doc.setContentStream(contentStream2, true);
-
- // Assert.assertEquals(buf1.length, doc.getContentStreamLength());
- // Assert.assertEquals(mimetype, doc.getContentStreamMimeType());
- // Assert.assertEquals(filename, doc.getContentStreamFileName());
- String content3 = this.getContentAsString(doc.getContentStream());
- assertEquals(content2, content3);
- }
-
- @Ignore
- @Test(expected = CmisContentAlreadyExistsException.class)
- public void createDocumentAndUpdateContentNoOverwrite() throws IOException {
- ObjectId parentId = this.session.createObjectId(this.fixture.getTestRootId());
- String folderName = UUID.randomUUID().toString();
- String typeId = FixtureData.DOCUMENT_TYPE_ID.value();
-
- Map<String, Object> properties = new HashMap<String, Object>();
- properties.put(PropertyIds.NAME, folderName);
- properties.put(PropertyIds.OBJECT_TYPE_ID, typeId);
-
- String filename1 = UUID.randomUUID().toString();
- String mimetype = "text/html; charset=UTF-8";
- String content1 = "Im Walde rauscht ein Wasserfall. Wenn's nicht mehr rauscht ist's Wasser all.";
-
- byte[] buf1 = content1.getBytes("UTF-8");
- ByteArrayInputStream in1 = new ByteArrayInputStream(buf1);
- ContentStream contentStream1 = this.session.getObjectFactory().createContentStream(filename1, buf1.length,
- mimetype, in1);
- assertNotNull(contentStream1);
-
- ObjectId id = this.session.createDocument(properties, parentId, contentStream1, VersioningState.NONE, null,
- null, null);
- assertNotNull(id);
-
- // set and verify content
- String filename2 = UUID.randomUUID().toString();
- String content2 = "abc";
-
- byte[] buf2 = content2.getBytes("UTF-8");
- ByteArrayInputStream in2 = new ByteArrayInputStream(buf2);
- ContentStream contentStream2 = this.session.getObjectFactory().createContentStream(filename2, buf2.length,
- mimetype, in2);
- assertNotNull(contentStream2);
-
- Document doc = (Document) this.session.getObject(id);
- assertNotNull(doc);
- doc.setContentStream(contentStream2, false);
-
- // Assert.assertEquals(buf1.length, doc.getContentStreamLength());
- // Assert.assertEquals(mimetype, doc.getContentStreamMimeType());
- // Assert.assertEquals(filename, doc.getContentStreamFileName());
- String content3 = this.getContentAsString(doc.getContentStream());
- assertEquals(content2, content3);
- }
-}
+/*
+ * 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.fit.runtime;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.UUID;
+
+import org.apache.chemistry.opencmis.client.api.Document;
+import org.apache.chemistry.opencmis.client.api.ObjectId;
+import org.apache.chemistry.opencmis.client.api.Property;
+import org.apache.chemistry.opencmis.commons.PropertyIds;
+import org.apache.chemistry.opencmis.commons.data.ContentStream;
+import org.apache.chemistry.opencmis.commons.enums.VersioningState;
+import org.apache.chemistry.opencmis.commons.exceptions.CmisContentAlreadyExistsException;
+import org.apache.chemistry.opencmis.commons.exceptions.CmisNotSupportedException;
+import org.junit.Ignore;
+import org.junit.Test;
+
+public abstract class AbstractWriteObjectIT extends AbstractSessionTest {
+
+ @Test
+ public void createFolder() {
+ ObjectId parentId = this.session.createObjectId(this.fixture.getTestRootId());
+ String folderName = UUID.randomUUID().toString();
+ String typeId = FixtureData.FOLDER_TYPE_ID.value();
+
+ Map<String, Object> properties = new HashMap<String, Object>();
+ properties.put(PropertyIds.NAME, folderName);
+ properties.put(PropertyIds.OBJECT_TYPE_ID, typeId);
+
+ ObjectId id = this.session.createFolder(properties, parentId, null, null, null);
+ assertNotNull(id);
+ }
+
+ @Test
+ public void createDocument() throws IOException {
+ ObjectId parentId = this.session.createObjectId(this.fixture.getTestRootId());
+ String folderName = UUID.randomUUID().toString();
+ String typeId = FixtureData.DOCUMENT_TYPE_ID.value();
+
+ Map<String, Object> properties = new HashMap<String, Object>();
+ properties.put(PropertyIds.NAME, folderName);
+ properties.put(PropertyIds.OBJECT_TYPE_ID, typeId);
+
+ String filename = UUID.randomUUID().toString();
+ String mimetype = "text/html; charset=UTF-8";
+ String content1 = "Im Walde rauscht ein Wasserfall. Wenn's nicht mehr rauscht ist's Wasser all.";
+
+ byte[] buf1 = content1.getBytes("UTF-8");
+ ByteArrayInputStream in1 = new ByteArrayInputStream(buf1);
+ ContentStream contentStream = this.session.getObjectFactory().createContentStream(filename, buf1.length,
+ mimetype, in1);
+ assertNotNull(contentStream);
+
+ ObjectId id = this.session.createDocument(properties, parentId, contentStream, VersioningState.NONE, null,
+ null, null);
+ assertNotNull(id);
+
+ // verify content
+ Document doc = (Document) this.session.getObject(id);
+ assertNotNull(doc);
+ // Assert.assertEquals(buf1.length, doc.getContentStreamLength());
+ // Assert.assertEquals(mimetype, doc.getContentStreamMimeType());
+ // Assert.assertEquals(filename, doc.getContentStreamFileName());
+ String content2 = this.getContentAsString(doc.getContentStream());
+ assertEquals(content1, content2);
+ }
+
+ @Test
+ public void createDocumentFromSource() throws IOException {
+ try {
+ // verify content
+ String path = "/" + Fixture.TEST_ROOT_FOLDER_NAME + "/" + FixtureData.DOCUMENT1_NAME;
+ Document srcDocument = (Document) this.session.getObjectByPath(path);
+ assertNotNull("Document not found: " + path, srcDocument);
+ String srcContent = this.getContentAsString(srcDocument.getContentStream());
+
+ ObjectId parentFolder = session.createObjectId(this.fixture.getTestRootId());
+ String name = UUID.randomUUID().toString();
+
+ Map<String, Object> properties = new HashMap<String, Object>();
+ properties.put(PropertyIds.NAME, name);
+
+ ObjectId dstDocumentId = this.session.createDocumentFromSource(srcDocument, properties, parentFolder,
+ VersioningState.NONE, null, null, null);
+ assertNotNull(dstDocumentId);
+ Document dstDocument = (Document) this.session.getObject(dstDocumentId);
+ String dstContent = this.getContentAsString(dstDocument.getContentStream());
+ assertEquals(srcContent, dstContent);
+
+ } catch (CmisNotSupportedException e) {
+ // not an error
+ this.log.info(e.getMessage());
+ }
+ }
+
+ @Test
+ public void deleteAndCreateContent() throws IOException {
+ // verify content
+
+ String path = "/" + Fixture.TEST_ROOT_FOLDER_NAME + "/" + FixtureData.DOCUMENT1_NAME;
+ Document document = (Document) this.session.getObjectByPath(path);
+ assertNotNull("Document not found: " + path, document);
+
+ // check default content
+ ContentStream contentStream = document.getContentStream();
+ assertNotNull(contentStream);
+ String contentString = this.getContentAsString(contentStream);
+ assertNotNull(contentString);
+
+ // delete and set new content
+ // ObjectId id = (return id not supported by AtomPub)
+ document.deleteContentStream();
+ // assertNotNull(id);
+
+ String filename = UUID.randomUUID().toString();
+ String mimetype = "text/html; charset=UTF-8";
+ String content1 = "Im Walde rauscht ein Wasserfall. Wenn's nicht mehr rauscht ist's Wasser all.";
+
+ byte[] buf1 = content1.getBytes("UTF-8");
+ ByteArrayInputStream in1 = new ByteArrayInputStream(buf1);
+ contentStream = this.session.getObjectFactory().createContentStream(filename, buf1.length, mimetype, in1);
+ assertNotNull(contentStream);
+
+ document.setContentStream(contentStream, true);
+
+ // check default content
+ ContentStream contentStream2 = document.getContentStream();
+ assertNotNull(contentStream2);
+ String contentString2 = this.getContentAsString(contentStream2);
+ assertNotNull(contentString2);
+
+ assertEquals(content1, contentString2);
+ }
+
+ @Test
+ public void updateProperties() {
+ // verify content
+ String path = "/" + Fixture.TEST_ROOT_FOLDER_NAME + "/" + FixtureData.DOCUMENT1_NAME;
+ Document document = (Document) this.session.getObjectByPath(path);
+ assertNotNull("Document not found: " + path, document);
+
+ document.setProperty(PropertyIds.NAME, "Neuer Name");
+ document.updateProperties();
+ assertEquals("Neuer Name", document.getName());
+ }
+
+ @Test
+ public void updateSinglePropertyAndCheckName() {
+ // verify content
+ String path = "/" + Fixture.TEST_ROOT_FOLDER_NAME + "/" + FixtureData.DOCUMENT1_NAME;
+ Document document = (Document) this.session.getObjectByPath(path);
+ assertNotNull("Document not found: " + path, document);
+
+ String value = UUID.randomUUID().toString();
+ Map<String, Object> properties = new HashMap<String, Object>();
+ properties.put(PropertyIds.CHECKIN_COMMENT, value);
+
+ String id = document.getId();
+ assertNotNull(id);
+
+ // update single property
+ ObjectId newId = document.updateProperties(properties);
+ assertNotNull(newId);
+ assertEquals(id, newId.getId()); // should not be a new version
+
+ session.clear();
+
+ // verify
+ String s1 = FixtureData.DOCUMENT1_NAME.toString();
+ String s2 = document.getName();
+ assertEquals(s1, s2);
+
+ Property<String> p = document.getProperty(PropertyIds.NAME);
+ String s3 = p.getFirstValue();
+ assertEquals(s1, s3);
+
+ Document document2 = (Document) this.session.getObjectByPath(path);
+ assertNotNull("Document not found: " + path, document2);
+ }
+
+ private String getContentAsString(ContentStream stream) throws IOException {
+ assertNotNull(stream);
+ InputStream in2 = stream.getStream();
+ assertNotNull(in2);
+ StringBuffer sbuf = null;
+ sbuf = new StringBuffer(in2.available());
+ int count;
+ byte[] buf2 = new byte[100];
+ while ((count = in2.read(buf2)) != -1) {
+ for (int i = 0; i < count; i++) {
+ sbuf.append((char) buf2[i]);
+ }
+ }
+ in2.close();
+ return sbuf.toString();
+ }
+
+ @Test
+ public void createDocumentAndSetContent() throws IOException {
+ ObjectId parentId = this.session.createObjectId(this.fixture.getTestRootId());
+ String folderName = UUID.randomUUID().toString();
+ String typeId = FixtureData.DOCUMENT_TYPE_ID.value();
+
+ Map<String, Object> properties = new HashMap<String, Object>();
+ properties.put(PropertyIds.NAME, folderName);
+ properties.put(PropertyIds.OBJECT_TYPE_ID, typeId);
+
+ String filename = UUID.randomUUID().toString();
+ String mimetype = "text/html; charset=UTF-8";
+ String content1 = "Im Walde rauscht ein Wasserfall. Wenn's nicht mehr rauscht ist's Wasser all.";
+
+ byte[] buf1 = content1.getBytes("UTF-8");
+ ByteArrayInputStream in1 = new ByteArrayInputStream(buf1);
+ ContentStream contentStream = this.session.getObjectFactory().createContentStream(filename, buf1.length,
+ mimetype, in1);
+ assertNotNull(contentStream);
+
+ ObjectId id = this.session.createDocument(properties, parentId, null, VersioningState.NONE, null, null, null);
+ assertNotNull(id);
+
+ // set and verify content
+ Document doc = (Document) this.session.getObject(id);
+ assertNotNull(doc);
+ doc.setContentStream(contentStream, true);
+
+ // Assert.assertEquals(buf1.length, doc.getContentStreamLength());
+ // Assert.assertEquals(mimetype, doc.getContentStreamMimeType());
+ // Assert.assertEquals(filename, doc.getContentStreamFileName());
+ String content2 = this.getContentAsString(doc.getContentStream());
+ assertEquals(content1, content2);
+ }
+
+ @Ignore
+ @Test
+ public void createDocumentAndSetContentNoOverwrite() throws IOException {
+ ObjectId parentId = this.session.createObjectId(this.fixture.getTestRootId());
+ String folderName = UUID.randomUUID().toString();
+ String typeId = FixtureData.DOCUMENT_TYPE_ID.value();
+
+ Map<String, Object> properties = new HashMap<String, Object>();
+ properties.put(PropertyIds.NAME, folderName);
+ properties.put(PropertyIds.OBJECT_TYPE_ID, typeId);
+
+ String filename = UUID.randomUUID().toString();
+ String mimetype = "text/html; charset=UTF-8";
+ String content1 = "Im Walde rauscht ein Wasserfall. Wenn's nicht mehr rauscht ist's Wasser all.";
+
+ byte[] buf1 = content1.getBytes("UTF-8");
+ ByteArrayInputStream in1 = new ByteArrayInputStream(buf1);
+ ContentStream contentStream = this.session.getObjectFactory().createContentStream(filename, buf1.length,
+ mimetype, in1);
+ assertNotNull(contentStream);
+
+ ObjectId id = this.session.createDocument(properties, parentId, null, VersioningState.NONE, null, null, null);
+ assertNotNull(id);
+
+ // set and verify content
+ Document doc = (Document) this.session.getObject(id);
+ assertNotNull(doc);
+ doc.setContentStream(contentStream, false);
+
+ // Assert.assertEquals(buf1.length, doc.getContentStreamLength());
+ // Assert.assertEquals(mimetype, doc.getContentStreamMimeType());
+ // Assert.assertEquals(filename, doc.getContentStreamFileName());
+ String content2 = this.getContentAsString(doc.getContentStream());
+ assertEquals(content1, content2);
+ }
+
+ @Test
+ public void createDocumentAndUpdateContent() throws IOException {
+ ObjectId parentId = this.session.createObjectId(this.fixture.getTestRootId());
+ String folderName = UUID.randomUUID().toString();
+ String typeId = FixtureData.DOCUMENT_TYPE_ID.value();
+
+ Map<String, Object> properties = new HashMap<String, Object>();
+ properties.put(PropertyIds.NAME, folderName);
+ properties.put(PropertyIds.OBJECT_TYPE_ID, typeId);
+
+ String filename1 = UUID.randomUUID().toString();
+ String mimetype = "text/html; charset=UTF-8";
+ String content1 = "Im Walde rauscht ein Wasserfall. Wenn's nicht mehr rauscht ist's Wasser all.";
+
+ byte[] buf1 = content1.getBytes("UTF-8");
+ ByteArrayInputStream in1 = new ByteArrayInputStream(buf1);
+ ContentStream contentStream1 = this.session.getObjectFactory().createContentStream(filename1, buf1.length,
+ mimetype, in1);
+ assertNotNull(contentStream1);
+
+ ObjectId id = this.session.createDocument(properties, parentId, contentStream1, VersioningState.NONE, null,
+ null, null);
+ assertNotNull(id);
+
+ // set and verify content
+ String filename2 = UUID.randomUUID().toString();
+ String content2 = "abc";
+
+ byte[] buf2 = content2.getBytes("UTF-8");
+ ByteArrayInputStream in2 = new ByteArrayInputStream(buf2);
+ ContentStream contentStream2 = this.session.getObjectFactory().createContentStream(filename2, buf2.length,
+ mimetype, in2);
+ assertNotNull(contentStream2);
+
+ Document doc = (Document) this.session.getObject(id);
+ assertNotNull(doc);
+ doc.setContentStream(contentStream2, true);
+
+ // Assert.assertEquals(buf1.length, doc.getContentStreamLength());
+ // Assert.assertEquals(mimetype, doc.getContentStreamMimeType());
+ // Assert.assertEquals(filename, doc.getContentStreamFileName());
+ String content3 = this.getContentAsString(doc.getContentStream());
+ assertEquals(content2, content3);
+ }
+
+ @Ignore
+ @Test(expected = CmisContentAlreadyExistsException.class)
+ public void createDocumentAndUpdateContentNoOverwrite() throws IOException {
+ ObjectId parentId = this.session.createObjectId(this.fixture.getTestRootId());
+ String folderName = UUID.randomUUID().toString();
+ String typeId = FixtureData.DOCUMENT_TYPE_ID.value();
+
+ Map<String, Object> properties = new HashMap<String, Object>();
+ properties.put(PropertyIds.NAME, folderName);
+ properties.put(PropertyIds.OBJECT_TYPE_ID, typeId);
+
+ String filename1 = UUID.randomUUID().toString();
+ String mimetype = "text/html; charset=UTF-8";
+ String content1 = "Im Walde rauscht ein Wasserfall. Wenn's nicht mehr rauscht ist's Wasser all.";
+
+ byte[] buf1 = content1.getBytes("UTF-8");
+ ByteArrayInputStream in1 = new ByteArrayInputStream(buf1);
+ ContentStream contentStream1 = this.session.getObjectFactory().createContentStream(filename1, buf1.length,
+ mimetype, in1);
+ assertNotNull(contentStream1);
+
+ ObjectId id = this.session.createDocument(properties, parentId, contentStream1, VersioningState.NONE, null,
+ null, null);
+ assertNotNull(id);
+
+ // set and verify content
+ String filename2 = UUID.randomUUID().toString();
+ String content2 = "abc";
+
+ byte[] buf2 = content2.getBytes("UTF-8");
+ ByteArrayInputStream in2 = new ByteArrayInputStream(buf2);
+ ContentStream contentStream2 = this.session.getObjectFactory().createContentStream(filename2, buf2.length,
+ mimetype, in2);
+ assertNotNull(contentStream2);
+
+ Document doc = (Document) this.session.getObject(id);
+ assertNotNull(doc);
+ doc.setContentStream(contentStream2, false);
+
+ // Assert.assertEquals(buf1.length, doc.getContentStreamLength());
+ // Assert.assertEquals(mimetype, doc.getContentStreamMimeType());
+ // Assert.assertEquals(filename, doc.getContentStreamFileName());
+ String content3 = this.getContentAsString(doc.getContentStream());
+ assertEquals(content2, content3);
+ }
+}
Propchange: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/AbstractWriteObjectIT.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/AbstractWriteObjectRelationIT.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/AbstractWriteObjectRelationIT.java?rev=980514&r1=980513&r2=980514&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/AbstractWriteObjectRelationIT.java (original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/AbstractWriteObjectRelationIT.java Thu Jul 29 17:18:20 2010
@@ -1,68 +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.chemistry.opencmis.fit.runtime;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.chemistry.opencmis.client.api.Document;
-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.Relationship;
-import org.apache.chemistry.opencmis.commons.PropertyIds;
-import org.apache.chemistry.opencmis.commons.enums.RelationshipDirection;
-import org.junit.Ignore;
-import org.junit.Test;
-
-// relations not yet supported
-@Ignore
-public abstract class AbstractWriteObjectRelationIT extends AbstractSessionTest {
-
- @Test
- public void createAndLoopRelations() {
- String path1 = "/" + Fixture.TEST_ROOT_FOLDER_NAME + "/" + FixtureData.DOCUMENT1_NAME;
- Document document1 = (Document) this.session.getObjectByPath(path1);
- assertNotNull("Document not found: " + path1, document1);
-
- String path2 = "/" + Fixture.TEST_ROOT_FOLDER_NAME + "/" + FixtureData.DOCUMENT2_NAME;
- Document document2 = (Document) this.session.getObjectByPath(path2);
- assertNotNull("Document not found: " + path2, document2);
-
- Map<String, Object> properties = new HashMap<String, Object>();
- properties.put(PropertyIds.OBJECT_TYPE_ID, ObjectType.RELATIONSHIP_BASETYPE_ID);
- properties.put(PropertyIds.SOURCE_ID, document1.getId());
- properties.put(PropertyIds.TARGET_ID, document2.getId());
-
- ObjectId id = this.session.createRelationship(properties, null, null, null);
-
- ObjectType ot = document1.getType();
- ItemIterable<Relationship> relations = document1.getRelationships(true, RelationshipDirection.EITHER, ot,
- this.session.getDefaultContext());
- for (Relationship r : relations) {
- assertNotNull(r);
- assertEquals(id, r.getId());
- break;
- }
- }
-
-}
+/*
+ * 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.fit.runtime;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.chemistry.opencmis.client.api.Document;
+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.Relationship;
+import org.apache.chemistry.opencmis.commons.PropertyIds;
+import org.apache.chemistry.opencmis.commons.enums.RelationshipDirection;
+import org.junit.Ignore;
+import org.junit.Test;
+
+// relations not yet supported
+@Ignore
+public abstract class AbstractWriteObjectRelationIT extends AbstractSessionTest {
+
+ @Test
+ public void createAndLoopRelations() {
+ String path1 = "/" + Fixture.TEST_ROOT_FOLDER_NAME + "/" + FixtureData.DOCUMENT1_NAME;
+ Document document1 = (Document) this.session.getObjectByPath(path1);
+ assertNotNull("Document not found: " + path1, document1);
+
+ String path2 = "/" + Fixture.TEST_ROOT_FOLDER_NAME + "/" + FixtureData.DOCUMENT2_NAME;
+ Document document2 = (Document) this.session.getObjectByPath(path2);
+ assertNotNull("Document not found: " + path2, document2);
+
+ Map<String, Object> properties = new HashMap<String, Object>();
+ properties.put(PropertyIds.OBJECT_TYPE_ID, ObjectType.RELATIONSHIP_BASETYPE_ID);
+ properties.put(PropertyIds.SOURCE_ID, document1.getId());
+ properties.put(PropertyIds.TARGET_ID, document2.getId());
+
+ ObjectId id = this.session.createRelationship(properties, null, null, null);
+
+ ObjectType ot = document1.getType();
+ ItemIterable<Relationship> relations = document1.getRelationships(true, RelationshipDirection.EITHER, ot,
+ this.session.getDefaultContext());
+ for (Relationship r : relations) {
+ assertNotNull(r);
+ assertEquals(id, r.getId());
+ break;
+ }
+ }
+
+}
Propchange: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/AbstractWriteObjectRelationIT.java
------------------------------------------------------------------------------
svn:eol-style = native