chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fguilla...@apache.org
Subject svn commit: r831419 - in /incubator/chemistry/trunk/chemistry/chemistry-tck-atompub/src/main: java/org/apache/chemistry/tck/atompub/test/spec/ resources/org/apache/chemistry/tck/atompub/templates/
Date Fri, 30 Oct 2009 18:44:44 GMT
Author: fguillaume
Date: Fri Oct 30 18:44:43 2009
New Revision: 831419

URL: http://svn.apache.org/viewvc?rev=831419&view=rev
Log:
Fix TCK to generate valid Atom entries on create/update (Atom 4.1.2 MUSTs)

Modified:
    incubator/chemistry/trunk/chemistry/chemistry-tck-atompub/src/main/java/org/apache/chemistry/tck/atompub/test/spec/UpdateTest.java
    incubator/chemistry/trunk/chemistry/chemistry-tck-atompub/src/main/java/org/apache/chemistry/tck/atompub/test/spec/VersionsTest.java
    incubator/chemistry/trunk/chemistry/chemistry-tck-atompub/src/main/resources/org/apache/chemistry/tck/atompub/templates/createatomentry.atomentry.xml
    incubator/chemistry/trunk/chemistry/chemistry-tck-atompub/src/main/resources/org/apache/chemistry/tck/atompub/templates/createdocument.atomentry.xml
    incubator/chemistry/trunk/chemistry/chemistry-tck-atompub/src/main/resources/org/apache/chemistry/tck/atompub/templates/createdocumentBase64.cmisatomentry.xml
    incubator/chemistry/trunk/chemistry/chemistry-tck-atompub/src/main/resources/org/apache/chemistry/tck/atompub/templates/createfolder.atomentry.xml
    incubator/chemistry/trunk/chemistry/chemistry-tck-atompub/src/main/resources/org/apache/chemistry/tck/atompub/templates/updatedocument.atomentry.xml
    incubator/chemistry/trunk/chemistry/chemistry-tck-atompub/src/main/resources/org/apache/chemistry/tck/atompub/templates/updatedocument.cmisatomentry.xml

