Author: fmeschbe Date: Mon Jan 26 12:27:14 2009 New Revision: 737680 URL: http://svn.apache.org/viewvc?rev=737680&view=rev Log: SLING-703 Integration tests for sling:forward and sling:include
Added: incubator/sling/trunk/launchpad/testing/src/test/java/org/apache/sling/launchpad/webapp/integrationtest/JspForwardTest.java (with props) incubator/sling/trunk/launchpad/testing/src/test/java/org/apache/sling/launchpad/webapp/integrationtest/JspIncludeTest.java (with props) incubator/sling/trunk/launchpad/testing/src/test/resources/integration-test/forward-forced.jsp (with props) incubator/sling/trunk/launchpad/testing/src/test/resources/integration-test/forward-test.jsp (with props) incubator/sling/trunk/launchpad/testing/src/test/resources/integration-test/include-forced.jsp (with props) incubator/sling/trunk/launchpad/testing/src/test/resources/integration-test/include-test.jsp (with props) Added: incubator/sling/trunk/launchpad/testing/src/test/java/org/apache/sling/launchpad/webapp/integrationtest/JspForwardTest.java URL: http://svn.apache.org/viewvc/incubator/sling/trunk/launchpad/testing/src/test/java/org/apache/sling/launchpad/webapp/integrationtest/JspForwardTest.java?rev=737680&view=auto ============================================================================== --- incubator/sling/trunk/launchpad/testing/src/test/java/org/apache/sling/launchpad/webapp/integrationtest/JspForwardTest.java (added) +++ incubator/sling/trunk/launchpad/testing/src/test/java/org/apache/sling/launchpad/webapp/integrationtest/JspForwardTest.java Mon Jan 26 12:27:14 2009 @@ -0,0 +1,143 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.sling.launchpad.webapp.integrationtest; + +import java.io.IOException; +import java.net.URL; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; + +import org.apache.commons.httpclient.methods.GetMethod; +import org.apache.sling.commons.testing.integration.HttpTestBase; +import org.apache.sling.servlets.post.SlingPostConstants; + + +/** Test the {link ScriptHelper#forward) functionality */ + public class JspForwardTest extends HttpTestBase { + + private String nodeUrlA; + private String testTextA; + private String nodeUrlB; + private String testTextB; + private String nodeUrlC; + private String nodeUrlD; + private String nodeUrlE; + private String scriptPath; + private String forcedResourceType; + private Set<String> toDelete = new HashSet<String>(); + + @Override + protected void setUp() throws Exception { + super.setUp(); + + // Create the test nodes under a path that's specific to this class to + // allow collisions + final String url = HTTP_BASE_URL + "/" + getClass().getSimpleName() + "/" + System.currentTimeMillis() + SlingPostConstants.DEFAULT_CREATE_SUFFIX; + final Map<String,String> props = new HashMap<String,String>(); + + // Create two test nodes and store their paths + testTextA = "Text A " + System.currentTimeMillis(); + props.put("text", testTextA); + nodeUrlA = testClient.createNode(url, props); + + // Node B stores the path of A, so that the test script can + // forward A when rendering B + testTextB = "Text B " + System.currentTimeMillis(); + props.put("text", testTextB); + props.put("pathToInclude", new URL(nodeUrlA).getPath()); + nodeUrlB = testClient.createNode(url, props); + + // Node E is like B but with an extension on the forward path + props.put("pathToInclude", new URL(nodeUrlA).getPath() + ".html"); + nodeUrlE = testClient.createNode(url, props); + + // Node C is used for the infinite loop detection test + props.remove("pathToInclude"); + props.put("testInfiniteLoop","true"); + nodeUrlC = testClient.createNode(url, props); + + // Node D is used for the "force resource type" test + forcedResourceType = getClass().getSimpleName() + "/" + System.currentTimeMillis(); + props.remove("testInfiniteLoop"); + props.put("forceResourceType", forcedResourceType); + props.put("pathToInclude", new URL(nodeUrlA).getPath()); + nodeUrlD = testClient.createNode(url, props); + + // Script for forced resource type + scriptPath = "/apps/" + forcedResourceType; + testClient.mkdirs(WEBDAV_BASE_URL, scriptPath); + toDelete.add(uploadTestScript(scriptPath,"forward-forced.jsp","html.jsp")); + + // The main rendering script goes under /apps in the repository + scriptPath = "/apps/nt/unstructured"; + testClient.mkdirs(WEBDAV_BASE_URL, scriptPath); + toDelete.add(uploadTestScript(scriptPath,"forward-test.jsp","html.jsp")); + } + + @Override + protected void tearDown() throws Exception { + super.tearDown(); + for(String script : toDelete) { + testClient.delete(script); + } + } + + public void testWithoutForward() throws IOException { + final String content = getContent(nodeUrlA + ".html", CONTENT_TYPE_HTML); + assertTrue("Content includes JSP marker",content.contains("JSP template")); + assertTrue("Content contains formatted test text",content.contains("<p class=\"main\">" + testTextA + "</p>")); + } + + public void testWithForward() throws IOException { + final String content = getContent(nodeUrlB + ".html", CONTENT_TYPE_HTML); + assertTrue("Content includes JSP marker",content.contains("JSP template")); + assertTrue("Content contains formatted test text",content.contains("<p class=\"main\">" + testTextA + "</p>")); + assertTrue("Text of node A is not included (" + content + ")",!content.contains(testTextB)); + } + + public void testWithForwardAndExtension() throws IOException { + final String content = getContent(nodeUrlE + ".html", CONTENT_TYPE_HTML); + assertTrue("Content includes JSP marker",content.contains("JSP template")); + assertTrue("Content contains formatted test text",content.contains("<p class=\"main\">" + testTextA + "</p>")); + assertTrue("Text of node A is not included (" + content + ")",!content.contains(testTextB)); + } + + public void testInfiniteLoopDetection() throws IOException { + // Node C has a property that causes an infinite include loop, + // Sling must indicate the problem in its response + final GetMethod get = new GetMethod(nodeUrlC + ".html"); + httpClient.executeMethod(get); + final String content = get.getResponseBodyAsString(); + assertTrue("Response contains infinite loop error message", + content.contains("InfiniteIncludeLoopException")); + + // TODO: SLING-515, status is 500 when running the tests as part of the maven build + // but 200 if running tests against a separate instance started with mvn jetty:run + // final int status = get.getStatusCode(); + // assertEquals("Status is 500 for infinite loop",HttpServletResponse.SC_INTERNAL_SERVER_ERROR, status); + } + + public void testForcedResourceType() throws IOException { + final String content = getContent(nodeUrlD + ".html", CONTENT_TYPE_HTML); + assertTrue("Content includes JSP marker",content.contains("JSP template")); + assertTrue("Content contains formatted test text",content.contains("<p class=\"main\">" + testTextA + "</p>")); + assertTrue("Text of node A is included (" + content + ")",!content.contains(testTextB)); + assertTrue("Resource type has been forced (" + content + ")",content.contains("Forced resource type:" + forcedResourceType)); + } +} Propchange: incubator/sling/trunk/launchpad/testing/src/test/java/org/apache/sling/launchpad/webapp/integrationtest/JspForwardTest.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: incubator/sling/trunk/launchpad/testing/src/test/java/org/apache/sling/launchpad/webapp/integrationtest/JspForwardTest.java ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Rev Url Added: incubator/sling/trunk/launchpad/testing/src/test/java/org/apache/sling/launchpad/webapp/integrationtest/JspIncludeTest.java URL: http://svn.apache.org/viewvc/incubator/sling/trunk/launchpad/testing/src/test/java/org/apache/sling/launchpad/webapp/integrationtest/JspIncludeTest.java?rev=737680&view=auto ============================================================================== --- incubator/sling/trunk/launchpad/testing/src/test/java/org/apache/sling/launchpad/webapp/integrationtest/JspIncludeTest.java (added) +++ incubator/sling/trunk/launchpad/testing/src/test/java/org/apache/sling/launchpad/webapp/integrationtest/JspIncludeTest.java Mon Jan 26 12:27:14 2009 @@ -0,0 +1,147 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.sling.launchpad.webapp.integrationtest; + +import java.io.IOException; +import java.net.URL; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; + +import org.apache.commons.httpclient.methods.GetMethod; +import org.apache.sling.commons.testing.integration.HttpTestBase; +import org.apache.sling.servlets.post.SlingPostConstants; + + +/** Test the {link ScriptHelper#include) functionality */ + public class JspIncludeTest extends HttpTestBase { + + private String nodeUrlA; + private String testTextA; + private String nodeUrlB; + private String testTextB; + private String nodeUrlC; + private String nodeUrlD; + private String nodeUrlE; + private String scriptPath; + private String forcedResourceType; + private Set<String> toDelete = new HashSet<String>(); + + @Override + protected void setUp() throws Exception { + super.setUp(); + + // Create the test nodes under a path that's specific to this class to + // allow collisions + final String url = HTTP_BASE_URL + "/" + getClass().getSimpleName() + "/" + System.currentTimeMillis() + SlingPostConstants.DEFAULT_CREATE_SUFFIX; + final Map<String,String> props = new HashMap<String,String>(); + + // Create two test nodes and store their paths + testTextA = "Text A " + System.currentTimeMillis(); + props.put("text", testTextA); + nodeUrlA = testClient.createNode(url, props); + + // Node B stores the path of A, so that the test script can + // include A when rendering B + testTextB = "Text B " + System.currentTimeMillis(); + props.put("text", testTextB); + props.put("pathToInclude", new URL(nodeUrlA).getPath()); + nodeUrlB = testClient.createNode(url, props); + + // Node E is like B but with an extension on the include path + props.put("pathToInclude", new URL(nodeUrlA).getPath() + ".html"); + nodeUrlE = testClient.createNode(url, props); + + // Node C is used for the infinite loop detection test + props.remove("pathToInclude"); + props.put("testInfiniteLoop","true"); + nodeUrlC = testClient.createNode(url, props); + + // Node D is used for the "force resource type" test + forcedResourceType = getClass().getSimpleName() + "/" + System.currentTimeMillis(); + props.remove("testInfiniteLoop"); + props.put("forceResourceType", forcedResourceType); + props.put("pathToInclude", new URL(nodeUrlA).getPath()); + nodeUrlD = testClient.createNode(url, props); + + // Script for forced resource type + scriptPath = "/apps/" + forcedResourceType; + testClient.mkdirs(WEBDAV_BASE_URL, scriptPath); + toDelete.add(uploadTestScript(scriptPath,"include-forced.jsp","html.jsp")); + + // The main rendering script goes under /apps in the repository + scriptPath = "/apps/nt/unstructured"; + testClient.mkdirs(WEBDAV_BASE_URL, scriptPath); + toDelete.add(uploadTestScript(scriptPath,"include-test.jsp","html.jsp")); + } + + @Override + protected void tearDown() throws Exception { + super.tearDown(); + for(String script : toDelete) { + testClient.delete(script); + } + } + + public void testWithoutInclude() throws IOException { + final String content = getContent(nodeUrlA + ".html", CONTENT_TYPE_HTML); + assertTrue("Content includes JSP marker",content.contains("JSP template")); + assertTrue("Content contains formatted test text",content.contains("<p class=\"main\">" + testTextA + "</p>")); + assertFalse("Nothing has been included",content.contains("<p>Including")); + } + + public void testWithInclude() throws IOException { + final String content = getContent(nodeUrlB + ".html", CONTENT_TYPE_HTML); + assertTrue("Content includes JSP marker",content.contains("JSP template")); + assertTrue("Content contains formatted test text",content.contains("<p class=\"main\">" + testTextB + "</p>")); + assertTrue("Include has been used",content.contains("<p>Including")); + assertTrue("Text of node A is included (" + content + ")",content.contains(testTextA)); + } + + public void testWithIncludeAndExtension() throws IOException { + final String content = getContent(nodeUrlE + ".html", CONTENT_TYPE_HTML); + assertTrue("Content includes JSP marker",content.contains("JSP template")); + assertTrue("Content contains formatted test text",content.contains("<p class=\"main\">" + testTextB + "</p>")); + assertTrue("Include has been used",content.contains("<p>Including")); + assertTrue("Text of node A is included (" + content + ")",content.contains(testTextA)); + } + + public void testInfiniteLoopDetection() throws IOException { + // Node C has a property that causes an infinite include loop, + // Sling must indicate the problem in its response + final GetMethod get = new GetMethod(nodeUrlC + ".html"); + httpClient.executeMethod(get); + final String content = get.getResponseBodyAsString(); + assertTrue("Response contains infinite loop error message", + content.contains("InfiniteIncludeLoopException")); + + // TODO: SLING-515, status is 500 when running the tests as part of the maven build + // but 200 if running tests against a separate instance started with mvn jetty:run + // final int status = get.getStatusCode(); + // assertEquals("Status is 500 for infinite loop",HttpServletResponse.SC_INTERNAL_SERVER_ERROR, status); + } + + public void testForcedResourceType() throws IOException { + final String content = getContent(nodeUrlD + ".html", CONTENT_TYPE_HTML); + assertTrue("Content includes JSP marker",content.contains("JSP template")); + assertTrue("Content contains formatted test text",content.contains("<p class=\"main\">" + testTextB + "</p>")); + assertTrue("Include has been used",content.contains("<p>Including")); + assertTrue("Text of node A is included (" + content + ")",content.contains(testTextA)); + assertTrue("Resource type has been forced (" + content + ")",content.contains("Forced resource type:" + forcedResourceType)); + } +} Propchange: incubator/sling/trunk/launchpad/testing/src/test/java/org/apache/sling/launchpad/webapp/integrationtest/JspIncludeTest.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: incubator/sling/trunk/launchpad/testing/src/test/java/org/apache/sling/launchpad/webapp/integrationtest/JspIncludeTest.java ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Rev Url Added: incubator/sling/trunk/launchpad/testing/src/test/resources/integration-test/forward-forced.jsp URL: http://svn.apache.org/viewvc/incubator/sling/trunk/launchpad/testing/src/test/resources/integration-test/forward-forced.jsp?rev=737680&view=auto ============================================================================== --- incubator/sling/trunk/launchpad/testing/src/test/resources/integration-test/forward-forced.jsp (added) +++ incubator/sling/trunk/launchpad/testing/src/test/resources/integration-test/forward-forced.jsp Mon Jan 26 12:27:14 2009 @@ -0,0 +1,31 @@ +<%-- +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. +--%><%...@page session="false"%><% +%><%...@taglib prefix="sling" uri="http://sling.apache.org/taglibs/sling/1.0"%><% +%><sling:defineObjects/><% +// used by ForwardTest +%><html> + <body> + <h1>JSP template</h1> + <p class="main"><%= currentNode.getProperty("text").getString() %></p> + <div> + Forced resource type:<%= resource.getResourceType() %></p>. + </div> + </body> +</html> \ No newline at end of file Propchange: incubator/sling/trunk/launchpad/testing/src/test/resources/integration-test/forward-forced.jsp ------------------------------------------------------------------------------ svn:eol-style = native Propchange: incubator/sling/trunk/launchpad/testing/src/test/resources/integration-test/forward-forced.jsp ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Rev Url Added: incubator/sling/trunk/launchpad/testing/src/test/resources/integration-test/forward-test.jsp URL: http://svn.apache.org/viewvc/incubator/sling/trunk/launchpad/testing/src/test/resources/integration-test/forward-test.jsp?rev=737680&view=auto ============================================================================== --- incubator/sling/trunk/launchpad/testing/src/test/resources/integration-test/forward-test.jsp (added) +++ incubator/sling/trunk/launchpad/testing/src/test/resources/integration-test/forward-test.jsp Mon Jan 26 12:27:14 2009 @@ -0,0 +1,76 @@ +<%-- +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. +--%><%...@page session="false"%><% +%><%...@taglib prefix="sling" uri="http://sling.apache.org/taglibs/sling/1.0"%><% +%><sling:defineObjects/><% + +// used by JspForwardTest +%><%! + +private String getProperty(javax.jcr.Node node, String propertyName) { + try { + if (node.hasProperty(propertyName)) { + return node.getProperty(propertyName).getString(); + } + } catch (Throwable t) { + // don't care + } + return null; +} + +%><% + +String pathToInclude = getProperty(currentNode, "pathToInclude"); +String forceResourceType = getProperty(currentNode, "forceResourceType"); +String testInfiniteLoop = getProperty(currentNode, "testInfiniteLoop"); + +// Test 3: Forced Resource Type +if(pathToInclude != null && forceResourceType != null) { + %><sling:forward path="<%= pathToInclude %>" resourceType="<%= forceResourceType %>"/><% +} + +else + +// Test 1: Simple Forward +if(pathToInclude != null) { + %><sling:forward path="<%= pathToInclude %>"/><% +} + +else + +// Test 2: Infinite Loop +if(testInfiniteLoop != null) { + // try to include the item itself, to cause an infinite loop + %><sling:forward path="<%= resource.getPath() %>"/><% +} + +else + +{ + +// Test 0: No Forward +%><html> + <body> + <h1>JSP template</h1> + <p class="main"><%= currentNode.getProperty("text").getString() %></p> + </body> +</html><% + +} +%> \ No newline at end of file Propchange: incubator/sling/trunk/launchpad/testing/src/test/resources/integration-test/forward-test.jsp ------------------------------------------------------------------------------ svn:eol-style = native Propchange: incubator/sling/trunk/launchpad/testing/src/test/resources/integration-test/forward-test.jsp ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Rev Url Added: incubator/sling/trunk/launchpad/testing/src/test/resources/integration-test/include-forced.jsp URL: http://svn.apache.org/viewvc/incubator/sling/trunk/launchpad/testing/src/test/resources/integration-test/include-forced.jsp?rev=737680&view=auto ============================================================================== --- incubator/sling/trunk/launchpad/testing/src/test/resources/integration-test/include-forced.jsp (added) +++ incubator/sling/trunk/launchpad/testing/src/test/resources/integration-test/include-forced.jsp Mon Jan 26 12:27:14 2009 @@ -0,0 +1,26 @@ +<%-- +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +--%><%...@page session="false"%><% +%><%...@taglib prefix="sling" uri="http://sling.apache.org/taglibs/sling/1.0"%><% +%><sling:defineObjects/><% +// used by ForwardTest +%><div> + Forced resource type:<%= resource.getResourceType() %></p>. +</div> Propchange: incubator/sling/trunk/launchpad/testing/src/test/resources/integration-test/include-forced.jsp ------------------------------------------------------------------------------ svn:eol-style = native Propchange: incubator/sling/trunk/launchpad/testing/src/test/resources/integration-test/include-forced.jsp ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Rev Url Added: incubator/sling/trunk/launchpad/testing/src/test/resources/integration-test/include-test.jsp URL: http://svn.apache.org/viewvc/incubator/sling/trunk/launchpad/testing/src/test/resources/integration-test/include-test.jsp?rev=737680&view=auto ============================================================================== --- incubator/sling/trunk/launchpad/testing/src/test/resources/integration-test/include-test.jsp (added) +++ incubator/sling/trunk/launchpad/testing/src/test/resources/integration-test/include-test.jsp Mon Jan 26 12:27:14 2009 @@ -0,0 +1,84 @@ +<%-- +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. +--%><%...@page session="false"%><% +%><%...@taglib prefix="sling" uri="http://sling.apache.org/taglibs/sling/1.0"%><% +%><sling:defineObjects/><% + +// used by IncludeTest +%><%! + +private String getProperty(javax.jcr.Node node, String propertyName) { + try { + if (node.hasProperty(propertyName)) { + return node.getProperty(propertyName).getString(); + } + } catch (Throwable t) { + // don't care + } + return null; +} + +%><% + +String text = getProperty(currentNode, "text"); +String pathToInclude = getProperty(currentNode, "pathToInclude"); +String forceResourceType = getProperty(currentNode, "forceResourceType"); +String testInfiniteLoop = getProperty(currentNode, "testInfiniteLoop"); + +%><html> + <body> + <h1>JSP template</h1> + <p class="main"><%= text %></p> + + <h2>Test 1</h2> + <% + if(pathToInclude != null) { + %> + <p>pathToInclude = <%= pathToInclude %></p> + <p>Including <%= pathToInclude %></p> + <sling:include path="<%= pathToInclude %>"/> + <% + } + %> + + <h2>Test 2</h2> + <% + if(testInfiniteLoop != null) { + %> + <p>testInfiniteLoop = <%= testInfiniteLoop %></p> + <% + // try to include the item itself, to cause an infinite loop + %> + <sling:include path="<%= resource.getPath() %>"/> + <% + } + %> + + <h2>Test 3</h2> + <% + if(pathToInclude != null && forceResourceType != null) { + %> + <p>pathToInclude = <%= pathToInclude %></p> + <p>Including <%= pathToInclude %></p> + <sling:include path="<%= pathToInclude %>" resourceType="<%= forceResourceType %>"/> + <% + } + %> + </body> +</html> Propchange: incubator/sling/trunk/launchpad/testing/src/test/resources/integration-test/include-test.jsp ------------------------------------------------------------------------------ svn:eol-style = native Propchange: incubator/sling/trunk/launchpad/testing/src/test/resources/integration-test/include-test.jsp ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Rev Url