incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From asa...@apache.org
Subject svn commit: r1444751 - in /sling/trunk/launchpad: builder/src/main/bundles/list.xml integration-tests/pom.xml integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/servlets/resolver/errorhandler/ErrorHandlingTest.java
Date Mon, 11 Feb 2013 12:38:55 GMT
Author: asanso
Date: Mon Feb 11 12:38:55 2013
New Revision: 1444751

URL: http://svn.apache.org/r1444751
Log:
SLING-2718 - Add integration test for the error handling mechanism. 
- adding more integration tests

Modified:
    sling/trunk/launchpad/builder/src/main/bundles/list.xml
    sling/trunk/launchpad/integration-tests/pom.xml
    sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/servlets/resolver/errorhandler/ErrorHandlingTest.java

Modified: sling/trunk/launchpad/builder/src/main/bundles/list.xml
URL: http://svn.apache.org/viewvc/sling/trunk/launchpad/builder/src/main/bundles/list.xml?rev=1444751&r1=1444750&r2=1444751&view=diff
==============================================================================
--- sling/trunk/launchpad/builder/src/main/bundles/list.xml (original)
+++ sling/trunk/launchpad/builder/src/main/bundles/list.xml Mon Feb 11 12:38:55 2013
@@ -126,7 +126,7 @@
         <bundle>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.servlets.post</artifactId>
-            <version>2.2.0</version>
+            <version>2.2.1-SNAPSHOT</version>
         </bundle>
         <bundle>
             <groupId>org.apache.sling</groupId>

Modified: sling/trunk/launchpad/integration-tests/pom.xml
URL: http://svn.apache.org/viewvc/sling/trunk/launchpad/integration-tests/pom.xml?rev=1444751&r1=1444750&r2=1444751&view=diff
==============================================================================
--- sling/trunk/launchpad/integration-tests/pom.xml (original)
+++ sling/trunk/launchpad/integration-tests/pom.xml Mon Feb 11 12:38:55 2013
@@ -143,7 +143,7 @@
     <dependency>
       <groupId>org.apache.sling</groupId>
       <artifactId>org.apache.sling.servlets.post</artifactId>
-      <version>2.2.0</version>
+      <version>2.2.1-SNAPSHOT</version>
     </dependency>
     <dependency>
       <groupId>org.apache.sling</groupId>

Modified: sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/servlets/resolver/errorhandler/ErrorHandlingTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/servlets/resolver/errorhandler/ErrorHandlingTest.java?rev=1444751&r1=1444750&r2=1444751&view=diff
==============================================================================
--- sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/servlets/resolver/errorhandler/ErrorHandlingTest.java
(original)
+++ sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/servlets/resolver/errorhandler/ErrorHandlingTest.java
Mon Feb 11 12:38:55 2013
@@ -17,9 +17,14 @@
 package org.apache.sling.launchpad.webapp.integrationtest.servlets.resolver.errorhandler;
 
 import java.io.IOException;
+import java.util.ArrayList;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
+
+import org.apache.commons.httpclient.NameValuePair;
 import org.apache.sling.launchpad.webapp.integrationtest.JspTestBase;
+import org.apache.sling.servlets.post.SlingPostConstants;
 
 
 /** Test the sling error handling mechanism http://sling.apache.org/site/errorhandling.html*/
@@ -54,8 +59,7 @@ public class ErrorHandlingTest extends J
 		uploadTestScript("servlets/errorhandler/500.jsp", "sling/servlet/errorhandler/500.jsp");
 		uploadTestScript("servlets/errorhandler/401.jsp", "sling/servlet/errorhandler/401.jsp");
 		uploadTestScript(THROW_ERROR_PATH+"/"+THROW_ERROR_PAGE, THROW_ERROR_PATH+"/"+THROW_ERROR_PAGE);
-		uploadTestScript(THROW_ERROR_PATH+"/"+"POST.jsp", THROW_ERROR_PATH+"/"+"POST.jsp");
-
+ 
 		final Map<String, String> props = new HashMap<String, String>();
 		props.put(SLING_RESOURCE_TYPE, TEST_ROOT+"/"+THROW_ERROR_PATH);
 		testNodePath = testClient.createNode(HTTP_BASE_URL + TEST_ROOT, props);
@@ -96,9 +100,19 @@ public class ErrorHandlingTest extends J
 	
 	public void test_500_errorhandling_POST_operation() throws IOException{	
 		final String expected = "Internal Server Error (500) - custom error page";
-		final String url =  testNodePath +SELECTOR_500+".html"; 
+		final String url =  testNodePath +".html"; 
+		uploadTestScript(THROW_ERROR_PATH+"/"+"POST.jsp", THROW_ERROR_PATH+"/"+"POST.jsp");
 		assertContains(getContent(url, CONTENT_TYPE_HTML,null,500,HTTP_METHOD_POST), expected);
 		//assertNotContains(getContent(url, CONTENT_TYPE_HTML,null,200), "All good");
  	}
+	
+	public void test_errorhandling_POST_operation_SlingPostServlet() throws IOException{
+		final String expected = "Exception thrown - custom error page";
+		final String url =  testNodePath +".html";
+		List <NameValuePair> params=new ArrayList<NameValuePair>();
+        params.add(new NameValuePair(SlingPostConstants.RP_OPERATION,"notExistingOperation"));
+        params.add(new NameValuePair(SlingPostConstants.RP_SEND_ERROR,"true"));        
+        assertContains(getContent(url, CONTENT_TYPE_HTML,params,500,HTTP_METHOD_POST), expected);
+	}
 
 }



Mime
View raw message