You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by bd...@apache.org on 2008/01/28 15:10:33 UTC

svn commit: r615884 - /incubator/sling/trunk/launchpad/launchpad-webapp/src/test/java/org/apache/sling/launchpad/webapp/integrationtest/IncludeTest.java

Author: bdelacretaz
Date: Mon Jan 28 06:10:33 2008
New Revision: 615884

URL: http://svn.apache.org/viewvc?rev=615884&view=rev
Log:
SLING-149 - IncludeTest.testInfiniteLoopDetection test enabled, but still partially fails due to SLING-207

Modified:
    incubator/sling/trunk/launchpad/launchpad-webapp/src/test/java/org/apache/sling/launchpad/webapp/integrationtest/IncludeTest.java

Modified: incubator/sling/trunk/launchpad/launchpad-webapp/src/test/java/org/apache/sling/launchpad/webapp/integrationtest/IncludeTest.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/launchpad/launchpad-webapp/src/test/java/org/apache/sling/launchpad/webapp/integrationtest/IncludeTest.java?rev=615884&r1=615883&r2=615884&view=diff
==============================================================================
--- incubator/sling/trunk/launchpad/launchpad-webapp/src/test/java/org/apache/sling/launchpad/webapp/integrationtest/IncludeTest.java (original)
+++ incubator/sling/trunk/launchpad/launchpad-webapp/src/test/java/org/apache/sling/launchpad/webapp/integrationtest/IncludeTest.java Mon Jan 28 06:10:33 2008
@@ -16,6 +16,7 @@
  */
 package org.apache.sling.launchpad.webapp.integrationtest;
 
+import org.apache.commons.httpclient.methods.GetMethod;
 import org.apache.sling.ujax.UjaxPostServlet;
 
 import java.io.IOException;
@@ -88,10 +89,16 @@
         assertTrue("Include has been used",content.contains("<p>Including"));
     }
     
-    public void TODO_FAILS_testInfiniteLoopDetection() throws IOException {
+    public void testInfiniteLoopDetection() throws IOException {
         // Node C has a property that causes an infinite include loop,
-        // microsling must return an error 500 in this case
-        assertHttpStatus(nodeUrlC + ".html", HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+        // Sling must return an error 500 in this case
+        final GetMethod get = new GetMethod(nodeUrlC + ".html");
+        final int status = httpClient.executeMethod(get);
+        final String content = get.getResponseBodyAsString();
+        assertTrue("Response contains infinite loop error message",
+                content.contains("InfiniteIncludeLoopException"));
+        
+        // TODO_FAILS_ see SLING-207
+        // assertEquals("Status is 500 for infinite loop",HttpServletResponse.SC_INTERNAL_SERVER_ERROR,status);
     }
-
 }