Modified: incubator/chemistry/trunk/chemistry/chemistry-tck-atompub/src/main/java/org/apache/chemistry/tck/atompub/test/spec/UpdateTest.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-tck-atompub/src/main/java/org/apache/chemistry/tck/atompub/test/spec/UpdateTest.java?rev=831419&r1=831418&r2=831419&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-tck-atompub/src/main/java/org/apache/chemistry/tck/atompub/test/spec/UpdateTest.java
(original)
+++ incubator/chemistry/trunk/chemistry/chemistry-tck-atompub/src/main/java/org/apache/chemistry/tck/atompub/test/spec/UpdateTest.java
Fri Oct 30 18:44:43 2009
@@ -35,7 +35,7 @@
  * CMIS Update Tests
  */
 public class UpdateTest extends TCKTest {
-    
+
     public void testUpdatePutCMISContent() throws Exception {
         // retrieve test folder for update
         Entry document = fixture.createTestDocument("testUpdatePutCMISContent");
@@ -50,6 +50,7 @@
 
         // update
         String updateFile = templates.load("updatedocument.cmisatomentry.xml");
+        updateFile = updateFile.replace("${ID}", document.getId().toString());
         // FIXME: Add a decent UID generation policy
         // String guid = GUID.generate();
         String guid = System.currentTimeMillis() + "";
@@ -84,6 +85,7 @@
 
         // update
         String updateFile = templates.load("updatedocument.atomentry.xml");
+        updateFile = updateFile.replace("${ID}", document.getId().toString());
         // FIXME: Add a decent UID generation policy
         // String guid = GUID.generate();
         String guid = System.currentTimeMillis() + "";
@@ -97,8 +99,9 @@
         Assert.assertEquals(document.getId(), updated.getId());
         Assert.assertEquals(document.getPublished(), updated.getPublished());
         Assert.assertEquals("Updated Title " + guid, updated.getTitle());
-        // TODO: why is this testing for text/plain? it should be test/html
-        Assert.assertEquals("text/plain", updated.getContentMimeType().toString());
+        // entry provides <content> without type -> plain text (Atom 3.1.1)
+        // repository may add a charset after that thus the startsWith
+        Assert.assertTrue(updated.getContentMimeType().toString().startsWith("text/plain"));
         Response contentRes = client.executeRequest(new GetRequest(updated.getContentSrc().toString()),
200);
         Assert.assertEquals("updated content " + guid, contentRes.getContentAsString());
     }

Modified: incubator/chemistry/trunk/chemistry/chemistry-tck-atompub/src/main/java/org/apache/chemistry/tck/atompub/test/spec/VersionsTest.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-tck-atompub/src/main/java/org/apache/chemistry/tck/atompub/test/spec/VersionsTest.java?rev=831419&r1=831418&r2=831419&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-tck-atompub/src/main/java/org/apache/chemistry/tck/atompub/test/spec/VersionsTest.java
(original)
+++ incubator/chemistry/trunk/chemistry/chemistry-tck-atompub/src/main/java/org/apache/chemistry/tck/atompub/test/spec/VersionsTest.java
Fri Oct 30 18:44:43 2009
@@ -42,7 +42,7 @@
  * CMIS Versions Tests
  */
 public class VersionsTest extends TCKTest {
-    
+
     @Override
     public void tearDown() throws Exception {
         // cancel any outstanding checkouts
@@ -61,7 +61,7 @@
 
         super.tearDown();
     }
-    
+
     public void testGetCheckedOut() throws Exception {
         // retrieve test folder for checkouts
         Entry testFolder = fixture.getTestCaseFolder();
@@ -206,6 +206,7 @@
 
         // test update of private working copy
         String updateFile = templates.load("updatedocument.atomentry.xml");
+        updateFile = updateFile.replace("${ID}", document.getId().toString());
         // FIXME: Add a decent UID generation policy
         // String guid = GUID.generate();
         String guid = System.currentTimeMillis() + "";

Modified: incubator/chemistry/trunk/chemistry/chemistry-tck-atompub/src/main/resources/org/apache/chemistry/tck/atompub/templates/createatomentry.atomentry.xml
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-tck-atompub/src/main/resources/org/apache/chemistry/tck/atompub/templates/createatomentry.atomentry.xml?rev=831419&r1=831418&r2=831419&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-tck-atompub/src/main/resources/org/apache/chemistry/tck/atompub/templates/createatomentry.atomentry.xml
(original)
+++ incubator/chemistry/trunk/chemistry/chemistry-tck-atompub/src/main/resources/org/apache/chemistry/tck/atompub/templates/createatomentry.atomentry.xml
Fri Oct 30 18:44:43 2009
@@ -1,6 +1,8 @@
 <?xml version="1.0" ?>
 <entry xmlns="http://www.w3.org/2005/Atom">
+  <id>urn:uuid:00000000-0000-0000-0000-000000000000</id>
   <title>${NAME}</title>
+  <updated>2009-01-01T00:00:00Z</updated>
   <author>
     <name>CMIS Test</name>
   </author>

Modified: incubator/chemistry/trunk/chemistry/chemistry-tck-atompub/src/main/resources/org/apache/chemistry/tck/atompub/templates/createdocument.atomentry.xml
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-tck-atompub/src/main/resources/org/apache/chemistry/tck/atompub/templates/createdocument.atomentry.xml?rev=831419&r1=831418&r2=831419&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-tck-atompub/src/main/resources/org/apache/chemistry/tck/atompub/templates/createdocument.atomentry.xml
(original)
+++ incubator/chemistry/trunk/chemistry/chemistry-tck-atompub/src/main/resources/org/apache/chemistry/tck/atompub/templates/createdocument.atomentry.xml
Fri Oct 30 18:44:43 2009
@@ -1,6 +1,9 @@
 <?xml version="1.0" encoding="utf-8"?>
 <entry xmlns="http://www.w3.org/2005/Atom" xmlns:cmisra="http://docs.oasis-open.org/ns/cmis/restatom/200908/"
xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200908/">
+  <id>urn:uuid:00000000-0000-0000-0000-000000000000</id>
   <title>${NAME}</title>
+  <updated>2009-01-01T00:00:00Z</updated>
+  <author>admin</author>
   <summary>${NAME} (summary)</summary>
   <content type="text/html">${CONTENT}</content>
   <cmisra:object>

Modified: incubator/chemistry/trunk/chemistry/chemistry-tck-atompub/src/main/resources/org/apache/chemistry/tck/atompub/templates/createdocumentBase64.cmisatomentry.xml
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-tck-atompub/src/main/resources/org/apache/chemistry/tck/atompub/templates/createdocumentBase64.cmisatomentry.xml?rev=831419&r1=831418&r2=831419&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-tck-atompub/src/main/resources/org/apache/chemistry/tck/atompub/templates/createdocumentBase64.cmisatomentry.xml
(original)
+++ incubator/chemistry/trunk/chemistry/chemistry-tck-atompub/src/main/resources/org/apache/chemistry/tck/atompub/templates/createdocumentBase64.cmisatomentry.xml
Fri Oct 30 18:44:43 2009
@@ -1,6 +1,9 @@
 <?xml version="1.0" encoding="utf-8"?>
 <entry xmlns="http://www.w3.org/2005/Atom" xmlns:cmisra="http://docs.oasis-open.org/ns/cmis/restatom/200908/"
xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200908/">
+  <id>urn:uuid:00000000-0000-0000-0000-000000000000</id>
   <title>${NAME}</title>
+  <updated>2009-01-01T00:00:00Z</updated>
+  <author>admin</author>
   <summary>${NAME} (summary)</summary>
   <content type="text">Must be ignored - overridden by cmisra:content</content>
   <cmisra:content>

Modified: incubator/chemistry/trunk/chemistry/chemistry-tck-atompub/src/main/resources/org/apache/chemistry/tck/atompub/templates/createfolder.atomentry.xml
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-tck-atompub/src/main/resources/org/apache/chemistry/tck/atompub/templates/createfolder.atomentry.xml?rev=831419&r1=831418&r2=831419&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-tck-atompub/src/main/resources/org/apache/chemistry/tck/atompub/templates/createfolder.atomentry.xml
(original)
+++ incubator/chemistry/trunk/chemistry/chemistry-tck-atompub/src/main/resources/org/apache/chemistry/tck/atompub/templates/createfolder.atomentry.xml
Fri Oct 30 18:44:43 2009
@@ -1,6 +1,10 @@
 <?xml version="1.0" encoding="utf-8"?>
 <entry xmlns="http://www.w3.org/2005/Atom" xmlns:cmisra="http://docs.oasis-open.org/ns/cmis/restatom/200908/"
xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200908/">
+  <id>urn:uuid:00000000-0000-0000-0000-000000000000</id>
   <title>${NAME}</title>
+  <updated>2009-01-01T00:00:00Z</updated>
+  <author>admin</author>
+  <link rel="alternate" href=""/>
   <summary>${NAME} (summary)</summary>
   <cmisra:object>
     <cmis:properties>

Modified: incubator/chemistry/trunk/chemistry/chemistry-tck-atompub/src/main/resources/org/apache/chemistry/tck/atompub/templates/updatedocument.atomentry.xml
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-tck-atompub/src/main/resources/org/apache/chemistry/tck/atompub/templates/updatedocument.atomentry.xml?rev=831419&r1=831418&r2=831419&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-tck-atompub/src/main/resources/org/apache/chemistry/tck/atompub/templates/updatedocument.atomentry.xml
(original)
+++ incubator/chemistry/trunk/chemistry/chemistry-tck-atompub/src/main/resources/org/apache/chemistry/tck/atompub/templates/updatedocument.atomentry.xml
Fri Oct 30 18:44:43 2009
@@ -1,5 +1,8 @@
 <?xml version="1.0" encoding="utf-8"?>
 <entry xmlns="http://www.w3.org/2005/Atom">
+  <id>${ID}</id>
   <title>Updated Title ${NAME}</title>
+  <updated>2009-01-01T00:00:00Z</updated>
+  <author>admin</author>
   <content>updated content ${NAME}</content>
 </entry>

Modified: incubator/chemistry/trunk/chemistry/chemistry-tck-atompub/src/main/resources/org/apache/chemistry/tck/atompub/templates/updatedocument.cmisatomentry.xml
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-tck-atompub/src/main/resources/org/apache/chemistry/tck/atompub/templates/updatedocument.cmisatomentry.xml?rev=831419&r1=831418&r2=831419&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-tck-atompub/src/main/resources/org/apache/chemistry/tck/atompub/templates/updatedocument.cmisatomentry.xml
(original)
+++ incubator/chemistry/trunk/chemistry/chemistry-tck-atompub/src/main/resources/org/apache/chemistry/tck/atompub/templates/updatedocument.cmisatomentry.xml
Fri Oct 30 18:44:43 2009
@@ -1,6 +1,8 @@
 <?xml version="1.0" encoding="utf-8"?>
 <entry xmlns="http://www.w3.org/2005/Atom" xmlns:cmisra="http://docs.oasis-open.org/ns/cmis/restatom/200908/">
+  <id>${ID}</id>
   <title>Updated Title ${NAME}</title>
+  <updated>2009-01-01T00:00:00Z</updated>
   <content>this content must be ignored ${NAME}</content>   <!--  must be
overridden by cmisra:content -->
   <cmisra:content>
     <cmisra:mediatype>text/plain</cmisra:mediatype>



Mime
View raw message