Return-Path: Delivered-To: apmail-incubator-chemistry-commits-archive@minotaur.apache.org Received: (qmail 72389 invoked from network); 30 Oct 2009 18:45:08 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 30 Oct 2009 18:45:08 -0000 Received: (qmail 81451 invoked by uid 500); 30 Oct 2009 18:45:08 -0000 Delivered-To: apmail-incubator-chemistry-commits-archive@incubator.apache.org Received: (qmail 81418 invoked by uid 500); 30 Oct 2009 18:45:08 -0000 Mailing-List: contact chemistry-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: chemistry-dev@incubator.apache.org Delivered-To: mailing list chemistry-commits@incubator.apache.org Received: (qmail 81408 invoked by uid 99); 30 Oct 2009 18:45:07 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 30 Oct 2009 18:45:07 +0000 X-ASF-Spam-Status: No, hits=-2.6 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 30 Oct 2009 18:45:04 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id A5F5F23888D0; Fri, 30 Oct 2009 18:44:44 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: chemistry-commits@incubator.apache.org From: fguillaume@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20091030184444.A5F5F23888D0@eris.apache.org> 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 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 @@ + urn:uuid:00000000-0000-0000-0000-000000000000 ${NAME} + 2009-01-01T00:00:00Z CMIS Test 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 @@ + urn:uuid:00000000-0000-0000-0000-000000000000 ${NAME} + 2009-01-01T00:00:00Z + admin ${NAME} (summary) ${CONTENT} 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 @@ + urn:uuid:00000000-0000-0000-0000-000000000000 ${NAME} + 2009-01-01T00:00:00Z + admin ${NAME} (summary) Must be ignored - overridden by 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 @@ + urn:uuid:00000000-0000-0000-0000-000000000000 ${NAME} + 2009-01-01T00:00:00Z + admin + ${NAME} (summary) 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 @@ + ${ID} Updated Title ${NAME} + 2009-01-01T00:00:00Z + admin updated content ${NAME} 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 @@ + ${ID} Updated Title ${NAME} + 2009-01-01T00:00:00Z this content must be ignored ${NAME} text/plain