Return-Path: Delivered-To: apmail-sling-commits-archive@www.apache.org Received: (qmail 39891 invoked from network); 12 Apr 2011 09:07:04 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 12 Apr 2011 09:07:04 -0000 Received: (qmail 82603 invoked by uid 500); 12 Apr 2011 09:07:03 -0000 Delivered-To: apmail-sling-commits-archive@sling.apache.org Received: (qmail 82560 invoked by uid 500); 12 Apr 2011 09:06:58 -0000 Mailing-List: contact commits-help@sling.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@sling.apache.org Delivered-To: mailing list commits@sling.apache.org Received: (qmail 82553 invoked by uid 99); 12 Apr 2011 09:06:57 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Apr 2011 09:06:57 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.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; Tue, 12 Apr 2011 09:06:56 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 92F6723889ED; Tue, 12 Apr 2011 09:06:36 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1091328 - /sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/servlets/post/PostServletOutputContentTypeTest.java Date: Tue, 12 Apr 2011 09:06:36 -0000 To: commits@sling.apache.org From: bdelacretaz@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110412090636.92F6723889ED@eris.apache.org> Author: bdelacretaz Date: Tue Apr 12 09:06:35 2011 New Revision: 1091328 URL: http://svn.apache.org/viewvc?rev=1091328&view=rev Log: SLING-2050 - use an invalid operation instead of recursive copy for PostServletOutputContentTypeTest Modified: sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/servlets/post/PostServletOutputContentTypeTest.java Modified: sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/servlets/post/PostServletOutputContentTypeTest.java URL: http://svn.apache.org/viewvc/sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/servlets/post/PostServletOutputContentTypeTest.java?rev=1091328&r1=1091327&r2=1091328&view=diff ============================================================================== --- sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/servlets/post/PostServletOutputContentTypeTest.java (original) +++ sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/servlets/post/PostServletOutputContentTypeTest.java Tue Apr 12 09:06:35 2011 @@ -79,22 +79,22 @@ public class PostServletOutputContentTyp } public void testJsonContentTypeException() throws Exception { - final String testPath = MY_TEST_PATH + "/abs/" + System.currentTimeMillis(); - final String url = HTTP_BASE_URL + "/" + MY_TEST_PATH; - - // create dest as parent - testClient.createNode(HTTP_BASE_URL + testPath + "/dest", null); - // Perform a POST that should fail. + // Perform a POST that fails: invalid PostServlet operation + // with Accept header set to JSON + final String url = HTTP_BASE_URL + "/" + MY_TEST_PATH; final PostMethod post = new PostMethod(url); post.setFollowRedirects(false); - post.addParameter(new NameValuePair(SlingPostConstants.RP_DEST, testPath + "/dest/")); - post.addParameter(new NameValuePair(SlingPostConstants.RP_OPERATION, - SlingPostConstants.OPERATION_COPY)); + post.addParameter(new NameValuePair( + SlingPostConstants.RP_OPERATION, + "InvalidTestOperationFor" + getClass().getSimpleName())); post.addRequestHeader("Accept", CONTENT_TYPE_JSON); final int status = httpClient.executeMethod(post); assertEquals(500, status); + final String contentType = post.getResponseHeader("Content-Type").getValue(); + final String expected = CONTENT_TYPE_JSON; + assertTrue("Expecting content-type " + expected + " for failed POST request, got " + contentType, + contentType!=null && contentType.startsWith(expected)); } - }