[ 
https://issues.apache.org/jira/browse/SLING-475?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12611002#action_12611002
 ] 

Bertrand Delacretaz commented on SLING-475:
-------------------------------------------

Adding some info to this for Janandith, our GSoC student, who will work on this 
as we're somewhat stuck with the scala stuff.

The goal is to add (at least) one java class and one jsp test file to the 
launchpad/webapp tests, to verify that the sling:include JSP tag works 
correctly. Just testing the "resource" attribute of the sling:include tag is a 
good start, and then we'll need to test the other options of that tag.

The rendering-test.jsp [1] can be used as an example of a jsp script that runs 
during the integration tests of the launchpad webapp. It is run by the 
org.apache.sling.launchpad.webapp.integrationtest.JspScriptingTest, a similar 
class will need to be created, suggest naming it JspIncludeTagTest.

The sling:include JSP tag is implemented by the IncludeTagHandler class [3], 
its goal is to include the output of a Sling request in the output that's being 
generated by a JSP script.

The basic syntax for this include tag is <sling:include 
resource="/full/path/to/resource"/>, and the IncludeTagHandler source code 
indicates which other options can be used (the "public set..." methods).

Here's how to run a single of our integration tests (see "integration test" 
README [2] for details), example for the JspScriptingTest:

1) Start the launchpad with mvn jetty:run
2) In a second terminal, run the test:
   mvn -o test -Dtest=JspScriptingTest

This avoids the Cargo and Sling setup times, makes it much more convenient to 
run a single integration test for debugging - and the first Sling instance can 
be started with remote debugging active, so as to connect to it from an IDE 
debugger if needed.

To build the launchpad webapp, see [4] - once you have the right maven 
settings, running "mvn clean install" in the launchpad/webapp folder should be 
sufficient.

[1] 
http://svn.apache.org/repos/asf/incubator/sling/trunk/launchpad/webapp/src/test/resources/integration-test/rendering-test.jsp
[2] 
http://svn.apache.org/repos/asf/incubator/sling/trunk/launchpad/webapp/README.txt
[3] 
https://svn.eu.apache.org/repos/asf/incubator/sling/trunk/scripting/jsp-taglib/src/main/java/org/apache/sling/scripting/jsp/taglib/IncludeTagHandler.java
[4] http://incubator.apache.org/sling/site/getting-and-building-sling.html

> Create Integration tests for the sling:include tag
> --------------------------------------------------
>
>                 Key: SLING-475
>                 URL: https://issues.apache.org/jira/browse/SLING-475
>             Project: Sling
>          Issue Type: Sub-task
>          Components: Scripting JSP
>            Reporter: Felix Meschberger
>
> Summary says it all ;-)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to