incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bdelacre...@apache.org
Subject svn commit: r1307320 - in /sling/trunk/launchpad: integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/servlets/resolution/ test-services/src/main/java/org/apache/sling/launchpad/testservices/servlets/
Date Fri, 30 Mar 2012 09:04:51 GMT
Author: bdelacretaz
Date: Fri Mar 30 09:04:51 2012
New Revision: 1307320

URL: http://svn.apache.org/viewvc?rev=1307320&view=rev
Log:
SLING-923 - test POST with selectors as well

Modified:
    sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/servlets/resolution/SelectorServletTest.java
    sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/servlets/SelectorServlet.java

Modified: sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/servlets/resolution/SelectorServletTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/servlets/resolution/SelectorServletTest.java?rev=1307320&r1=1307319&r2=1307320&view=diff
==============================================================================
--- sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/servlets/resolution/SelectorServletTest.java
(original)
+++ sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/servlets/resolution/SelectorServletTest.java
Fri Mar 30 09:04:51 2012
@@ -16,6 +16,8 @@
  */
 package org.apache.sling.launchpad.webapp.integrationtest.servlets.resolution;
 
+import org.apache.commons.httpclient.methods.PostMethod;
+
 /** Test the SelectorServlet */
 public class SelectorServletTest extends ResolutionTestBase {
   
@@ -35,4 +37,12 @@ public class SelectorServletTest extends
     assertNotTestServlet(
         getContent(testNodeNORT.nodeUrl + ".TEST_SEL_3.txt", CONTENT_TYPE_PLAIN));
   }
+  
+  public void testPostWithSelector() throws Exception {
+      final PostMethod post = new PostMethod(testNodeRT.nodeUrl + ".TEST_SEL_2.txt");
+      final int status = httpClient.executeMethod(post);
+      assertEquals("POST to testNodeRT should return 200", 200, status);
+      final String content = post.getResponseBodyAsString();
+      assertServlet(content, SEL_SERVLET_SUFFIX);
+  }
 }

Modified: sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/servlets/SelectorServlet.java
URL: http://svn.apache.org/viewvc/sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/servlets/SelectorServlet.java?rev=1307320&r1=1307319&r2=1307320&view=diff
==============================================================================
--- sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/servlets/SelectorServlet.java
(original)
+++ sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/servlets/SelectorServlet.java
Fri Mar 30 09:04:51 2012
@@ -28,9 +28,10 @@ import org.apache.felix.scr.annotations.
     @Property(name="service.description", value="Selector Test Servlet"),
     @Property(name="service.vendor", value="The Apache Software Foundation"),
     @Property(name="sling.servlet.resourceTypes", value="sling/servlet/default"),
+    @Property(name="sling.servlet.methods", value={"GET","POST"}),
     @Property(name="sling.servlet.selectors", value={"TEST_SEL_1","TEST_SEL_2"}),
     @Property(name="sling.servlet.extensions", value="txt")
 })
 @SuppressWarnings("serial")
 public class SelectorServlet extends TestServlet {
-}
\ No newline at end of file
+}



Mime
View raw message