You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@chemistry.apache.org by sk...@apache.org on 2010/03/23 09:36:43 UTC

svn commit: r926495 - /incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/test/java/org/apache/opencmis/client/runtime/WriteObjectTest.java

Author: sklevenz
Date: Tue Mar 23 08:36:42 2010
New Revision: 926495

URL: http://svn.apache.org/viewvc?rev=926495&view=rev
Log:
Unit test cases for r/w extended

Modified:
    incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/test/java/org/apache/opencmis/client/runtime/WriteObjectTest.java

Modified: incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/test/java/org/apache/opencmis/client/runtime/WriteObjectTest.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/test/java/org/apache/opencmis/client/runtime/WriteObjectTest.java?rev=926495&r1=926494&r2=926495&view=diff
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/test/java/org/apache/opencmis/client/runtime/WriteObjectTest.java (original)
+++ incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/test/java/org/apache/opencmis/client/runtime/WriteObjectTest.java Tue Mar 23 08:36:42 2010
@@ -20,6 +20,7 @@ package org.apache.opencmis.client.runti
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
 
 import java.io.ByteArrayInputStream;
 import java.io.IOException;
@@ -155,6 +156,11 @@ public class WriteObjectTest extends Abs
 	@Test
 	public void createDocumentFromSource() throws IOException {
 		try {
+			// verify content (which is not supported by mock)
+			if (this.isMock()) {
+				return;
+			}
+
 			String path = "/" + Fixture.TEST_ROOT_FOLDER_NAME + "/"
 					+ FixtureData.DOCUMENT1_NAME;
 			Document srcDocument = (Document) this.session
@@ -199,6 +205,11 @@ public class WriteObjectTest extends Abs
 
 	@Test
 	public void deleteAndCreateContent() throws IOException {
+		// verify content (which is not supported by mock)
+		if (this.isMock()) {
+			return;
+		}
+
 		String path = "/" + Fixture.TEST_ROOT_FOLDER_NAME + "/"
 				+ FixtureData.DOCUMENT1_NAME;
 		Document document = (Document) this.session.getObjectByPath(path);
@@ -237,12 +248,19 @@ public class WriteObjectTest extends Abs
 
 	@Test
 	public void updateProperties() {
-//		String path = "/" + Fixture.TEST_ROOT_FOLDER_NAME + "/"
-//				+ FixtureData.DOCUMENT1_NAME;
-//		Document document = (Document) this.session.getObjectByPath(path);
-//		assertNotNull("Document not found: " + path, document);
-//	
-//		document.updateProperties();
+		// verify content (which is not supported by mock)
+		if (this.isMock()) {
+			return;
+		}
+
+		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(CmisProperties.NAME.value(), "Neuer Name");
+		document.updateProperties();
+		assertTrue(true);
 	}
 
 	private String getContentAsString(ContentStream stream) throws IOException {