Return-Path: Delivered-To: apmail-incubator-chemistry-commits-archive@minotaur.apache.org Received: (qmail 32931 invoked from network); 13 Jan 2010 23:34:45 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 13 Jan 2010 23:34:45 -0000 Received: (qmail 15756 invoked by uid 500); 13 Jan 2010 23:34:45 -0000 Delivered-To: apmail-incubator-chemistry-commits-archive@incubator.apache.org Received: (qmail 15706 invoked by uid 500); 13 Jan 2010 23:34:45 -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 15696 invoked by uid 99); 13 Jan 2010 23:34:45 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 Jan 2010 23:34:45 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED 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; Wed, 13 Jan 2010 23:34:44 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 5B3CE23889EB; Wed, 13 Jan 2010 23:34:24 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r899000 - in /incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src: main/java/org/apache/chemistry/atompub/server/jaxrs/AbderaResource.java test/java/org/apache/chemistry/atompub/server/AtomPubServerTestCase.java Date: Wed, 13 Jan 2010 23:34:24 -0000 To: chemistry-commits@incubator.apache.org From: fguillaume@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100113233424.5B3CE23889EB@eris.apache.org> Author: fguillaume Date: Wed Jan 13 23:34:23 2010 New Revision: 899000 URL: http://svn.apache.org/viewvc?rev=899000&view=rev Log: Fix POST @Consumes decoding to allow application/atom+xml for RESTEasy Modified: incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/jaxrs/AbderaResource.java incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/test/java/org/apache/chemistry/atompub/server/AtomPubServerTestCase.java Modified: incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/jaxrs/AbderaResource.java URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/jaxrs/AbderaResource.java?rev=899000&r1=898999&r2=899000&view=diff ============================================================================== --- incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/jaxrs/AbderaResource.java (original) +++ incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/jaxrs/AbderaResource.java Wed Jan 13 23:34:23 2010 @@ -288,7 +288,8 @@ @POST @Consumes( { AtomPub.MEDIA_TYPE_ATOM_ENTRY, - // IBM Firefox plugin compat, stupid RESTEasy + // need for RESTeasy: + AtomPub.MEDIA_TYPE_ATOM, AtomPub.MEDIA_TYPE_ATOM_ENTRY + ";charset=UTF-8" }) @Path("children/{objectid}") public Response doPostChildren() { Modified: incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/test/java/org/apache/chemistry/atompub/server/AtomPubServerTestCase.java URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/test/java/org/apache/chemistry/atompub/server/AtomPubServerTestCase.java?rev=899000&r1=898999&r2=899000&view=diff ============================================================================== --- incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/test/java/org/apache/chemistry/atompub/server/AtomPubServerTestCase.java (original) +++ incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/test/java/org/apache/chemistry/atompub/server/AtomPubServerTestCase.java Wed Jan 13 23:34:23 2010 @@ -248,17 +248,21 @@ assertNotNull(ch); resp.release(); - // post of new document - PostMethod postMethod = new PostMethod(base + "/children/" - + rootFolderId); - postMethod.setRequestEntity(new InputStreamRequestEntity( - load("templates/createdocument.atomentry.xml"), - AtomPub.MEDIA_TYPE_ATOM_ENTRY)); - int status = new HttpClient().executeMethod(postMethod); - assertEquals(HttpStatus.SC_CREATED, status); - assertNotNull(postMethod.getResponseHeader(HttpHeaders.LOCATION)); - assertNotNull(postMethod.getResponseHeader(HttpHeaders.CONTENT_LOCATION)); - postMethod.releaseConnection(); + // post of new document, test using various content types + for (String contentType : Arrays. asList( + AtomPub.MEDIA_TYPE_ATOM, // + AtomPub.MEDIA_TYPE_ATOM_ENTRY, // + AtomPub.MEDIA_TYPE_ATOM_ENTRY + ";charset=UTF-8")) { + PostMethod postMethod = new PostMethod(base + "/children/" + + rootFolderId); + postMethod.setRequestEntity(new InputStreamRequestEntity( + load("templates/createdocument.atomentry.xml"), contentType)); + int status = new HttpClient().executeMethod(postMethod); + assertEquals(HttpStatus.SC_CREATED, status); + assertNotNull(postMethod.getResponseHeader(HttpHeaders.LOCATION)); + assertNotNull(postMethod.getResponseHeader(HttpHeaders.CONTENT_LOCATION)); + postMethod.releaseConnection(); + } } public void testObject() throws Exception {