You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@chemistry.apache.org by fg...@apache.org on 2010/01/06 18:47:30 UTC

svn commit: r896576 - in /incubator/chemistry/trunk/chemistry/chemistry-tck-atompub/src/main/java/org/apache/chemistry/tck/atompub: client/CMISClient.java fixture/CMISTestFixture.java test/spec/ContentStreamTest.java

Author: fguillaume
Date: Wed Jan  6 17:47:29 2010
New Revision: 896576

URL: http://svn.apache.org/viewvc?rev=896576&view=rev
Log:
CMIS-90: TCK don't expect an atom:content src when there's no content

Modified:
    incubator/chemistry/trunk/chemistry/chemistry-tck-atompub/src/main/java/org/apache/chemistry/tck/atompub/client/CMISClient.java
    incubator/chemistry/trunk/chemistry/chemistry-tck-atompub/src/main/java/org/apache/chemistry/tck/atompub/fixture/CMISTestFixture.java
    incubator/chemistry/trunk/chemistry/chemistry-tck-atompub/src/main/java/org/apache/chemistry/tck/atompub/test/spec/ContentStreamTest.java

Modified: incubator/chemistry/trunk/chemistry/chemistry-tck-atompub/src/main/java/org/apache/chemistry/tck/atompub/client/CMISClient.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-tck-atompub/src/main/java/org/apache/chemistry/tck/atompub/client/CMISClient.java?rev=896576&r1=896575&r2=896576&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-tck-atompub/src/main/java/org/apache/chemistry/tck/atompub/client/CMISClient.java (original)
+++ incubator/chemistry/trunk/chemistry/chemistry-tck-atompub/src/main/java/org/apache/chemistry/tck/atompub/client/CMISClient.java Wed Jan  6 17:47:29 2010
@@ -323,6 +323,11 @@
     }
 
     public Entry createDocument(IRI parent, String name, String atomEntryFile) throws Exception {
+        return createDocument(parent, name, atomEntryFile, false);
+    }
+
+    public Entry createDocument(IRI parent, String name, String atomEntryFile,
+            boolean expectNoContent) throws Exception {
         String createFile = templates.load(atomEntryFile == null ? "createdocument.atomentry.xml" : atomEntryFile);
         createFile = createFile.replace("${NAME}", name);
         // determine if creating content via mediatype
@@ -339,7 +344,9 @@
         Assert.assertNotNull(entry);
         Assert.assertEquals(name, entry.getTitle());
         // Assert.assertEquals(name + " (summary)", entry.getSummary());
-        Assert.assertNotNull(entry.getContentSrc());
+        if (!expectNoContent) {
+            Assert.assertNotNull(entry.getContentSrc());
+        }
         CMISObject object = entry.getExtension(CMISConstants.OBJECT);
         Assert.assertEquals(CMISConstants.TYPE_DOCUMENT, object.getBaseTypeId().getStringValue());
         String testFileHREF = (String) res.getHeader("Location");

Modified: incubator/chemistry/trunk/chemistry/chemistry-tck-atompub/src/main/java/org/apache/chemistry/tck/atompub/fixture/CMISTestFixture.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-tck-atompub/src/main/java/org/apache/chemistry/tck/atompub/fixture/CMISTestFixture.java?rev=896576&r1=896575&r2=896576&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-tck-atompub/src/main/java/org/apache/chemistry/tck/atompub/fixture/CMISTestFixture.java (original)
+++ incubator/chemistry/trunk/chemistry/chemistry-tck-atompub/src/main/java/org/apache/chemistry/tck/atompub/fixture/CMISTestFixture.java Wed Jan  6 17:47:29 2010
@@ -33,7 +33,7 @@
  * CMIS Test Data
  */
 public class CMISTestFixture {
-    
+
     private static Long testStartTime = null;
 
     private CMISClient client;
@@ -68,8 +68,14 @@
     }
 
     public Entry createTestDocument(String name, String template) throws Exception {
+        return createTestDocument(name, template, true);
+    }
+
+    public Entry createTestDocument(String name, String template,
+            boolean expectNoContent) throws Exception {
         Link children = client.getChildrenLink(getTestCaseFolder());
-        return client.createDocument(children.getHref(), name, template);
+        return client.createDocument(children.getHref(), name, template,
+                expectNoContent);
     }
 
     public Entry createTestFolder(String name) throws Exception {

Modified: incubator/chemistry/trunk/chemistry/chemistry-tck-atompub/src/main/java/org/apache/chemistry/tck/atompub/test/spec/ContentStreamTest.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-tck-atompub/src/main/java/org/apache/chemistry/tck/atompub/test/spec/ContentStreamTest.java?rev=896576&r1=896575&r2=896576&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-tck-atompub/src/main/java/org/apache/chemistry/tck/atompub/test/spec/ContentStreamTest.java (original)
+++ incubator/chemistry/trunk/chemistry/chemistry-tck-atompub/src/main/java/org/apache/chemistry/tck/atompub/test/spec/ContentStreamTest.java Wed Jan  6 17:47:29 2010
@@ -35,10 +35,12 @@
 
     public void testContentStreamEmpty() throws Exception {
         // create document for setting / getting content
-        Entry document = fixture.createTestDocument("testContent", "createdocumentNoContent.atomentry.xml");
+        Entry document = fixture.createTestDocument("testContent", "createdocumentNoContent.atomentry.xml", true);
 
         // retrieve content
-        client.executeRequest(new GetRequest(document.getContentSrc().toString()), 404);
+        Link editMediaLink = document.getEditMediaLink();
+        Assert.assertNotNull(editMediaLink);
+        client.executeRequest(new GetRequest(editMediaLink.getHref().toString()), 404, 409);
     }
 
     public void testUpdateContentStream() throws Exception {