Return-Path: Delivered-To: apmail-incubator-chemistry-commits-archive@minotaur.apache.org Received: (qmail 33091 invoked from network); 6 Oct 2010 17:47:52 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 6 Oct 2010 17:47:52 -0000 Received: (qmail 58243 invoked by uid 500); 6 Oct 2010 17:47:52 -0000 Delivered-To: apmail-incubator-chemistry-commits-archive@incubator.apache.org Received: (qmail 58211 invoked by uid 500); 6 Oct 2010 17:47:52 -0000 Mailing-List: contact chemistry-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: chemistry-dev@incubator.apache.org Delivered-To: mailing list chemistry-commits@incubator.apache.org Received: (qmail 58203 invoked by uid 99); 6 Oct 2010 17:47:52 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 Oct 2010 17:47:52 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 Oct 2010 17:47:48 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 54CB723888E7; Wed, 6 Oct 2010 17:47:26 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1005186 - in /incubator/chemistry/opencmis/trunk: chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/ chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/test/java/or... Date: Wed, 06 Oct 2010 17:47:26 -0000 To: chemistry-commits@incubator.apache.org From: fguillaume@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20101006174726.54CB723888E7@eris.apache.org> Author: fguillaume Date: Wed Oct 6 17:47:25 2010 New Revision: 1005186 URL: http://svn.apache.org/viewvc?rev=1005186&view=rev Log: Better copy() API, FIT tests for copy and move Added: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/AbstractWriteObjectCopyIT.java (with props) incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/AbstractWriteObjectMoveIT.java (with props) incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/atom/WriteObjectCopyAtomPubIT.java (with props) incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/atom/WriteObjectMoveAtomPubIT.java (with props) incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/webservices/WriteObjectCopyWebServicesIT.java (with props) incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/webservices/WriteObjectMoveWebServicesIT.java (with props) Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/Document.java incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/test/java/org/apache/chemistry/opencmis/client/bindings/atompub/SimpleReadWriteTests.java incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/test/java/org/apache/chemistry/opencmis/client/bindings/framework/AbstractSimpleReadWriteTests.java incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/test/java/org/apache/chemistry/opencmis/client/bindings/webservices/SimpleReadWriteTests.java incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/PersistentDocumentImpl.java incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/PersistentFolderImpl.java Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/Document.java URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/Document.java?rev=1005186&r1=1005185&r2=1005186&view=diff ============================================================================== --- incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/Document.java (original) +++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/Document.java Wed Oct 6 17:47:25 2010 @@ -27,7 +27,7 @@ import org.apache.chemistry.opencmis.com /** * CMIS Document. - * + * * Domain Model 2.4 */ public interface Document extends FileableCmisObject { @@ -41,7 +41,7 @@ public interface Document extends Fileab /** * Retrieves the content stream of this document. - * + * * @return the content stream, or {@code null} */ ContentStream getContentStream(); @@ -49,7 +49,7 @@ public interface Document extends Fileab /** * Retrieves the content stream that is associated with the given stream id. * This is usually a rendition of the document. - * + * * @return the content stream, or {@code null} */ ContentStream getContentStream(String streamId); @@ -69,7 +69,7 @@ public interface Document extends Fileab /** * Checks out the document and returns the object id of the PWC (private * working copy). - * + * * @return PWC id */ ObjectId checkOut(); // returns the PWC id @@ -83,7 +83,7 @@ public interface Document extends Fileab /** * If this is a PWC (private working copy) it performs a check in. If this * is not a PWC it an exception will be thrown. - * + * * @return new document id */ ObjectId checkIn(boolean major, Map properties, ContentStream contentStream, String checkinComment, @@ -92,18 +92,18 @@ public interface Document extends Fileab /** * If this is a PWC (private working copy) it performs a check in. If this * is not a PWC it an exception will be thrown. - * + * * @return new document id */ ObjectId checkIn(boolean major, Map properties, ContentStream contentStream, String checkinComment); /** * Fetches the latest major or minor version of this document. - * + * * @param major * if true the latest major version will be * returned, otherwise the very last version will be returned - * + * * @return the latest document object */ Document getObjectOfLatestVersion(boolean major); @@ -111,11 +111,11 @@ public interface Document extends Fileab /** * Fetches the latest major or minor version of this document using the * given {@link OperationContext}. - * + * * @param major * if true the latest major version will be * returned, otherwise the very last version will be returned - * + * * @return the latest document object */ Document getObjectOfLatestVersion(boolean major, OperationContext context); @@ -131,6 +131,23 @@ public interface Document extends Fileab */ List getAllVersions(OperationContext context); + /** + * Creates a copy of this document, including content. + * + * @return the new document object + */ + Document copy(ObjectId targetFolderId); + + /** + * Creates a copy of this document, including content. + * + * @return the new document object or {@code null} if the parameter + * {@code context} was set to {@code null} + */ + Document copy(ObjectId targetFolderId, Map properties, + VersioningState versioningState, List policies, + List addACEs, List removeACEs, OperationContext context); + // document specific properties Boolean isImmutable(); // cmis:isImmutable @@ -161,14 +178,4 @@ public interface Document extends Fileab String getContentStreamId(); // cmis:contentStreamId - /** - * Creates a (content) copy of this document. - */ - Document copy(List> properties, VersioningState versioningState, List policies, - List addACEs, List removeACEs); - /** - * Creates a (content) copy of this document. - */ - Document copy(List> properties, VersioningState versioningState); - } Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/test/java/org/apache/chemistry/opencmis/client/bindings/atompub/SimpleReadWriteTests.java URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/test/java/org/apache/chemistry/opencmis/client/bindings/atompub/SimpleReadWriteTests.java?rev=1005186&r1=1005185&r2=1005186&view=diff ============================================================================== --- incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/test/java/org/apache/chemistry/opencmis/client/bindings/atompub/SimpleReadWriteTests.java (original) +++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/test/java/org/apache/chemistry/opencmis/client/bindings/atompub/SimpleReadWriteTests.java Wed Oct 6 17:47:25 2010 @@ -26,7 +26,6 @@ import org.apache.chemistry.opencmis.com /** * @author Florian Müller - * */ public class SimpleReadWriteTests extends AbstractSimpleReadWriteTests { @@ -40,6 +39,7 @@ public class SimpleReadWriteTests extend fTests.add(TEST_UPDATE_PROPERTIES); fTests.add(TEST_DELETE_TREE); fTests.add(TEST_MOVE_OBJECT); + // fTests.add(TEST_COPY_OBJECT); fTests.add(TEST_VERSIONING); } Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/test/java/org/apache/chemistry/opencmis/client/bindings/framework/AbstractSimpleReadWriteTests.java URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/test/java/org/apache/chemistry/opencmis/client/bindings/framework/AbstractSimpleReadWriteTests.java?rev=1005186&r1=1005185&r2=1005186&view=diff ============================================================================== --- incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/test/java/org/apache/chemistry/opencmis/client/bindings/framework/AbstractSimpleReadWriteTests.java (original) +++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/test/java/org/apache/chemistry/opencmis/client/bindings/framework/AbstractSimpleReadWriteTests.java Wed Oct 6 17:47:25 2010 @@ -27,6 +27,7 @@ import org.apache.chemistry.opencmis.com import org.apache.chemistry.opencmis.commons.data.Acl; import org.apache.chemistry.opencmis.commons.data.ContentStream; import org.apache.chemistry.opencmis.commons.data.ObjectData; +import org.apache.chemistry.opencmis.commons.data.ObjectInFolderData; import org.apache.chemistry.opencmis.commons.data.Properties; import org.apache.chemistry.opencmis.commons.data.PropertyData; import org.apache.chemistry.opencmis.commons.enums.CapabilityContentStreamUpdates; @@ -37,9 +38,8 @@ import org.apache.chemistry.opencmis.com /** * Simple read-write test. - * + * * @author Florian Müller - * */ public abstract class AbstractSimpleReadWriteTests extends AbstractCmisTestCase { @@ -50,6 +50,7 @@ public abstract class AbstractSimpleRead public static final String TEST_UPDATE_PROPERTIES = "updateProperties"; public static final String TEST_DELETE_TREE = "deleteTree"; public static final String TEST_MOVE_OBJECT = "moveObject"; + public static final String TEST_COPY_OBJECT = "copyObject"; public static final String TEST_VERSIONING = "versioning"; private static final byte[] CONTENT = "My document test content!".getBytes(); @@ -330,6 +331,44 @@ public abstract class AbstractSimpleRead } /** + * Tests copy object. + */ + public void testCopyObject() throws Exception { + if (!isEnabled(TEST_COPY_OBJECT)) { + return; + } + + // create folders + String folder1 = createDefaultFolder(getTestRootFolder(), "folder1"); + String folder2 = createDefaultFolder(getTestRootFolder(), "folder2"); + + // create document + String docId = createDefaultDocument(folder1, "testdoc.txt", + CONTENT_TYPE, CONTENT); + + // copy it with new properties + List> updatePropList = new ArrayList>(); + updatePropList.add(getObjectFactory().createPropertyStringData( + PropertyIds.NAME, "newdocname")); + Properties updateProperties = getObjectFactory().createPropertiesData( + updatePropList); + + String copyId = getBinding().getObjectService().createDocumentFromSource( + getTestRepositoryId(), docId, updateProperties, folder2, null, + null, null, null, null); + assertNotNull(copyId); + + assertTrue(existsObject(copyId)); + ObjectInFolderData copy = getChild(folder2, copyId); + String updatedName = (String) copy.getObject().getProperties().getProperties().get( + PropertyIds.NAME).getFirstValue(); + assertEquals("newdocname", updatedName); + + deleteTree(folder1); + deleteTree(folder2); + } + + /** * Test check-in/check-out. */ public void testVersioning() throws Exception { Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/test/java/org/apache/chemistry/opencmis/client/bindings/webservices/SimpleReadWriteTests.java URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/test/java/org/apache/chemistry/opencmis/client/bindings/webservices/SimpleReadWriteTests.java?rev=1005186&r1=1005185&r2=1005186&view=diff ============================================================================== --- incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/test/java/org/apache/chemistry/opencmis/client/bindings/webservices/SimpleReadWriteTests.java (original) +++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/test/java/org/apache/chemistry/opencmis/client/bindings/webservices/SimpleReadWriteTests.java Wed Oct 6 17:47:25 2010 @@ -26,7 +26,6 @@ import org.apache.chemistry.opencmis.com /** * @author Florian Müller - * */ public class SimpleReadWriteTests extends AbstractSimpleReadWriteTests { @@ -41,6 +40,7 @@ public class SimpleReadWriteTests extend fTests.add(TEST_UPDATE_PROPERTIES); fTests.add(TEST_DELETE_TREE); fTests.add(TEST_MOVE_OBJECT); + fTests.add(TEST_COPY_OBJECT); fTests.add(TEST_VERSIONING); } Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/PersistentDocumentImpl.java URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/PersistentDocumentImpl.java?rev=1005186&r1=1005185&r2=1005186&view=diff ============================================================================== --- incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/PersistentDocumentImpl.java (original) +++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/PersistentDocumentImpl.java Wed Oct 6 17:47:25 2010 @@ -32,7 +32,6 @@ import org.apache.chemistry.opencmis.cli import org.apache.chemistry.opencmis.client.api.ObjectType; import org.apache.chemistry.opencmis.client.api.OperationContext; import org.apache.chemistry.opencmis.client.api.Policy; -import org.apache.chemistry.opencmis.client.api.Property; import org.apache.chemistry.opencmis.commons.PropertyIds; import org.apache.chemistry.opencmis.commons.data.Ace; import org.apache.chemistry.opencmis.commons.data.ContentStream; @@ -40,6 +39,7 @@ import org.apache.chemistry.opencmis.com import org.apache.chemistry.opencmis.commons.enums.Updatability; import org.apache.chemistry.opencmis.commons.enums.VersioningState; import org.apache.chemistry.opencmis.commons.exceptions.CmisConstraintException; +import org.apache.chemistry.opencmis.commons.exceptions.CmisInvalidArgumentException; import org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException; import org.apache.chemistry.opencmis.commons.spi.Holder; @@ -114,9 +114,37 @@ public class PersistentDocumentImpl exte // operations - public Document copy(List> properties, VersioningState versioningState, List policies, - List addACEs, List removeACEs) { - throw new CmisRuntimeException("not implemented"); + public Document copy(ObjectId targetFolderId, Map properties, + VersioningState versioningState, List policies, + List addACEs, List removeACEs, OperationContext context) { + if (targetFolderId == null || targetFolderId.getId() == null) { + throw new CmisInvalidArgumentException("Target must be set"); + } + + ObjectFactory factory = getObjectFactory(); + Set updatability = new HashSet(); + updatability.add(Updatability.READWRITE); + + String newId = getBinding().getObjectService().createDocumentFromSource( + getRepositoryId(), getId(), + factory.convertProperties(properties, getType(), updatability), + targetFolderId.getId(), versioningState, factory.convertPolicies(policies), + factory.convertAces(addACEs), factory.convertAces(removeACEs), null); + + // if no context is provided the object will not be fetched + if (context == null || newId == null) { + return null; + } + // get the new object + CmisObject object = getSession().getObject(getSession().createObjectId(newId), context); + if (!(object instanceof Document)) { + throw new CmisRuntimeException("Newly created object is not a document! New id: " + newId); + } + return (Document) object; } + + public Document copy(ObjectId targetFolderId) { + return copy(targetFolderId, null, null, null, null, null, + getSession().getDefaultContext()); } public void deleteAllVersions() { @@ -337,8 +365,4 @@ public class PersistentDocumentImpl exte public ObjectId checkIn(boolean major, Map properties, ContentStream contentStream, String checkinComment) { return this.checkIn(major, properties, contentStream, checkinComment, null, null, null); } - - public Document copy(List> properties, VersioningState versioningState) { - return this.copy(properties, versioningState, null, null, null); - } } Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/PersistentFolderImpl.java URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/PersistentFolderImpl.java?rev=1005186&r1=1005185&r2=1005186&view=diff ============================================================================== --- incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/PersistentFolderImpl.java (original) +++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/PersistentFolderImpl.java Wed Oct 6 17:47:25 2010 @@ -117,7 +117,7 @@ public class PersistentFolderImpl extend // get the type of the source document ObjectType type = null; if (source instanceof CmisObject) { - type = ((CmisObject) source).getBaseType(); + type = ((CmisObject) source).getType(); } else { CmisObject sourceObj = getSession().getObject(source); type = sourceObj.getType(); Added: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/AbstractWriteObjectCopyIT.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/AbstractWriteObjectCopyIT.java?rev=1005186&view=auto ============================================================================== --- incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/AbstractWriteObjectCopyIT.java (added) +++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/AbstractWriteObjectCopyIT.java Wed Oct 6 17:47:25 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.chemistry.opencmis.fit.runtime; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNotSame; + +import java.util.HashMap; +import java.util.Map; + +import org.apache.chemistry.opencmis.client.api.Document; +import org.apache.chemistry.opencmis.client.api.Folder; +import org.apache.chemistry.opencmis.client.api.ObjectId; +import org.apache.chemistry.opencmis.commons.PropertyIds; +import org.junit.Test; + +public abstract class AbstractWriteObjectCopyIT extends AbstractSessionTest { + + @Test + public void copyDocument() { + String pathr = "/" + Fixture.TEST_ROOT_FOLDER_NAME; + Folder testRoot = (Folder) this.session.getObjectByPath(pathr); + + // create a folder to copy into + Map properties = new HashMap(); + properties.put(PropertyIds.NAME, "newfolder"); + properties.put(PropertyIds.OBJECT_TYPE_ID, + FixtureData.FOLDER_TYPE_ID.value()); + ObjectId folderId = session.createFolder(properties, testRoot); + assertNotNull(folderId); + + // get the document + String pathd = "/" + Fixture.TEST_ROOT_FOLDER_NAME + "/" + + FixtureData.DOCUMENT1_NAME; + Document document = (Document) session.getObjectByPath(pathd); + + // copy the document + properties = new HashMap(); + properties.put(PropertyIds.NAME, "newdocname"); + Document copy = document.copy(folderId, properties, null, null, null, null, session.getDefaultContext()); + + assertEquals(folderId.getId(), copy.getParents().get(0).getId()); + assertEquals("newdocname", copy.getPropertyValue(PropertyIds.NAME)); + + // old doc still unchanged + session.clear(); + document = (Document) session.getObjectByPath(pathd); + assertNotSame("newdocname", document.getPropertyValue(PropertyIds.NAME)); + } + +} Propchange: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/AbstractWriteObjectCopyIT.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/AbstractWriteObjectCopyIT.java ------------------------------------------------------------------------------ svn:keywords = Id Propchange: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/AbstractWriteObjectCopyIT.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/AbstractWriteObjectMoveIT.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/AbstractWriteObjectMoveIT.java?rev=1005186&view=auto ============================================================================== --- incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/AbstractWriteObjectMoveIT.java (added) +++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/AbstractWriteObjectMoveIT.java Wed Oct 6 17:47:25 2010 @@ -0,0 +1,61 @@ +/* + * 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.FileableCmisObject; +import org.apache.chemistry.opencmis.client.api.Folder; +import org.apache.chemistry.opencmis.client.api.ObjectId; +import org.apache.chemistry.opencmis.commons.PropertyIds; +import org.junit.Test; + +public abstract class AbstractWriteObjectMoveIT extends AbstractSessionTest { + + @Test + public void moveObject() { + String pathr = "/" + Fixture.TEST_ROOT_FOLDER_NAME; + Folder testRoot = (Folder) this.session.getObjectByPath(pathr); + + // create a folder to move into + Map properties = new HashMap(); + properties.put(PropertyIds.NAME, "newfolder"); + properties.put(PropertyIds.OBJECT_TYPE_ID, + FixtureData.FOLDER_TYPE_ID.value()); + ObjectId folderId = session.createFolder(properties, testRoot); + assertNotNull(folderId); + + // get the document + String pathd = "/" + Fixture.TEST_ROOT_FOLDER_NAME + "/" + + FixtureData.DOCUMENT1_NAME; + Document document = (Document) session.getObjectByPath(pathd); + + // move document into new folder + FileableCmisObject newdoc = document.move(testRoot, folderId); + + assertEquals(pathr + "/newfolder/" + FixtureData.DOCUMENT1_NAME, + newdoc.getPaths().get(0)); + } + +} Propchange: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/AbstractWriteObjectMoveIT.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/AbstractWriteObjectMoveIT.java ------------------------------------------------------------------------------ svn:keywords = Id Propchange: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/AbstractWriteObjectMoveIT.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/atom/WriteObjectCopyAtomPubIT.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/atom/WriteObjectCopyAtomPubIT.java?rev=1005186&view=auto ============================================================================== --- incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/atom/WriteObjectCopyAtomPubIT.java (added) +++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/atom/WriteObjectCopyAtomPubIT.java Wed Oct 6 17:47:25 2010 @@ -0,0 +1,34 @@ +/* + * 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.atom; + +import org.apache.chemistry.opencmis.fit.runtime.AbstractWriteObjectCopyIT; +import org.apache.chemistry.opencmis.fit.runtime.Fixture; +import org.junit.Ignore; + +// not implemented in AtomPub +@Ignore +public class WriteObjectCopyAtomPubIT extends AbstractWriteObjectCopyIT { + + @Override + public void initFixture(Fixture fixture) { + fixture.enableAtomPub(); + } + +} Propchange: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/atom/WriteObjectCopyAtomPubIT.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/atom/WriteObjectCopyAtomPubIT.java ------------------------------------------------------------------------------ svn:keywords = Id Propchange: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/atom/WriteObjectCopyAtomPubIT.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/atom/WriteObjectMoveAtomPubIT.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/atom/WriteObjectMoveAtomPubIT.java?rev=1005186&view=auto ============================================================================== --- incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/atom/WriteObjectMoveAtomPubIT.java (added) +++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/atom/WriteObjectMoveAtomPubIT.java Wed Oct 6 17:47:25 2010 @@ -0,0 +1,31 @@ +/* + * 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.atom; + +import org.apache.chemistry.opencmis.fit.runtime.AbstractWriteObjectMoveIT; +import org.apache.chemistry.opencmis.fit.runtime.Fixture; + +public class WriteObjectMoveAtomPubIT extends AbstractWriteObjectMoveIT { + + @Override + public void initFixture(Fixture fixture) { + fixture.enableAtomPub(); + } + +} Propchange: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/atom/WriteObjectMoveAtomPubIT.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/atom/WriteObjectMoveAtomPubIT.java ------------------------------------------------------------------------------ svn:keywords = Id Propchange: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/atom/WriteObjectMoveAtomPubIT.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/webservices/WriteObjectCopyWebServicesIT.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/webservices/WriteObjectCopyWebServicesIT.java?rev=1005186&view=auto ============================================================================== --- incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/webservices/WriteObjectCopyWebServicesIT.java (added) +++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/webservices/WriteObjectCopyWebServicesIT.java Wed Oct 6 17:47:25 2010 @@ -0,0 +1,31 @@ +/* + * 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.webservices; + +import org.apache.chemistry.opencmis.fit.runtime.AbstractWriteObjectCopyIT; +import org.apache.chemistry.opencmis.fit.runtime.Fixture; + +public class WriteObjectCopyWebServicesIT extends AbstractWriteObjectCopyIT { + + @Override + public void initFixture(Fixture fixture) { + fixture.enableWebServices(); + } + +} Propchange: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/webservices/WriteObjectCopyWebServicesIT.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/webservices/WriteObjectCopyWebServicesIT.java ------------------------------------------------------------------------------ svn:keywords = Id Propchange: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/webservices/WriteObjectCopyWebServicesIT.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/webservices/WriteObjectMoveWebServicesIT.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/webservices/WriteObjectMoveWebServicesIT.java?rev=1005186&view=auto ============================================================================== --- incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/webservices/WriteObjectMoveWebServicesIT.java (added) +++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/webservices/WriteObjectMoveWebServicesIT.java Wed Oct 6 17:47:25 2010 @@ -0,0 +1,31 @@ +/* + * 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.webservices; + +import org.apache.chemistry.opencmis.fit.runtime.AbstractWriteObjectMoveIT; +import org.apache.chemistry.opencmis.fit.runtime.Fixture; + +public class WriteObjectMoveWebServicesIT extends AbstractWriteObjectMoveIT { + + @Override + public void initFixture(Fixture fixture) { + fixture.enableWebServices(); + } + +} Propchange: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/webservices/WriteObjectMoveWebServicesIT.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/webservices/WriteObjectMoveWebServicesIT.java ------------------------------------------------------------------------------ svn:keywords = Id Propchange: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/webservices/WriteObjectMoveWebServicesIT.java ------------------------------------------------------------------------------ svn:mime-type = text/plain