chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fguilla...@apache.org
Subject 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
Date Wed, 06 Jan 2010 17:47:30 GMT
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 {



Mime
View raw message