chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dcaru...@apache.org
Subject svn commit: r936943 [2/4] - in /incubator/chemistry/opencmis/trunk/chemistry-opencmis-test: chemistry-opencmis-test-browser/src/main/java/org/apache/chemistry/opencmis/browser/ chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit...
Date Thu, 22 Apr 2010 16:34:54 GMT
Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/ReadOnlyNavigationIT.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/ReadOnlyNavigationIT.java?rev=936943&r1=936942&r2=936943&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/ReadOnlyNavigationIT.java (original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/ReadOnlyNavigationIT.java Thu Apr 22 16:34:53 2010
@@ -31,154 +31,154 @@ import org.junit.Test;
 
 public class ReadOnlyNavigationIT extends AbstractSessionTest {
 
-	@Test
-	public void navigateChildrenMin() {
-		String path = "/" + Fixture.TEST_ROOT_FOLDER_NAME;
-		Folder folder = (Folder) this.session.getObjectByPath(path);
-		Assert.assertNotNull("folder not found: " + path, folder);
-
-		PagingIterable<CmisObject> pl = folder.getChildren(1);
-		Assert.assertNotNull(pl);
-
-		for (CmisObject o : pl) {
-			Assert.assertNotNull(o);
-		}
-	}
-
-	@Test
-	public void navigateChildrenMax() {
-		String path = "/" + Fixture.TEST_ROOT_FOLDER_NAME;
-		Folder folder = (Folder) this.session.getObjectByPath(path);
-		Assert.assertNotNull("folder not found: " + path, folder);
-
-		PagingIterable<CmisObject> pl = folder.getChildren(1000);
-		Assert.assertNotNull(pl);
-
-		for (CmisObject o : pl) {
-			Assert.assertNotNull(o);
-		}
-	}
-
-	@Test
-	public void navigateChildrenMed() {
-		String path = "/" + Fixture.TEST_ROOT_FOLDER_NAME;
-		Folder folder = (Folder) this.session.getObjectByPath(path);
-		Assert.assertNotNull("folder not found: " + path, folder);
-
-		PagingIterable<CmisObject> pl = folder.getChildren(2);
-		Assert.assertNotNull(pl);
-
-		for (CmisObject o : pl) {
-			Assert.assertNotNull(o);
-		}
-	}
-
-	@Test
-	public void navigateDescendantsMin() {
-		String path = "/" + Fixture.TEST_ROOT_FOLDER_NAME;
-		Folder folder = (Folder) this.session.getObjectByPath(path);
-		Assert.assertNotNull("folder not found: " + path, folder);
-
-		List<Tree<FileableCmisObject>> desc = folder.getDescendants(1);
-		Assert.assertNotNull(desc);
-		Assert.assertFalse(desc.isEmpty());
-
-		for (Tree<FileableCmisObject> o : desc) {
-			Assert.assertNotNull(o);
-			Assert.assertNotNull(o.getItem());
-		}
-	}
-
-	@Test
-	public void navigateDescendantsMax() {
-		String path = "/" + Fixture.TEST_ROOT_FOLDER_NAME;
-		Folder folder = (Folder) this.session.getObjectByPath(path);
-		Assert.assertNotNull("folder not found: " + path, folder);
-
-		List<Tree<FileableCmisObject>> desc = folder.getDescendants(1000);
-		Assert.assertNotNull(desc);
-		Assert.assertFalse(desc.isEmpty());
-
-		for (Tree<FileableCmisObject> o : desc) {
-			Assert.assertNotNull(o);
-			Assert.assertNotNull(o.getItem());
-		}
-	}
-
-	@Test
-	public void navigateDescendantsMed() {
-		String path = "/" + Fixture.TEST_ROOT_FOLDER_NAME;
-		Folder folder = (Folder) this.session.getObjectByPath(path);
-		Assert.assertNotNull("folder not found: " + path, folder);
-
-		List<Tree<FileableCmisObject>> desc = folder.getDescendants(2);
-		Assert.assertNotNull(desc);
-		Assert.assertFalse(desc.isEmpty());
-
-		for (Tree<FileableCmisObject> o : desc) {
-			Assert.assertNotNull(o);
-			Assert.assertNotNull(o.getItem());
-		}
-	}
-
-	@Test
-	public void navigateTreeMed() {
-		String path = "/" + Fixture.TEST_ROOT_FOLDER_NAME;
-		Folder folder = (Folder) this.session.getObjectByPath(path);
-		Assert.assertNotNull("folder not found: " + path, folder);
-
-		List<Tree<FileableCmisObject>> tree = folder.getFolderTree(2);
-		Assert.assertNotNull(tree);
-		Assert.assertFalse(tree.isEmpty());
-
-		for (Tree<FileableCmisObject> o : tree) {
-			Assert.assertNotNull(o);
-			Assert.assertNotNull(o.getItem());
-		}
-	}
-
-	@Test
-	public void navigateTreeMin() {
-		String path = "/" + Fixture.TEST_ROOT_FOLDER_NAME;
-		Folder folder = (Folder) this.session.getObjectByPath(path);
-		Assert.assertNotNull("folder not found: " + path, folder);
-
-		List<Tree<FileableCmisObject>> tree = folder.getFolderTree(1);
-		Assert.assertNotNull(tree);
-		Assert.assertFalse(tree.isEmpty());
-
-		for (Tree<FileableCmisObject> o : tree) {
-			Assert.assertNotNull(o);
-			Assert.assertNotNull(o.getItem());
-		}
-	}
-
-	@Test
-	public void navigateTreeMax() {
-		String path = "/" + Fixture.TEST_ROOT_FOLDER_NAME;
-		Folder folder = (Folder) this.session.getObjectByPath(path);
-		Assert.assertNotNull("folder not found: " + path, folder);
-
-		List<Tree<FileableCmisObject>> tree = folder.getFolderTree(1000);
-		Assert.assertNotNull(tree);
-		Assert.assertFalse(tree.isEmpty());
-
-		for (Tree<FileableCmisObject> o : tree) {
-			Assert.assertNotNull(o);
-			Assert.assertNotNull(o.getItem());
-		}
-	}
-
-	@Test
-	public void navigatePagingRandom() {
-		String path = "/" + Fixture.TEST_ROOT_FOLDER_NAME;
-		Folder folder = (Folder) this.session.getObjectByPath(path);
-		Assert.assertNotNull("folder not found: " + path, folder);
-
-		PagingIterable<CmisObject> pl = folder.getChildren(2);
-		Assert.assertNotNull(pl);
-
-		CmisObject firstObject = pl.iterator().next();
-		Assert.assertNotNull(firstObject);
-	}
+    @Test
+    public void navigateChildrenMin() {
+        String path = "/" + Fixture.TEST_ROOT_FOLDER_NAME;
+        Folder folder = (Folder) this.session.getObjectByPath(path);
+        Assert.assertNotNull("folder not found: " + path, folder);
+
+        PagingIterable<CmisObject> pl = folder.getChildren(1);
+        Assert.assertNotNull(pl);
+
+        for (CmisObject o : pl) {
+            Assert.assertNotNull(o);
+        }
+    }
+
+    @Test
+    public void navigateChildrenMax() {
+        String path = "/" + Fixture.TEST_ROOT_FOLDER_NAME;
+        Folder folder = (Folder) this.session.getObjectByPath(path);
+        Assert.assertNotNull("folder not found: " + path, folder);
+
+        PagingIterable<CmisObject> pl = folder.getChildren(1000);
+        Assert.assertNotNull(pl);
+
+        for (CmisObject o : pl) {
+            Assert.assertNotNull(o);
+        }
+    }
+
+    @Test
+    public void navigateChildrenMed() {
+        String path = "/" + Fixture.TEST_ROOT_FOLDER_NAME;
+        Folder folder = (Folder) this.session.getObjectByPath(path);
+        Assert.assertNotNull("folder not found: " + path, folder);
+
+        PagingIterable<CmisObject> pl = folder.getChildren(2);
+        Assert.assertNotNull(pl);
+
+        for (CmisObject o : pl) {
+            Assert.assertNotNull(o);
+        }
+    }
+
+    @Test
+    public void navigateDescendantsMin() {
+        String path = "/" + Fixture.TEST_ROOT_FOLDER_NAME;
+        Folder folder = (Folder) this.session.getObjectByPath(path);
+        Assert.assertNotNull("folder not found: " + path, folder);
+
+        List<Tree<FileableCmisObject>> desc = folder.getDescendants(1);
+        Assert.assertNotNull(desc);
+        Assert.assertFalse(desc.isEmpty());
+
+        for (Tree<FileableCmisObject> o : desc) {
+            Assert.assertNotNull(o);
+            Assert.assertNotNull(o.getItem());
+        }
+    }
+
+    @Test
+    public void navigateDescendantsMax() {
+        String path = "/" + Fixture.TEST_ROOT_FOLDER_NAME;
+        Folder folder = (Folder) this.session.getObjectByPath(path);
+        Assert.assertNotNull("folder not found: " + path, folder);
+
+        List<Tree<FileableCmisObject>> desc = folder.getDescendants(1000);
+        Assert.assertNotNull(desc);
+        Assert.assertFalse(desc.isEmpty());
+
+        for (Tree<FileableCmisObject> o : desc) {
+            Assert.assertNotNull(o);
+            Assert.assertNotNull(o.getItem());
+        }
+    }
+
+    @Test
+    public void navigateDescendantsMed() {
+        String path = "/" + Fixture.TEST_ROOT_FOLDER_NAME;
+        Folder folder = (Folder) this.session.getObjectByPath(path);
+        Assert.assertNotNull("folder not found: " + path, folder);
+
+        List<Tree<FileableCmisObject>> desc = folder.getDescendants(2);
+        Assert.assertNotNull(desc);
+        Assert.assertFalse(desc.isEmpty());
+
+        for (Tree<FileableCmisObject> o : desc) {
+            Assert.assertNotNull(o);
+            Assert.assertNotNull(o.getItem());
+        }
+    }
+
+    @Test
+    public void navigateTreeMed() {
+        String path = "/" + Fixture.TEST_ROOT_FOLDER_NAME;
+        Folder folder = (Folder) this.session.getObjectByPath(path);
+        Assert.assertNotNull("folder not found: " + path, folder);
+
+        List<Tree<FileableCmisObject>> tree = folder.getFolderTree(2);
+        Assert.assertNotNull(tree);
+        Assert.assertFalse(tree.isEmpty());
+
+        for (Tree<FileableCmisObject> o : tree) {
+            Assert.assertNotNull(o);
+            Assert.assertNotNull(o.getItem());
+        }
+    }
+
+    @Test
+    public void navigateTreeMin() {
+        String path = "/" + Fixture.TEST_ROOT_FOLDER_NAME;
+        Folder folder = (Folder) this.session.getObjectByPath(path);
+        Assert.assertNotNull("folder not found: " + path, folder);
+
+        List<Tree<FileableCmisObject>> tree = folder.getFolderTree(1);
+        Assert.assertNotNull(tree);
+        Assert.assertFalse(tree.isEmpty());
+
+        for (Tree<FileableCmisObject> o : tree) {
+            Assert.assertNotNull(o);
+            Assert.assertNotNull(o.getItem());
+        }
+    }
+
+    @Test
+    public void navigateTreeMax() {
+        String path = "/" + Fixture.TEST_ROOT_FOLDER_NAME;
+        Folder folder = (Folder) this.session.getObjectByPath(path);
+        Assert.assertNotNull("folder not found: " + path, folder);
+
+        List<Tree<FileableCmisObject>> tree = folder.getFolderTree(1000);
+        Assert.assertNotNull(tree);
+        Assert.assertFalse(tree.isEmpty());
+
+        for (Tree<FileableCmisObject> o : tree) {
+            Assert.assertNotNull(o);
+            Assert.assertNotNull(o.getItem());
+        }
+    }
+
+    @Test
+    public void navigatePagingRandom() {
+        String path = "/" + Fixture.TEST_ROOT_FOLDER_NAME;
+        Folder folder = (Folder) this.session.getObjectByPath(path);
+        Assert.assertNotNull("folder not found: " + path, folder);
+
+        PagingIterable<CmisObject> pl = folder.getChildren(2);
+        Assert.assertNotNull(pl);
+
+        CmisObject firstObject = pl.iterator().next();
+        Assert.assertNotNull(firstObject);
+    }
 }

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/ReadOnlyObjectIT.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/ReadOnlyObjectIT.java?rev=936943&r1=936942&r2=936943&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/ReadOnlyObjectIT.java (original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/ReadOnlyObjectIT.java Thu Apr 22 16:34:53 2010
@@ -40,233 +40,233 @@ import org.junit.Test;
  */
 public class ReadOnlyObjectIT extends AbstractSessionTest {
 
-	@Test
-	public void verifyRoot() {
-		Folder root = this.session.getRootFolder();
-		Assert.assertNotNull(root);
-
-		root.getName();
-		Assert.assertNotNull(root.getId());
-		Assert.assertNull(root.getFolderParent());
-		Assert.assertNotNull(root.getType());
-		Assert.assertEquals(FixtureData.FOLDER_TYPE_ID.toString(), root.getType().getId());
-	}
-
-	@Test
-	public void readTestFolder() {
-		String path = "/" + Fixture.TEST_ROOT_FOLDER_NAME;
-		Folder folder = (Folder) this.session.getObjectByPath(path);
-		Assert.assertNotNull("folder not found: " + path, folder);
-
-		Assert.assertEquals(Fixture.TEST_ROOT_FOLDER_NAME, folder.getName());
-		Assert.assertNotNull(folder.getId());
-		Assert.assertNotNull(folder.getFolderParent());
-		Assert.assertNotNull(folder.getType());
-		Assert.assertEquals(FixtureData.FOLDER_TYPE_ID.toString(), folder.getType().getId());
-		Assert.assertNotNull(folder.getBaseType());
-		Assert.assertEquals(ObjectType.FOLDER_BASETYPE_ID, folder.getBaseType().getId());
-
-		Assert.assertNotNull(folder.getCreatedBy());
-		Assert.assertEquals(Fixture.getParamter().get(SessionParameter.USER), folder.getCreatedBy());
-		Assert.assertNotNull(folder.getLastModifiedBy());
-		Assert.assertEquals(Fixture.getParamter().get(SessionParameter.USER), folder.getLastModifiedBy());
-		Assert.assertNotNull(folder.getLastModificationDate());
-		Assert.assertNotNull(folder.getCreationDate());
-
-	}
-
-	@Test
-	public void readTestDocument() {
-		String path = "/" + Fixture.TEST_ROOT_FOLDER_NAME + "/" + FixtureData.DOCUMENT1_NAME;
-		Document document = (Document) this.session.getObjectByPath(path);
-		Assert.assertNotNull("document not found: " + path, document);
-
-		Assert.assertNotNull(document.getId());
-		Assert.assertNotNull(document.getBaseType());
-		Assert.assertEquals(ObjectType.DOCUMENT_BASETYPE_ID, document.getBaseType().getId());
-		Assert.assertEquals(FixtureData.DOCUMENT1_NAME.toString(), document.getName());
-		Assert.assertNotNull(document.getType());
-		Assert.assertEquals(FixtureData.DOCUMENT_TYPE_ID.toString(), document.getType().getId());
-	}
-
-	public void readDocumentDefaultProperties() {
-		String path = "/" + Fixture.TEST_ROOT_FOLDER_NAME + "/" + FixtureData.DOCUMENT1_NAME;
-		Document document = (Document) this.session.getObjectByPath(path);
-		Assert.assertNotNull("document not found: " + path, document);
-
-		Assert.assertNotNull(document.getCreatedBy());
-		Assert.assertEquals(Fixture.getParamter().get(SessionParameter.USER), document.getCreatedBy());
-		Assert.assertNotNull(document.getLastModifiedBy());
-		Assert.assertEquals(Fixture.getParamter().get(SessionParameter.USER), document.getLastModifiedBy());
-		Assert.assertNotNull(document.getLastModificationDate());
-		Assert.assertNotNull(document.getCreationDate());
-	}
-
-	@Test
-	public void readDocumentPropertiesWithFilter() {
-		String path = "/" + Fixture.TEST_ROOT_FOLDER_NAME + "/" + FixtureData.DOCUMENT1_NAME;
-		Document document = (Document) this.session.getObjectByPath(path);
-		Assert.assertNotNull("document not found: " + path, document);
-
-		List<Property<?>> l = document.getProperties();
-		Assert.assertNotNull(l);
-		Assert.assertEquals(false, l.isEmpty());
-		Iterator<Property<?>> i = l.iterator();
-		while (i.hasNext()) {
-			Property<?> p = i.next();
-			Object value = p.getFirstValue();
-			PropertyType t = p.getType();
-
-			Assert.assertNotNull(p);
-			Assert.assertNotNull(t);
-
-			switch (t) {
-			case INTEGER:
-				BigInteger n = (BigInteger) value;
-				Assert.assertNotNull(n);
-				break;
-			case STRING:
-				// String s = (String) value;
-				// can be null Assert.assertNotNull(s);
-				break;
-			case BOOLEAN:
-				Boolean b = (Boolean) value;
-				Assert.assertNotNull(b);
-				break;
-			case DATETIME:
-				Calendar c = (Calendar) value;
-				Assert.assertNotNull(c);
-				break;
-			case DECIMAL:
-				Number num = (Number) value;
-				if (num instanceof Double) {
-					Double d = (Double) num;
-					Assert.assertNotNull(d);
-				} else if (num instanceof Float) {
-					Float f = (Float) num;
-					Assert.assertNotNull(f);
-				} else {
-					Assert.fail("Number not supported: " + num.toString());
-				}
-				break;
-			case HTML:
-				String html = (String) value;
-				Assert.assertNotNull(html);
-				break;
-			case ID:
-				// String id = (String) value;
-				// can be null Assert.assertNotNull(id);
-				break;
-			case URI:
-				URI uri = (URI) value;
-				Assert.assertNotNull(uri);
-				break;
-			default:
-				Assert.fail("PropertyType not supported: " + t);
-			}
-		}
-
-	}
-
-	@Test
-	public void readDocumentProperties() {
-		String path = "/" + Fixture.TEST_ROOT_FOLDER_NAME + "/" + FixtureData.DOCUMENT1_NAME;
-		Document document = (Document) this.session.getObjectByPath(path);
-		Assert.assertNotNull("document not found: " + path, document);
-
-		List<Property<?>> l = document.getProperties();
-		Assert.assertNotNull(l);
-		Assert.assertEquals(false, l.isEmpty());
-		Iterator<Property<?>> i = l.iterator();
-		while (i.hasNext()) {
-			Property<?> p = i.next();
-			Object value = p.getFirstValue();
-			PropertyType t = p.getType();
-
-			Assert.assertNotNull(p);
-			Assert.assertNotNull(t);
-
-			switch (t) {
-			case INTEGER:
-				BigInteger n = (BigInteger) value;
-				Assert.assertNotNull(n);
-				break;
-			case STRING:
-				// String s = (String) value;
-				// can be null Assert.assertNotNull(s);
-				break;
-			case BOOLEAN:
-				Boolean b = (Boolean) value;
-				Assert.assertNotNull(b);
-				break;
-			case DATETIME:
-				Calendar c = (Calendar) value;
-				Assert.assertNotNull(c);
-				break;
-			case DECIMAL:
-				Number num = (Number) value;
-				if (num instanceof Double) {
-					Double d = (Double) num;
-					Assert.assertNotNull(d);
-				} else if (num instanceof Float) {
-					Float f = (Float) num;
-					Assert.assertNotNull(f);
-				} else {
-					Assert.fail("Number not supported: " + num.toString());
-				}
-				break;
-			case HTML:
-				String html = (String) value;
-				Assert.assertNotNull(html);
-				break;
-			case ID:
-				// String id = (String) value;
-				// can be null Assert.assertNotNull(id);
-				break;
-			case URI:
-				URI uri = (URI) value;
-				Assert.assertNotNull(uri);
-				break;
-			default:
-				Assert.fail("PropertyType not supported: " + t);
-			}
-		}
-	}
-
-	@Test
-	public void readSingleProperty() {
-		String path = "/" + Fixture.TEST_ROOT_FOLDER_NAME + "/" + FixtureData.DOCUMENT1_NAME;
-		Document document = (Document) this.session.getObjectByPath(path);
-		Assert.assertNotNull("document not found: " + path, document);
-
-		Property<String> p = document.getProperty(PropertyIds.OBJECT_ID);
-		Assert.assertNotNull(p);
-		String v1 = p.getFirstValue();
-		Assert.assertNotNull(v1);
-
-		String v2 = document.getPropertyValue(PropertyIds.OBJECT_ID);
-		Assert.assertNotNull(v2);
-		Assert.assertEquals(v1, v2);
-
-	}
-
-	@Test
-	public void readMultiValueProperty() {
-		String path = "/" + Fixture.TEST_ROOT_FOLDER_NAME + "/" + FixtureData.DOCUMENT1_NAME;
-		Document document = (Document) this.session.getObjectByPath(path);
-		Assert.assertNotNull("document not found: " + path, document);
-
-		Property<String> p = document.getProperty(FixtureData.PROPERTY_NAME_STRING_MULTI_VALUED.toString());
-		if (p != null) {
-			Assert.assertTrue(p.isMultiValued());
-			List<String> v1 = p.getValues();
-			Assert.assertNotNull(v1);
-			Assert.assertFalse(v1.isEmpty());
-
-			List<String> v2 = document.getPropertyMultivalue(FixtureData.PROPERTY_NAME_STRING_MULTI_VALUED.toString());
-			Assert.assertNotNull(v2);
-			Assert.assertFalse(v2.isEmpty());
-			Assert.assertEquals(v1, v2);
-		}
-	}
+    @Test
+    public void verifyRoot() {
+        Folder root = this.session.getRootFolder();
+        Assert.assertNotNull(root);
+
+        root.getName();
+        Assert.assertNotNull(root.getId());
+        Assert.assertNull(root.getFolderParent());
+        Assert.assertNotNull(root.getType());
+        Assert.assertEquals(FixtureData.FOLDER_TYPE_ID.toString(), root.getType().getId());
+    }
+
+    @Test
+    public void readTestFolder() {
+        String path = "/" + Fixture.TEST_ROOT_FOLDER_NAME;
+        Folder folder = (Folder) this.session.getObjectByPath(path);
+        Assert.assertNotNull("folder not found: " + path, folder);
+
+        Assert.assertEquals(Fixture.TEST_ROOT_FOLDER_NAME, folder.getName());
+        Assert.assertNotNull(folder.getId());
+        Assert.assertNotNull(folder.getFolderParent());
+        Assert.assertNotNull(folder.getType());
+        Assert.assertEquals(FixtureData.FOLDER_TYPE_ID.toString(), folder.getType().getId());
+        Assert.assertNotNull(folder.getBaseType());
+        Assert.assertEquals(ObjectType.FOLDER_BASETYPE_ID, folder.getBaseType().getId());
+
+        Assert.assertNotNull(folder.getCreatedBy());
+        Assert.assertEquals(Fixture.getParamter().get(SessionParameter.USER), folder.getCreatedBy());
+        Assert.assertNotNull(folder.getLastModifiedBy());
+        Assert.assertEquals(Fixture.getParamter().get(SessionParameter.USER), folder.getLastModifiedBy());
+        Assert.assertNotNull(folder.getLastModificationDate());
+        Assert.assertNotNull(folder.getCreationDate());
+
+    }
+
+    @Test
+    public void readTestDocument() {
+        String path = "/" + Fixture.TEST_ROOT_FOLDER_NAME + "/" + FixtureData.DOCUMENT1_NAME;
+        Document document = (Document) this.session.getObjectByPath(path);
+        Assert.assertNotNull("document not found: " + path, document);
+
+        Assert.assertNotNull(document.getId());
+        Assert.assertNotNull(document.getBaseType());
+        Assert.assertEquals(ObjectType.DOCUMENT_BASETYPE_ID, document.getBaseType().getId());
+        Assert.assertEquals(FixtureData.DOCUMENT1_NAME.toString(), document.getName());
+        Assert.assertNotNull(document.getType());
+        Assert.assertEquals(FixtureData.DOCUMENT_TYPE_ID.toString(), document.getType().getId());
+    }
+
+    public void readDocumentDefaultProperties() {
+        String path = "/" + Fixture.TEST_ROOT_FOLDER_NAME + "/" + FixtureData.DOCUMENT1_NAME;
+        Document document = (Document) this.session.getObjectByPath(path);
+        Assert.assertNotNull("document not found: " + path, document);
+
+        Assert.assertNotNull(document.getCreatedBy());
+        Assert.assertEquals(Fixture.getParamter().get(SessionParameter.USER), document.getCreatedBy());
+        Assert.assertNotNull(document.getLastModifiedBy());
+        Assert.assertEquals(Fixture.getParamter().get(SessionParameter.USER), document.getLastModifiedBy());
+        Assert.assertNotNull(document.getLastModificationDate());
+        Assert.assertNotNull(document.getCreationDate());
+    }
+
+    @Test
+    public void readDocumentPropertiesWithFilter() {
+        String path = "/" + Fixture.TEST_ROOT_FOLDER_NAME + "/" + FixtureData.DOCUMENT1_NAME;
+        Document document = (Document) this.session.getObjectByPath(path);
+        Assert.assertNotNull("document not found: " + path, document);
+
+        List<Property<?>> l = document.getProperties();
+        Assert.assertNotNull(l);
+        Assert.assertEquals(false, l.isEmpty());
+        Iterator<Property<?>> i = l.iterator();
+        while (i.hasNext()) {
+            Property<?> p = i.next();
+            Object value = p.getFirstValue();
+            PropertyType t = p.getType();
+
+            Assert.assertNotNull(p);
+            Assert.assertNotNull(t);
+
+            switch (t) {
+            case INTEGER:
+                BigInteger n = (BigInteger) value;
+                Assert.assertNotNull(n);
+                break;
+            case STRING:
+                // String s = (String) value;
+                // can be null Assert.assertNotNull(s);
+                break;
+            case BOOLEAN:
+                Boolean b = (Boolean) value;
+                Assert.assertNotNull(b);
+                break;
+            case DATETIME:
+                Calendar c = (Calendar) value;
+                Assert.assertNotNull(c);
+                break;
+            case DECIMAL:
+                Number num = (Number) value;
+                if (num instanceof Double) {
+                    Double d = (Double) num;
+                    Assert.assertNotNull(d);
+                } else if (num instanceof Float) {
+                    Float f = (Float) num;
+                    Assert.assertNotNull(f);
+                } else {
+                    Assert.fail("Number not supported: " + num.toString());
+                }
+                break;
+            case HTML:
+                String html = (String) value;
+                Assert.assertNotNull(html);
+                break;
+            case ID:
+                // String id = (String) value;
+                // can be null Assert.assertNotNull(id);
+                break;
+            case URI:
+                URI uri = (URI) value;
+                Assert.assertNotNull(uri);
+                break;
+            default:
+                Assert.fail("PropertyType not supported: " + t);
+            }
+        }
+
+    }
+
+    @Test
+    public void readDocumentProperties() {
+        String path = "/" + Fixture.TEST_ROOT_FOLDER_NAME + "/" + FixtureData.DOCUMENT1_NAME;
+        Document document = (Document) this.session.getObjectByPath(path);
+        Assert.assertNotNull("document not found: " + path, document);
+
+        List<Property<?>> l = document.getProperties();
+        Assert.assertNotNull(l);
+        Assert.assertEquals(false, l.isEmpty());
+        Iterator<Property<?>> i = l.iterator();
+        while (i.hasNext()) {
+            Property<?> p = i.next();
+            Object value = p.getFirstValue();
+            PropertyType t = p.getType();
+
+            Assert.assertNotNull(p);
+            Assert.assertNotNull(t);
+
+            switch (t) {
+            case INTEGER:
+                BigInteger n = (BigInteger) value;
+                Assert.assertNotNull(n);
+                break;
+            case STRING:
+                // String s = (String) value;
+                // can be null Assert.assertNotNull(s);
+                break;
+            case BOOLEAN:
+                Boolean b = (Boolean) value;
+                Assert.assertNotNull(b);
+                break;
+            case DATETIME:
+                Calendar c = (Calendar) value;
+                Assert.assertNotNull(c);
+                break;
+            case DECIMAL:
+                Number num = (Number) value;
+                if (num instanceof Double) {
+                    Double d = (Double) num;
+                    Assert.assertNotNull(d);
+                } else if (num instanceof Float) {
+                    Float f = (Float) num;
+                    Assert.assertNotNull(f);
+                } else {
+                    Assert.fail("Number not supported: " + num.toString());
+                }
+                break;
+            case HTML:
+                String html = (String) value;
+                Assert.assertNotNull(html);
+                break;
+            case ID:
+                // String id = (String) value;
+                // can be null Assert.assertNotNull(id);
+                break;
+            case URI:
+                URI uri = (URI) value;
+                Assert.assertNotNull(uri);
+                break;
+            default:
+                Assert.fail("PropertyType not supported: " + t);
+            }
+        }
+    }
+
+    @Test
+    public void readSingleProperty() {
+        String path = "/" + Fixture.TEST_ROOT_FOLDER_NAME + "/" + FixtureData.DOCUMENT1_NAME;
+        Document document = (Document) this.session.getObjectByPath(path);
+        Assert.assertNotNull("document not found: " + path, document);
+
+        Property<String> p = document.getProperty(PropertyIds.OBJECT_ID);
+        Assert.assertNotNull(p);
+        String v1 = p.getFirstValue();
+        Assert.assertNotNull(v1);
+
+        String v2 = document.getPropertyValue(PropertyIds.OBJECT_ID);
+        Assert.assertNotNull(v2);
+        Assert.assertEquals(v1, v2);
+
+    }
+
+    @Test
+    public void readMultiValueProperty() {
+        String path = "/" + Fixture.TEST_ROOT_FOLDER_NAME + "/" + FixtureData.DOCUMENT1_NAME;
+        Document document = (Document) this.session.getObjectByPath(path);
+        Assert.assertNotNull("document not found: " + path, document);
+
+        Property<String> p = document.getProperty(FixtureData.PROPERTY_NAME_STRING_MULTI_VALUED.toString());
+        if (p != null) {
+            Assert.assertTrue(p.isMultiValued());
+            List<String> v1 = p.getValues();
+            Assert.assertNotNull(v1);
+            Assert.assertFalse(v1.isEmpty());
+
+            List<String> v2 = document.getPropertyMultivalue(FixtureData.PROPERTY_NAME_STRING_MULTI_VALUED.toString());
+            Assert.assertNotNull(v2);
+            Assert.assertFalse(v2.isEmpty());
+            Assert.assertEquals(v1, v2);
+        }
+    }
 }

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/ReadOnlyRepositoryInfoIT.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/ReadOnlyRepositoryInfoIT.java?rev=936943&r1=936942&r2=936943&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/ReadOnlyRepositoryInfoIT.java (original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/ReadOnlyRepositoryInfoIT.java Thu Apr 22 16:34:53 2010
@@ -35,223 +35,223 @@ import org.junit.Test;
  */
 public class ReadOnlyRepositoryInfoIT extends AbstractSessionTest {
 
-	@Test
-	public void changesIncomplete() {
-		RepositoryInfo r = this.session.getRepositoryInfo();
-		Assert.assertNotNull(r);
-		Assert.assertNotNull(r.getChangesIncomplete());
-	}
-
-	@Test
-	public void changesOnType() {
-		RepositoryInfo r = this.session.getRepositoryInfo();
-		Assert.assertNotNull(r);
-		Assert.assertNotNull(r.getChangesOnType());
-	}
-
-	@Test
-	public void cmisVersionSupported() {
-		RepositoryInfo r = this.session.getRepositoryInfo();
-		Assert.assertNotNull(r);
-		Assert.assertNotNull(r.getCmisVersionSupported());
-		this.log.info("getCmisVersionSupported = " + r.getCmisVersionSupported());
-	}
-
-	@Test
-	public void description() {
-		RepositoryInfo r = this.session.getRepositoryInfo();
-		Assert.assertNotNull(r);
-		Assert.assertNotNull(r.getDescription());
-		this.log.info("getDescription = " + r.getDescription());
-	}
-
-	@Test
-	public void id() {
-		RepositoryInfo r = this.session.getRepositoryInfo();
-		Assert.assertNotNull(r);
-		Assert.assertNotNull(r.getId());
-		this.log.info("getId = " + r.getId());
-	}
-
-	@Test
-	public void name() {
-		RepositoryInfo r = this.session.getRepositoryInfo();
-		Assert.assertNotNull(r);
-		Assert.assertNotNull(r.getName());
-		this.log.info("getName = " + r.getName());
-	}
-
-	@Test
-	public void principalIdAnonymous() {
-		RepositoryInfo r = this.session.getRepositoryInfo();
-		Assert.assertNotNull(r);
-		Assert.assertNotNull(r.getPrincipalIdAnonymous());
-		this.log.info("getPrincipalIdAnonymous = " + r.getPrincipalIdAnonymous());
-	}
-
-	@Test
-	public void principalIdAnyone() {
-		RepositoryInfo r = this.session.getRepositoryInfo();
-		Assert.assertNotNull(r);
-		Assert.assertNotNull(r.getPrincipalIdAnyone());
-		this.log.info("getPrincipalIdAnyone = " + r.getPrincipalIdAnyone());
-	}
-
-	@Test
-	public void productName() {
-		RepositoryInfo r = this.session.getRepositoryInfo();
-		Assert.assertNotNull(r);
-		Assert.assertNotNull(r.getProductName());
-		this.log.info("getProductName = " + r.getProductName());
-	}
-
-	@Test
-	public void thinClientUri() {
-		RepositoryInfo r = this.session.getRepositoryInfo();
-		Assert.assertNotNull(r);
-		String uri = r.getThinClientUri();
-		this.log.info("getThinClientUri = " + uri);
-	}
-
-	@Test
-	public void vendorName() {
-		RepositoryInfo r = this.session.getRepositoryInfo();
-		Assert.assertNotNull(r);
-		Assert.assertNotNull(r.getVendorName());
-		this.log.info("getVendorName = " + r.getVendorName());
-	}
-
-	@Test
-	public void repositoryCapabilitiesAclSupport() {
-		RepositoryInfo r = this.session.getRepositoryInfo();
-		Assert.assertNotNull(r);
-
-		// capabilities
-		RepositoryCapabilities repcap = r.getCapabilities();
-		Assert.assertNotNull(repcap);
-
-		CapabilityAcl capacl = repcap.getAclCapability();
-		Assert.assertNotNull(capacl);
-		switch (capacl) {
-		case DISCOVER:
-		case MANAGE:
-		case NONE:
-			break;
-		default:
-			Assert.fail("enumeration not supported: " + capacl);
-		}
-		this.log.info("CapabilityAcl = " + capacl);
-	}
-
-	@Test
-	public void repositoryCapabilitiesChangesSupport() {
-		RepositoryInfo r = this.session.getRepositoryInfo();
-		Assert.assertNotNull(r);
-
-		// capabilities
-		RepositoryCapabilities repcap = r.getCapabilities();
-		Assert.assertNotNull(repcap);
-		CapabilityChanges capch = repcap.getChangesCapability();
-		Assert.assertNotNull(capch);
-		switch (capch) {
-		case ALL:
-		case OBJECTIDSONLY:
-		case PROPERTIES:
-		case NONE:
-			break;
-		default:
-			Assert.fail("enumeration not supported: " + capch);
-		}
-		this.log.info("CapabilityChanges = " + capch);
-	}
-
-	@Test
-	public void repositoryCapabilitiesContentStreamUpdateabilitySupport() {
-		RepositoryInfo r = this.session.getRepositoryInfo();
-		Assert.assertNotNull(r);
-
-		// capabilities
-		RepositoryCapabilities repcap = r.getCapabilities();
-		Assert.assertNotNull(repcap);
-		CapabilityContentStreamUpdates ccsu = repcap.getContentStreamUpdatesCapability();
-		Assert.assertNotNull(ccsu);
-		switch (ccsu) {
-		case ANYTIME:
-		case NONE:
-		case PWCONLY:
-			break;
-		default:
-			Assert.fail("enumeration not supported: " + ccsu);
-		}
-		this.log.info("CapabilityContentStreamUpdates = " + ccsu);
-	}
-
-	@Test
-	public void repositoryCapabilitiesJointSupport() {
-		RepositoryInfo r = this.session.getRepositoryInfo();
-		Assert.assertNotNull(r);
-
-		// capabilities
-		RepositoryCapabilities repcap = r.getCapabilities();
-		Assert.assertNotNull(repcap);
-
-		CapabilityJoin capj = repcap.getJoinCapability();
-		Assert.assertNotNull(capj);
-
-		switch (capj) {
-		case INNERANDOUTER:
-		case INNERONLY:
-		case NONE:
-			break;
-		default:
-			Assert.fail("enumeration not supported: " + capj);
-		}
-		this.log.info("CapabilityJoin = " + capj);
-	}
-
-	@Test
-	public void repositoryCapabilitiesQuerySupport() {
-		RepositoryInfo r = this.session.getRepositoryInfo();
-		Assert.assertNotNull(r);
-
-		// capabilities
-		RepositoryCapabilities repcap = r.getCapabilities();
-		Assert.assertNotNull(repcap);
-
-		CapabilityQuery capq = repcap.getQueryCapability();
-		Assert.assertNotNull(capq);
-		switch (capq) {
-		case BOTHCOMBINED:
-		case BOTHSEPARATE:
-		case FULLTEXTONLY:
-		case METADATAONLY:
-		case NONE:
-			break;
-		default:
-			Assert.fail("enumeration not supported: " + capq);
-		}
-		this.log.info("CapabilityQuery = " + capq);
-	}
-
-	@Test
-	public void repositoryCapabilitiesRenditionSupport() {
-		RepositoryInfo r = this.session.getRepositoryInfo();
-		Assert.assertNotNull(r);
-
-		// capabilities
-		RepositoryCapabilities repcap = r.getCapabilities();
-		Assert.assertNotNull(repcap);
-
-		CapabilityRenditions caprend = repcap.getRenditionsCapability();
-		Assert.assertNotNull(caprend);
-		switch (caprend) {
-		case NONE:
-		case READ:
-			break;
-		default:
-			Assert.fail("enumeration not supported: " + caprend);
-		}
-		this.log.info("CapabilityRendition = " + caprend);
-	}
+    @Test
+    public void changesIncomplete() {
+        RepositoryInfo r = this.session.getRepositoryInfo();
+        Assert.assertNotNull(r);
+        Assert.assertNotNull(r.getChangesIncomplete());
+    }
+
+    @Test
+    public void changesOnType() {
+        RepositoryInfo r = this.session.getRepositoryInfo();
+        Assert.assertNotNull(r);
+        Assert.assertNotNull(r.getChangesOnType());
+    }
+
+    @Test
+    public void cmisVersionSupported() {
+        RepositoryInfo r = this.session.getRepositoryInfo();
+        Assert.assertNotNull(r);
+        Assert.assertNotNull(r.getCmisVersionSupported());
+        this.log.info("getCmisVersionSupported = " + r.getCmisVersionSupported());
+    }
+
+    @Test
+    public void description() {
+        RepositoryInfo r = this.session.getRepositoryInfo();
+        Assert.assertNotNull(r);
+        Assert.assertNotNull(r.getDescription());
+        this.log.info("getDescription = " + r.getDescription());
+    }
+
+    @Test
+    public void id() {
+        RepositoryInfo r = this.session.getRepositoryInfo();
+        Assert.assertNotNull(r);
+        Assert.assertNotNull(r.getId());
+        this.log.info("getId = " + r.getId());
+    }
+
+    @Test
+    public void name() {
+        RepositoryInfo r = this.session.getRepositoryInfo();
+        Assert.assertNotNull(r);
+        Assert.assertNotNull(r.getName());
+        this.log.info("getName = " + r.getName());
+    }
+
+    @Test
+    public void principalIdAnonymous() {
+        RepositoryInfo r = this.session.getRepositoryInfo();
+        Assert.assertNotNull(r);
+        Assert.assertNotNull(r.getPrincipalIdAnonymous());
+        this.log.info("getPrincipalIdAnonymous = " + r.getPrincipalIdAnonymous());
+    }
+
+    @Test
+    public void principalIdAnyone() {
+        RepositoryInfo r = this.session.getRepositoryInfo();
+        Assert.assertNotNull(r);
+        Assert.assertNotNull(r.getPrincipalIdAnyone());
+        this.log.info("getPrincipalIdAnyone = " + r.getPrincipalIdAnyone());
+    }
+
+    @Test
+    public void productName() {
+        RepositoryInfo r = this.session.getRepositoryInfo();
+        Assert.assertNotNull(r);
+        Assert.assertNotNull(r.getProductName());
+        this.log.info("getProductName = " + r.getProductName());
+    }
+
+    @Test
+    public void thinClientUri() {
+        RepositoryInfo r = this.session.getRepositoryInfo();
+        Assert.assertNotNull(r);
+        String uri = r.getThinClientUri();
+        this.log.info("getThinClientUri = " + uri);
+    }
+
+    @Test
+    public void vendorName() {
+        RepositoryInfo r = this.session.getRepositoryInfo();
+        Assert.assertNotNull(r);
+        Assert.assertNotNull(r.getVendorName());
+        this.log.info("getVendorName = " + r.getVendorName());
+    }
+
+    @Test
+    public void repositoryCapabilitiesAclSupport() {
+        RepositoryInfo r = this.session.getRepositoryInfo();
+        Assert.assertNotNull(r);
+
+        // capabilities
+        RepositoryCapabilities repcap = r.getCapabilities();
+        Assert.assertNotNull(repcap);
+
+        CapabilityAcl capacl = repcap.getAclCapability();
+        Assert.assertNotNull(capacl);
+        switch (capacl) {
+        case DISCOVER:
+        case MANAGE:
+        case NONE:
+            break;
+        default:
+            Assert.fail("enumeration not supported: " + capacl);
+        }
+        this.log.info("CapabilityAcl = " + capacl);
+    }
+
+    @Test
+    public void repositoryCapabilitiesChangesSupport() {
+        RepositoryInfo r = this.session.getRepositoryInfo();
+        Assert.assertNotNull(r);
+
+        // capabilities
+        RepositoryCapabilities repcap = r.getCapabilities();
+        Assert.assertNotNull(repcap);
+        CapabilityChanges capch = repcap.getChangesCapability();
+        Assert.assertNotNull(capch);
+        switch (capch) {
+        case ALL:
+        case OBJECTIDSONLY:
+        case PROPERTIES:
+        case NONE:
+            break;
+        default:
+            Assert.fail("enumeration not supported: " + capch);
+        }
+        this.log.info("CapabilityChanges = " + capch);
+    }
+
+    @Test
+    public void repositoryCapabilitiesContentStreamUpdateabilitySupport() {
+        RepositoryInfo r = this.session.getRepositoryInfo();
+        Assert.assertNotNull(r);
+
+        // capabilities
+        RepositoryCapabilities repcap = r.getCapabilities();
+        Assert.assertNotNull(repcap);
+        CapabilityContentStreamUpdates ccsu = repcap.getContentStreamUpdatesCapability();
+        Assert.assertNotNull(ccsu);
+        switch (ccsu) {
+        case ANYTIME:
+        case NONE:
+        case PWCONLY:
+            break;
+        default:
+            Assert.fail("enumeration not supported: " + ccsu);
+        }
+        this.log.info("CapabilityContentStreamUpdates = " + ccsu);
+    }
+
+    @Test
+    public void repositoryCapabilitiesJointSupport() {
+        RepositoryInfo r = this.session.getRepositoryInfo();
+        Assert.assertNotNull(r);
+
+        // capabilities
+        RepositoryCapabilities repcap = r.getCapabilities();
+        Assert.assertNotNull(repcap);
+
+        CapabilityJoin capj = repcap.getJoinCapability();
+        Assert.assertNotNull(capj);
+
+        switch (capj) {
+        case INNERANDOUTER:
+        case INNERONLY:
+        case NONE:
+            break;
+        default:
+            Assert.fail("enumeration not supported: " + capj);
+        }
+        this.log.info("CapabilityJoin = " + capj);
+    }
+
+    @Test
+    public void repositoryCapabilitiesQuerySupport() {
+        RepositoryInfo r = this.session.getRepositoryInfo();
+        Assert.assertNotNull(r);
+
+        // capabilities
+        RepositoryCapabilities repcap = r.getCapabilities();
+        Assert.assertNotNull(repcap);
+
+        CapabilityQuery capq = repcap.getQueryCapability();
+        Assert.assertNotNull(capq);
+        switch (capq) {
+        case BOTHCOMBINED:
+        case BOTHSEPARATE:
+        case FULLTEXTONLY:
+        case METADATAONLY:
+        case NONE:
+            break;
+        default:
+            Assert.fail("enumeration not supported: " + capq);
+        }
+        this.log.info("CapabilityQuery = " + capq);
+    }
+
+    @Test
+    public void repositoryCapabilitiesRenditionSupport() {
+        RepositoryInfo r = this.session.getRepositoryInfo();
+        Assert.assertNotNull(r);
+
+        // capabilities
+        RepositoryCapabilities repcap = r.getCapabilities();
+        Assert.assertNotNull(repcap);
+
+        CapabilityRenditions caprend = repcap.getRenditionsCapability();
+        Assert.assertNotNull(caprend);
+        switch (caprend) {
+        case NONE:
+        case READ:
+            break;
+        default:
+            Assert.fail("enumeration not supported: " + caprend);
+        }
+        this.log.info("CapabilityRendition = " + caprend);
+    }
 
 }
\ No newline at end of file

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/ReadOnlySessionIT.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/ReadOnlySessionIT.java?rev=936943&r1=936942&r2=936943&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/ReadOnlySessionIT.java (original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/ReadOnlySessionIT.java Thu Apr 22 16:34:53 2010
@@ -28,25 +28,25 @@ import org.junit.Test;
  */
 public class ReadOnlySessionIT extends AbstractSessionTest {
 
-	@Test
-	public void testSession() {
-		Assert.assertNotNull(this.session.getDefaultContext());
-		Assert.assertNotNull(this.session.getLocale());
-		Assert.assertNotNull(this.session.getObjectFactory());
-		Assert.assertNotNull(this.session.getRepositoryInfo());
-	}
+    @Test
+    public void testSession() {
+        Assert.assertNotNull(this.session.getDefaultContext());
+        Assert.assertNotNull(this.session.getLocale());
+        Assert.assertNotNull(this.session.getObjectFactory());
+        Assert.assertNotNull(this.session.getRepositoryInfo());
+    }
 
-	@Test
-	public void testSessionObjectAccess() {
-		Folder root = this.session.getRootFolder();
-		Assert.assertNotNull(root);
-		String id = root.getId();
-		Assert.assertNotNull(id);
-	}
+    @Test
+    public void testSessionObjectAccess() {
+        Folder root = this.session.getRootFolder();
+        Assert.assertNotNull(root);
+        String id = root.getId();
+        Assert.assertNotNull(id);
+    }
 
-	@Test
-	public void testSessionClear() {
-		this.session.clear();
-	}
+    @Test
+    public void testSessionClear() {
+        this.session.clear();
+    }
 
 }

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/ReadOnlyTypeIT.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/ReadOnlyTypeIT.java?rev=936943&r1=936942&r2=936943&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/ReadOnlyTypeIT.java (original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/ReadOnlyTypeIT.java Thu Apr 22 16:34:53 2010
@@ -34,105 +34,92 @@ import org.junit.Test;
 
 public class ReadOnlyTypeIT extends AbstractSessionTest {
 
-	@Test
-	public void readOptionalBaseTypePolicy() {
-		try {
-			ObjectType otd = this.session
-					.getTypeDefinition(ObjectType.POLICY_BASETYPE_ID);
-			Assert.assertTrue(otd instanceof PolicyType);
-			Assert.assertEquals(ObjectType.POLICY_BASETYPE_ID, otd.getId());
-			Assert.assertEquals(null, otd.getBaseType());
-		} catch (CmisObjectNotFoundException e) {
-			// policies not supported
-		}
-	}
-
-	@Test
-	public void readOptionalBaseTypeRelation() {
-		try {
-			ObjectType otd = this.session
-					.getTypeDefinition(ObjectType.RELATIONSHIP_BASETYPE_ID);
-			Assert.assertNotNull(otd);
-			Assert.assertTrue(otd instanceof RelationshipType);
-			Assert.assertEquals(ObjectType.RELATIONSHIP_BASETYPE_ID, otd
-					.getId());
-			Assert.assertEquals(null, otd.getBaseType());
-		} catch (CmisObjectNotFoundException e) {
-			// policies not supported
-		}
-	}
-
-	@Test
-	public void readBaseTypeDocument() {
-		ObjectType otd = this.session
-				.getTypeDefinition(ObjectType.DOCUMENT_BASETYPE_ID);
-		Assert.assertNotNull(otd);
-		Assert.assertTrue(otd instanceof DocumentType);
-		Assert.assertEquals(ObjectType.DOCUMENT_BASETYPE_ID, otd.getId());
-		Assert.assertEquals(null, otd.getBaseType());
-
-	}
-
-	@Test
-	public void readBaseTypeFolder() {
-		ObjectType otf = this.session
-				.getTypeDefinition(ObjectType.FOLDER_BASETYPE_ID);
-		Assert.assertNotNull(otf);
-		Assert.assertTrue(otf instanceof FolderType);
-		Assert.assertEquals(ObjectType.FOLDER_BASETYPE_ID, otf.getId());
-		Assert.assertEquals(null, otf.getBaseType());
-	}
-
-	@Test
-	public void readTypeChildrenDocument() {
-		ObjectType otd = this.session
-				.getTypeDefinition(ObjectType.DOCUMENT_BASETYPE_ID);
-		Assert.assertNotNull(otd);
-		PagingIterable<ObjectType> pc = this.session.getTypeChildren(otd
-				.getId(), true, 2);
-		Assert.assertNotNull(pc);
-
-		for (ObjectType ot1 : pc) {
-			ObjectType ot2 = this.session.getTypeDefinition(ot1.getId());
-			Assert.assertEquals(ot1.getId(), ot2.getId());
-		}
-	}
-
-	@Test
-	public void readTypeChildrenFolder() {
-		ObjectType otd = this.session
-				.getTypeDefinition(ObjectType.FOLDER_BASETYPE_ID);
-		Assert.assertNotNull(otd);
-		PagingIterable<ObjectType> pc = this.session.getTypeChildren(otd
-				.getId(), true, 2);
-		Assert.assertNotNull(pc);
-
-		for (ObjectType ot1 : pc) {
-			ObjectType ot2 = this.session.getTypeDefinition(ot1.getId());
-			Assert.assertEquals(ot1, ot2);
-		}
-	}
-
-	@Test
-	public void readTypeDescandantsDocument() {
-		ObjectType otd = this.session
-				.getTypeDefinition(ObjectType.DOCUMENT_BASETYPE_ID);
-		Assert.assertNotNull(otd);
-		List<Tree<ObjectType>> desc = this.session.getTypeDescendants(otd
-				.getId(), 1, true);
-		Assert.assertNotNull(desc);
-		Assert.assertFalse(desc.isEmpty());
-	}
-
-	@Test
-	public void readTypeDescandantsFolder() {
-		ObjectType otd = this.session
-				.getTypeDefinition(ObjectType.FOLDER_BASETYPE_ID);
-		Assert.assertNotNull(otd);
-		List<Tree<ObjectType>> desc = this.session.getTypeDescendants(otd
-				.getId(), 1, true);
-		Assert.assertNotNull(desc);
-		desc.isEmpty();
-	}
+    @Test
+    public void readOptionalBaseTypePolicy() {
+        try {
+            ObjectType otd = this.session.getTypeDefinition(ObjectType.POLICY_BASETYPE_ID);
+            Assert.assertTrue(otd instanceof PolicyType);
+            Assert.assertEquals(ObjectType.POLICY_BASETYPE_ID, otd.getId());
+            Assert.assertEquals(null, otd.getBaseType());
+        } catch (CmisObjectNotFoundException e) {
+            // policies not supported
+        }
+    }
+
+    @Test
+    public void readOptionalBaseTypeRelation() {
+        try {
+            ObjectType otd = this.session.getTypeDefinition(ObjectType.RELATIONSHIP_BASETYPE_ID);
+            Assert.assertNotNull(otd);
+            Assert.assertTrue(otd instanceof RelationshipType);
+            Assert.assertEquals(ObjectType.RELATIONSHIP_BASETYPE_ID, otd.getId());
+            Assert.assertEquals(null, otd.getBaseType());
+        } catch (CmisObjectNotFoundException e) {
+            // policies not supported
+        }
+    }
+
+    @Test
+    public void readBaseTypeDocument() {
+        ObjectType otd = this.session.getTypeDefinition(ObjectType.DOCUMENT_BASETYPE_ID);
+        Assert.assertNotNull(otd);
+        Assert.assertTrue(otd instanceof DocumentType);
+        Assert.assertEquals(ObjectType.DOCUMENT_BASETYPE_ID, otd.getId());
+        Assert.assertEquals(null, otd.getBaseType());
+
+    }
+
+    @Test
+    public void readBaseTypeFolder() {
+        ObjectType otf = this.session.getTypeDefinition(ObjectType.FOLDER_BASETYPE_ID);
+        Assert.assertNotNull(otf);
+        Assert.assertTrue(otf instanceof FolderType);
+        Assert.assertEquals(ObjectType.FOLDER_BASETYPE_ID, otf.getId());
+        Assert.assertEquals(null, otf.getBaseType());
+    }
+
+    @Test
+    public void readTypeChildrenDocument() {
+        ObjectType otd = this.session.getTypeDefinition(ObjectType.DOCUMENT_BASETYPE_ID);
+        Assert.assertNotNull(otd);
+        PagingIterable<ObjectType> pc = this.session.getTypeChildren(otd.getId(), true, 2);
+        Assert.assertNotNull(pc);
+
+        for (ObjectType ot1 : pc) {
+            ObjectType ot2 = this.session.getTypeDefinition(ot1.getId());
+            Assert.assertEquals(ot1.getId(), ot2.getId());
+        }
+    }
+
+    @Test
+    public void readTypeChildrenFolder() {
+        ObjectType otd = this.session.getTypeDefinition(ObjectType.FOLDER_BASETYPE_ID);
+        Assert.assertNotNull(otd);
+        PagingIterable<ObjectType> pc = this.session.getTypeChildren(otd.getId(), true, 2);
+        Assert.assertNotNull(pc);
+
+        for (ObjectType ot1 : pc) {
+            ObjectType ot2 = this.session.getTypeDefinition(ot1.getId());
+            Assert.assertEquals(ot1, ot2);
+        }
+    }
+
+    @Test
+    public void readTypeDescandantsDocument() {
+        ObjectType otd = this.session.getTypeDefinition(ObjectType.DOCUMENT_BASETYPE_ID);
+        Assert.assertNotNull(otd);
+        List<Tree<ObjectType>> desc = this.session.getTypeDescendants(otd.getId(), 1, true);
+        Assert.assertNotNull(desc);
+        Assert.assertFalse(desc.isEmpty());
+    }
+
+    @Test
+    public void readTypeDescandantsFolder() {
+        ObjectType otd = this.session.getTypeDefinition(ObjectType.FOLDER_BASETYPE_ID);
+        Assert.assertNotNull(otd);
+        List<Tree<ObjectType>> desc = this.session.getTypeDescendants(otd.getId(), 1, true);
+        Assert.assertNotNull(desc);
+        desc.isEmpty();
+    }
 
 }

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/WriteObjectIT.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/WriteObjectIT.java?rev=936943&r1=936942&r2=936943&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/WriteObjectIT.java (original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/WriteObjectIT.java Thu Apr 22 16:34:53 2010
@@ -39,209 +39,196 @@ import org.junit.Test;
 
 public class WriteObjectIT extends AbstractSessionTest {
 
-	@Test
-	public void createFolder() {
-		ObjectId parentId = this.session
-				.createObjectId(Fixture.getTestRootId());
-		String folderName = UUID.randomUUID().toString();
-		String typeId = FixtureData.FOLDER_TYPE_ID.value();
-
-		/*
-		 * ObjectType ot = this.session.getTypeDefinition(typeId);
-		 * Collection<PropertyDefinition<?>> pdefs = ot.getPropertyDefintions()
-		 * .values(); List<Property<?>> properties = new
-		 * ArrayList<Property<?>>(); Property<?> prop = null;
-		 * 
-		 * for (PropertyDefinition<?> pd : pdefs) { try { CmisProperties cmisp =
-		 * CmisProperties.fromValue(pd.getId()); switch (cmisp) { case NAME:
-		 * prop = this.session.getObjectFactory().createProperty(pd,
-		 * folderName); properties.add(prop); break; case OBJECT_TYPE_ID: prop =
-		 * this.session.getObjectFactory().createProperty(pd, typeId);
-		 * properties.add(prop); break; default: break; } } catch (Exception e)
-		 * { // custom property definition }
-		 * 
-		 * }
-		 */
-
-		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(Fixture.getTestRootId());
-		String folderName = UUID.randomUUID().toString();
-		String typeId = FixtureData.DOCUMENT_TYPE_ID.value();
-
-		/*
-		 * ObjectType ot = this.session.getTypeDefinition(typeId);
-		 * Collection<PropertyDefinition<?>> pdefs = ot.getPropertyDefintions()
-		 * .values(); List<Property<?>> properties = new
-		 * ArrayList<Property<?>>(); Property<?> prop = null;
-		 * 
-		 * for (PropertyDefinition<?> pd : pdefs) { try { CmisProperties cmisp =
-		 * CmisProperties.fromValue(pd.getId()); switch (cmisp) { case NAME:
-		 * prop = this.session.getObjectFactory().createProperty(pd,
-		 * folderName); properties.add(prop); break; case OBJECT_TYPE_ID: prop =
-		 * this.session.getObjectFactory().createProperty(pd, typeId);
-		 * properties.add(prop); break; default: break; } } catch (Exception e)
-		 * { /* custom property definition (note: document type should not have
-		 * further mandatory properties)
-		 */
-		/*
-		 * this.log .info(
-		 * "Custom property found but not supported in test case!", e); } }
-		 */
-
-		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(Fixture
-					.getTestRootId());
-			/*
-			 * List<Property<?>> srcProperties = srcDocument.getProperties();
-			 * assertNotNull(srcProperties); List<Property<?>> dstProperties =
-			 * new ArrayList<Property<?>>();
-			 * 
-			 * for (Property<?> p : srcProperties) { if
-			 * (p.getId().equalsIgnoreCase(CmisProperties.NAME.value())) { //
-			 * change the name String name = UUID.randomUUID().toString();
-			 * Property<String> pn = this.session.getObjectFactory()
-			 * .createProperty(p.getDefinition(), name); dstProperties.add(pn);
-			 * } else { dstProperties.add(p); } }
-			 */
-			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();
-		assertTrue(true);
-	}
-
-	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 createFolder() {
+        ObjectId parentId = this.session.createObjectId(Fixture.getTestRootId());
+        String folderName = UUID.randomUUID().toString();
+        String typeId = FixtureData.FOLDER_TYPE_ID.value();
+
+        /*
+         * ObjectType ot = this.session.getTypeDefinition(typeId);
+         * Collection<PropertyDefinition<?>> pdefs = ot.getPropertyDefintions()
+         * .values(); List<Property<?>> properties = new
+         * ArrayList<Property<?>>(); Property<?> prop = null;
+         * 
+         * for (PropertyDefinition<?> pd : pdefs) { try { CmisProperties cmisp =
+         * CmisProperties.fromValue(pd.getId()); switch (cmisp) { case NAME:
+         * prop = this.session.getObjectFactory().createProperty(pd,
+         * folderName); properties.add(prop); break; case OBJECT_TYPE_ID: prop =
+         * this.session.getObjectFactory().createProperty(pd, typeId);
+         * properties.add(prop); break; default: break; } } catch (Exception e)
+         * { // custom property definition }
+         * 
+         * }
+         */
+
+        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(Fixture.getTestRootId());
+        String folderName = UUID.randomUUID().toString();
+        String typeId = FixtureData.DOCUMENT_TYPE_ID.value();
+
+        /*
+         * ObjectType ot = this.session.getTypeDefinition(typeId);
+         * Collection<PropertyDefinition<?>> pdefs = ot.getPropertyDefintions()
+         * .values(); List<Property<?>> properties = new
+         * ArrayList<Property<?>>(); Property<?> prop = null;
+         * 
+         * for (PropertyDefinition<?> pd : pdefs) { try { CmisProperties cmisp =
+         * CmisProperties.fromValue(pd.getId()); switch (cmisp) { case NAME:
+         * prop = this.session.getObjectFactory().createProperty(pd,
+         * folderName); properties.add(prop); break; case OBJECT_TYPE_ID: prop =
+         * this.session.getObjectFactory().createProperty(pd, typeId);
+         * properties.add(prop); break; default: break; } } catch (Exception e)
+         * { /* custom property definition (note: document type should not have
+         * further mandatory properties)
+         */
+        /*
+         * this.log .info(
+         * "Custom property found but not supported in test case!", e); } }
+         */
+
+        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(Fixture.getTestRootId());
+            /*
+             * List<Property<?>> srcProperties = srcDocument.getProperties();
+             * assertNotNull(srcProperties); List<Property<?>> dstProperties =
+             * new ArrayList<Property<?>>();
+             * 
+             * for (Property<?> p : srcProperties) { if
+             * (p.getId().equalsIgnoreCase(CmisProperties.NAME.value())) { //
+             * change the name String name = UUID.randomUUID().toString();
+             * Property<String> pn = this.session.getObjectFactory()
+             * .createProperty(p.getDefinition(), name); dstProperties.add(pn);
+             * } else { dstProperties.add(p); } }
+             */
+            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();
+        assertTrue(true);
+    }
+
+    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();
+    }
 }

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/suite/SuiteWebServiceIT.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/suite/SuiteWebServiceIT.java?rev=936943&r1=936942&r2=936943&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/suite/SuiteWebServiceIT.java (original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/suite/SuiteWebServiceIT.java Thu Apr 22 16:34:53 2010
@@ -25,8 +25,8 @@ import org.junit.runners.Suite.SuiteClas
 @RunWith(Suite.class)
 @SuiteClasses( {})
 public class SuiteWebServiceIT {
-	static {
-		// TODO SKL not working
-		// Fixture.enableWebServices();
-	}
+    static {
+        // TODO SKL not working
+        // Fixture.enableWebServices();
+    }
 }

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/sample/AbstractSampleIT.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/sample/AbstractSampleIT.java?rev=936943&r1=936942&r2=936943&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/sample/AbstractSampleIT.java (original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/sample/AbstractSampleIT.java Thu Apr 22 16:34:53 2010
@@ -45,126 +45,122 @@ import org.junit.Test;
  */
 public abstract class AbstractSampleIT {
 
-	private static Session fSession;
+    private static Session fSession;
 
-	/**
-	 * Returns the current Session object.
-	 */
-	protected Session getSession() {
-		return fSession;
-	}
-
-	/**
-	 * Returns a new Session object.
-	 */
-	protected abstract Session createSession();
-
-	@BeforeClass
-	public static void setUpClass() {
-		fSession = null;
-	}
-
-	@Before
-	public void setUp() {
-		if (fSession == null) {
-			fSession = createSession();
-		}
-	}
-
-	/**
-	 * Simple repository info test.
-	 */
-	@Test
-	public void testRepositoryInfo() {
-		RepositoryInfo ri = getSession().getRepositoryInfo();
-		assertNotNull(ri);
-		assertEquals(SessionFactory.getRepositoryId(), ri.getId());
-		assertNotNull(ri.getName());
-		assertNotNull(ri.getRootFolderId());
-		assertNotNull(ri.getCmisVersionSupported());
-		assertNotNull(ri.getCapabilities());
-		// assertNotNull(ri.getAclCapabilities());
-	}
-
-	/**
-	 * Simple types test.
-	 */
-	@Test
-	public void testTypes() {
-		String documentBaseId = "cmis:document";
-		String folderBaseId = "cmis:folder";
-
-		// check document type definition
-		ObjectType documentType = getSession()
-				.getTypeDefinition(documentBaseId);
-		checkBaseType(documentBaseId, BaseTypeId.CMIS_DOCUMENT, documentType);
-
-		// check folder type definition
-		ObjectType folderType = getSession().getTypeDefinition(folderBaseId);
-		checkBaseType(folderBaseId, BaseTypeId.CMIS_FOLDER, folderType);
-
-		// get base types via getTypesChildren
-		PagingIterable<ObjectType> baseTypes = getSession().getTypeChildren(
-				null, true, 10);
-		assertNotNull(baseTypes);
-
-		boolean hasDocumentBaseType = false;
-		boolean hasFolderBaseType = false;
-		for (ObjectType ot : baseTypes) {
-			checkBaseType(null, null, ot);
-
-			if (ot.getId().equals(documentBaseId)) {
-				hasDocumentBaseType = true;
-			}
-
-			if (ot.getId().equals(folderBaseId)) {
-				hasFolderBaseType = true;
-			}
-		}
-
-		assertTrue(hasDocumentBaseType);
-		assertTrue(hasFolderBaseType);
-
-		// get base types via getTypeDescendants
-		List<Tree<ObjectType>> baseTypeDesc = getSession().getTypeDescendants(
-				null, -1, true);
-		assertNotNull(baseTypeDesc);
-
-		hasDocumentBaseType = false;
-		hasFolderBaseType = false;
-		for (Tree<ObjectType> cot : baseTypeDesc) {
-			assertNotNull(cot);
-			// checkBaseType(null, null, cot.getItem());
-
-			if (cot.getItem().getId().equals(documentBaseId)) {
-				hasDocumentBaseType = true;
-			}
-
-			if (cot.getItem().getId().equals(folderBaseId)) {
-				hasFolderBaseType = true;
-			}
-		}
-
-		assertTrue(hasDocumentBaseType);
-		assertTrue(hasFolderBaseType);
-	}
-
-	/**
-	 * Checks a base type.
-	 */
-	private void checkBaseType(String id, BaseTypeId baseType,
-			ObjectType objectType) {
-		assertNotNull(objectType);
-		if (id != null) {
-			assertEquals(id, objectType.getId());
-		}
-		if (baseType != null) {
-			assertEquals(baseType, objectType.getBaseTypeId());
-		}
-		assertTrue(objectType.isBaseType());
-		assertNull(objectType.getBaseType());
-		assertNull(objectType.getParentType());
-		assertNotNull(objectType.getPropertyDefinitions());
-		assertFalse(objectType.getPropertyDefinitions().isEmpty());
-	}
+    /**
+     * Returns the current Session object.
+     */
+    protected Session getSession() {
+        return fSession;
+    }
+
+    /**
+     * Returns a new Session object.
+     */
+    protected abstract Session createSession();
+
+    @BeforeClass
+    public static void setUpClass() {
+        fSession = null;
+    }
+
+    @Before
+    public void setUp() {
+        if (fSession == null) {
+            fSession = createSession();
+        }
+    }
+
+    /**
+     * Simple repository info test.
+     */
+    @Test
+    public void testRepositoryInfo() {
+        RepositoryInfo ri = getSession().getRepositoryInfo();
+        assertNotNull(ri);
+        assertEquals(SessionFactory.getRepositoryId(), ri.getId());
+        assertNotNull(ri.getName());
+        assertNotNull(ri.getRootFolderId());
+        assertNotNull(ri.getCmisVersionSupported());
+        assertNotNull(ri.getCapabilities());
+        // assertNotNull(ri.getAclCapabilities());
+    }
+
+    /**
+     * Simple types test.
+     */
+    @Test
+    public void testTypes() {
+        String documentBaseId = "cmis:document";
+        String folderBaseId = "cmis:folder";
+
+        // check document type definition
+        ObjectType documentType = getSession().getTypeDefinition(documentBaseId);
+        checkBaseType(documentBaseId, BaseTypeId.CMIS_DOCUMENT, documentType);
+
+        // check folder type definition
+        ObjectType folderType = getSession().getTypeDefinition(folderBaseId);
+        checkBaseType(folderBaseId, BaseTypeId.CMIS_FOLDER, folderType);
+
+        // get base types via getTypesChildren
+        PagingIterable<ObjectType> baseTypes = getSession().getTypeChildren(null, true, 10);
+        assertNotNull(baseTypes);
+
+        boolean hasDocumentBaseType = false;
+        boolean hasFolderBaseType = false;
+        for (ObjectType ot : baseTypes) {
+            checkBaseType(null, null, ot);
+
+            if (ot.getId().equals(documentBaseId)) {
+                hasDocumentBaseType = true;
+            }
+
+            if (ot.getId().equals(folderBaseId)) {
+                hasFolderBaseType = true;
+            }
+        }
+
+        assertTrue(hasDocumentBaseType);
+        assertTrue(hasFolderBaseType);
+
+        // get base types via getTypeDescendants
+        List<Tree<ObjectType>> baseTypeDesc = getSession().getTypeDescendants(null, -1, true);
+        assertNotNull(baseTypeDesc);
+
+        hasDocumentBaseType = false;
+        hasFolderBaseType = false;
+        for (Tree<ObjectType> cot : baseTypeDesc) {
+            assertNotNull(cot);
+            // checkBaseType(null, null, cot.getItem());
+
+            if (cot.getItem().getId().equals(documentBaseId)) {
+                hasDocumentBaseType = true;
+            }
+
+            if (cot.getItem().getId().equals(folderBaseId)) {
+                hasFolderBaseType = true;
+            }
+        }
+
+        assertTrue(hasDocumentBaseType);
+        assertTrue(hasFolderBaseType);
+    }
+
+    /**
+     * Checks a base type.
+     */
+    private void checkBaseType(String id, BaseTypeId baseType, ObjectType objectType) {
+        assertNotNull(objectType);
+        if (id != null) {
+            assertEquals(id, objectType.getId());
+        }
+        if (baseType != null) {
+            assertEquals(baseType, objectType.getBaseTypeId());
+        }
+        assertTrue(objectType.isBaseType());
+        assertNull(objectType.getBaseType());
+        assertNull(objectType.getParentType());
+        assertNotNull(objectType.getPropertyDefinitions());
+        assertFalse(objectType.getPropertyDefinitions().isEmpty());
+    }
 }

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/sample/AtomPubSampleIT.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/sample/AtomPubSampleIT.java?rev=936943&r1=936942&r2=936943&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/sample/AtomPubSampleIT.java (original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/sample/AtomPubSampleIT.java Thu Apr 22 16:34:53 2010
@@ -29,9 +29,9 @@ import org.apache.chemistry.opencmis.fit
  */
 public class AtomPubSampleIT extends AbstractSampleIT {
 
-	@Override
-	protected Session createSession() {
-		return SessionFactory.createAtomPubSession();
-	}
+    @Override
+    protected Session createSession() {
+        return SessionFactory.createAtomPubSession();
+    }
 
 }

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/sample/WebServicesSampleIT.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/sample/WebServicesSampleIT.java?rev=936943&r1=936942&r2=936943&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/sample/WebServicesSampleIT.java (original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/sample/WebServicesSampleIT.java Thu Apr 22 16:34:53 2010
@@ -29,9 +29,9 @@ import org.apache.chemistry.opencmis.fit
  */
 public class WebServicesSampleIT extends AbstractSampleIT {
 
-	@Override
-	protected Session createSession() {
-		return SessionFactory.createWebServicesSession();
-	}
+    @Override
+    protected Session createSession() {
+        return SessionFactory.createWebServicesSession();
+    }
 
 }

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tools/src/main/java/org/apache/chemistry/opencmis/commander/Command.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tools/src/main/java/org/apache/chemistry/opencmis/commander/Command.java?rev=936943&r1=936942&r2=936943&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tools/src/main/java/org/apache/chemistry/opencmis/commander/Command.java (original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tools/src/main/java/org/apache/chemistry/opencmis/commander/Command.java Thu Apr 22 16:34:53 2010
@@ -30,18 +30,18 @@ import org.apache.chemistry.opencmis.com
  */
 public interface Command {
 
-	/**
-	 * Returns the command name.
-	 */
-	String getCommandName();
+    /**
+     * Returns the command name.
+     */
+    String getCommandName();
 
-	/**
-	 * Returns the usage hint.
-	 */
-	String getUsage();
+    /**
+     * Returns the usage hint.
+     */
+    String getUsage();
 
-	/**
-	 * Executes the command.
-	 */
-	void execute(CmisBinding binding, String[] args, PrintWriter output);
+    /**
+     * Executes the command.
+     */
+    void execute(CmisBinding binding, String[] args, PrintWriter output);
 }



Mime
View raw message