vmassol 2003/07/13 09:25:29 Modified: documentation/docs/xdocs/integration navigation.xml index.xml documentation/docs/xdocs sitemap.xml Added: documentation/docs/xdocs/integration integration_browser.xml Log: Created a separate page for browser integration Revision Changes Path 1.6 +1 -0 jakarta-cactus/documentation/docs/xdocs/integration/navigation.xml Index: navigation.xml =================================================================== RCS file: /home/cvs/jakarta-cactus/documentation/docs/xdocs/integration/navigation.xml,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- navigation.xml 13 Jul 2003 16:11:20 -0000 1.5 +++ navigation.xml 13 Jul 2003 16:25:29 -0000 1.6 @@ -17,6 +17,7 @@ <item id="integration_ant" label="Ant"/> <item id="integration_eclipse" label="Eclipse"/> <item id="integration_jetty" label="Jetty"/> + <item id="integration_browser" label="Browser"/> <item id="maven_cactus" label="Maven"/> <item id="howto_ide" label="Various IDEs"/> <item id="howto_junitee" label="JUnitEE"/> 1.4 +6 -197 jakarta-cactus/documentation/docs/xdocs/integration/index.xml Index: index.xml =================================================================== RCS file: /home/cvs/jakarta-cactus/documentation/docs/xdocs/integration/index.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- index.xml 13 Jul 2003 09:22:17 -0000 1.3 +++ index.xml 13 Jul 2003 16:25:29 -0000 1.4 @@ -19,7 +19,7 @@ </p> <ul> <li> - <jump anchor="from_ant">From Ant</jump>, by using the + <link href="site:integration_ant">From Ant</link>, by using the <code><cactifywar></code> and <code><cactus></code> custom Ant tasks. </li> @@ -28,27 +28,18 @@ calling the <code>main()</code> method of a JUnit Test Runner. </li> <li> - <jump anchor="from_ide">From an IDE</jump> or any tool providing a - JUnit integration plugin. + <link href="site:howto_ide">From an IDE</link> or any tool + providing a JUnit integration plugin. </li> <li> - <jump anchor="from_browser">From a browser</jump>, by using the - Cactus Servlet Test Runner, which is a special JUnit Test Runner. + <link href="site:integration_browser">From a browser</link>, by + using the Cactus Servlet Test Runner, which is a special JUnit + Test Runner. </li> </ul> </section> - <anchor id="from_ant"/> - <section title="Running Cactus tests from Ant"> - - <p> - Refer to the documentation about the Cactus - <link href="site:integration_ant">Ant Integration</link>. - </p> - - </section> - <anchor id="from_command_line"/> <section title="Running Cactus tests from the command line"> @@ -61,188 +52,6 @@ <p> <code>junit.swingui.TestRunner.main [test case class]</code> </p> - - </section> - - <anchor id="from_ide"/> - <section title="Running Cactus tests from an IDE"> - - <p> - Refer to the <link href="site:howto_ide">IDE Howto</link>. - </p> - - </section> - - <anchor id="from_browser"/> - <section title="Running Cactus tests from a browser"> - - <note> - This section only applies for Cactus 1.4 and greater. - </note> - - <section title="Step 1: Setting up the classpath"> - - <p> - In order to run Cactus tests from a browser you need to have a webapp - containing your classes to test and your test classes. In addition, - both Cactus client side and server side jar classes must be able to be - loaded from your webapp (i.e located in your <code>WEB-INF/lib</code> - directory or in a location available through your container Context - class loader (refer to your container documentation). - </p> - - <note> - Refer to the <link href="site:howto_classpath">Classpath Howto</link> - guide for the exact list of jars. - </note> - - </section> - - <section title="Step 2: Mapping the Cactus Servlet Test Runner"> - - <p> - Then, in addition to the Cactus redirectors that you have mapped in - your <code>web.xml</code> (see the - <link href="site:howto_config">Configuration howto</link>), you also - need to map the Cactus Servlet Test Runner, as follows: - </p> - -<source><![CDATA[ -[...] -<servlet> - <servlet-name>ServletTestRunner</servlet-name> - <servlet-class> - org.apache.cactus.server.runner.ServletTestRunner - </servlet-class> -</servlet> -[...] -<servlet-mapping> - <servlet-name>ServletTestRunner</servlet-name> - <url-pattern>/ServletTestRunner</url-pattern> -</servlet-mapping> -[...] -]]></source> - - </section> - - <section title="Step 3: Executing the tests"> - - <p> - Open a browser and type <code>http://server:port/mywebapp/ServletTestRunner?suite=mytestcase</code> - where: - </p> - <ul> - <li> - <code>server:port</code> is the name of your server machine and - port on which your container is running - </li> - <li> - <code>mywebapp</code> is the name of your webapp (usually the name - of your war file) - </li> - <li> - <code>mytestcase</code> is the fully qualified name (i.e. with - packages) of your <code>TestCase</code> class containing a - <code>suite()</code> method listing all the tests, in standard - JUnit fashion. - </li> - </ul> - - <p> - Here is an example of what you will get: - </p> - - <figure src="images/servlettestrunner_xml.jpg" alt="XML output of ServletTestRunner"/> - - <note> - If you see a blank page, click on the View source option of your - browser. It means your browser doesn't know how to display XML data. - </note> - - <p> - Ok, that's nice ... But what if I want HTML instead of XML? Don't - worry there is a solution. Grab the following - <link href="site:cactus_report_xsl">XSLT stylesheet</link> - (based on the stylesheet used by the - <strong><junitreport></strong> Ant task), drop it in your - webapp and name it <code>cactus-report.xsl</code> (in the root - directory for example). Then, open a browser and type - <code>http://server:port/mywebapp/ServletTestRunner?suite=mytestcase&xsl=cactus-report.xsl</code>. - You should see the following: - </p> - - <figure src="images/servlettestrunner_html.jpg" alt="HTML output of ServletTestRunner"/> - - <note> - This will work with Internet Explorer as the XSL transformation is - performed on the client side (i.e by the browser). I'm not sure - about other browsers. - </note> - - </section> - - <section title="Enabling Server-Side XSLT Transformations"> - - <p> - In the previous section, the XSLT transformation was performed on the - client. This requires a browser capable of doing XSLT transformations - in a standards-compliant manner, and requires adding the location of - the stylesheet as a request parameter. - </p> - - <p> - Since Cactus 1.5, the ServletTestRunner can also perform the - transformation on the server-side. To enable that feature, make sure - that a JAXP compliant XSLT processor (such as - <link href="ext:xalanj">Xalan</link>) is available to the - web-application. - </p> - - <p> - In addition, the location of the XSLT stylesheet needs to specified as - initialization parameter of the ServletTestRunner. For example: - </p> - - <source><![CDATA[ -[...] -<servlet> - <servlet-name>ServletTestRunner</servlet-name> - <servlet-class> - org.apache.cactus.server.runner.ServletTestRunner - </servlet-class> - <init-param> - <param-name>xsl-stylesheet</param-name> - <param-value>styles/cactus-report.xsl</param-value> - </init-param> -</servlet> -[...] -]]></source> - - <p> - The specified path is relative to the root of the web-application. Of - course, the stylesheet needs to exist at that location. In contrast to - client-side transformations, the stylesheet may be placed somewhere - inside the <code>WEB-INF</code> directory, because clients do not need - to access it directly. - </p> - - <p> - If all of the above is correctly set up, you can enable the actual - transformation by including a <code>transform</code> parameter with - the request (the value of the parameter does not matter). For example - </p> - - <source><![CDATA[ -http://server:port/mywebapp/ServletTestRunner?suite=mytestcase&transform=yes -]]></source> - - <note> - The stylesheet specified as initialization parameter is loaded when - the ServletTestRunner gets initialized. Changes to the stylesheet will - not get picked up until the web-application is reloaded. - </note> - - </section> </section> 1.1 jakarta-cactus/documentation/docs/xdocs/integration/integration_browser.xml Index: integration_browser.xml =================================================================== <?xml version="1.0"?> <document id="integration_browser"> <properties> <title>Running Cactus tests from a browser</title> <authors> <author name="Vincent Massol" email="[EMAIL PROTECTED]"/> </authors> </properties> <body> <section title="Running Cactus tests from a browser"> <note> This section only applies for Cactus 1.4 and greater. </note> <section title="Step 1: Setting up the classpath"> <p> In order to run Cactus tests from a browser you need to have a webapp containing your classes to test and your test classes. In addition, both Cactus client side and server side jar classes must be able to be loaded from your webapp (i.e located in your <code>WEB-INF/lib</code> directory or in a location available through your container Context class loader (refer to your container documentation). </p> <note> Refer to the <link href="site:howto_classpath">Classpath Howto</link> guide for the exact list of jars. </note> </section> <section title="Step 2: Mapping the Cactus Servlet Test Runner"> <p> Then, in addition to the Cactus redirectors that you have mapped in your <code>web.xml</code> (see the <link href="site:howto_config">Configuration howto</link>), you also need to map the Cactus Servlet Test Runner, as follows: </p> <source><![CDATA[ [...] <servlet> <servlet-name>ServletTestRunner</servlet-name> <servlet-class> org.apache.cactus.server.runner.ServletTestRunner </servlet-class> </servlet> [...] <servlet-mapping> <servlet-name>ServletTestRunner</servlet-name> <url-pattern>/ServletTestRunner</url-pattern> </servlet-mapping> [...] ]]></source> </section> <section title="Step 3: Executing the tests"> <p> Open a browser and type <code>http://server:port/mywebapp/ServletTestRunner?suite=mytestcase</code> where: </p> <ul> <li> <code>server:port</code> is the name of your server machine and port on which your container is running </li> <li> <code>mywebapp</code> is the name of your webapp (usually the name of your war file) </li> <li> <code>mytestcase</code> is the fully qualified name (i.e. with packages) of your <code>TestCase</code> class containing a <code>suite()</code> method listing all the tests, in standard JUnit fashion. </li> </ul> <p> Here is an example of what you will get: </p> <figure src="images/servlettestrunner_xml.jpg" alt="XML output of ServletTestRunner"/> <note> If you see a blank page, click on the View source option of your browser. It means your browser doesn't know how to display XML data. </note> <p> Ok, that's nice ... But what if I want HTML instead of XML? Don't worry there is a solution. Grab the following <link href="site:cactus_report_xsl">XSLT stylesheet</link> (based on the stylesheet used by the <strong><junitreport></strong> Ant task), drop it in your webapp and name it <code>cactus-report.xsl</code> (in the root directory for example). Then, open a browser and type <code>http://server:port/mywebapp/ServletTestRunner?suite=mytestcase&xsl=cactus-report.xsl</code>. You should see the following: </p> <figure src="images/servlettestrunner_html.jpg" alt="HTML output of ServletTestRunner"/> <note> This will work with Internet Explorer as the XSL transformation is performed on the client side (i.e by the browser). I'm not sure about other browsers. </note> </section> <section title="Enabling Server-Side XSLT Transformations"> <p> In the previous section, the XSLT transformation was performed on the client. This requires a browser capable of doing XSLT transformations in a standards-compliant manner, and requires adding the location of the stylesheet as a request parameter. </p> <p> Since Cactus 1.5, the ServletTestRunner can also perform the transformation on the server-side. To enable that feature, make sure that a JAXP compliant XSLT processor (such as <link href="ext:xalanj">Xalan</link>) is available to the web-application. </p> <p> In addition, the location of the XSLT stylesheet needs to specified as initialization parameter of the ServletTestRunner. For example: </p> <source><![CDATA[ [...] <servlet> <servlet-name>ServletTestRunner</servlet-name> <servlet-class> org.apache.cactus.server.runner.ServletTestRunner </servlet-class> <init-param> <param-name>xsl-stylesheet</param-name> <param-value>styles/cactus-report.xsl</param-value> </init-param> </servlet> [...] ]]></source> <p> The specified path is relative to the root of the web-application. Of course, the stylesheet needs to exist at that location. In contrast to client-side transformations, the stylesheet may be placed somewhere inside the <code>WEB-INF</code> directory, because clients do not need to access it directly. </p> <p> If all of the above is correctly set up, you can enable the actual transformation by including a <code>transform</code> parameter with the request (the value of the parameter does not matter). For example </p> <source><![CDATA[ http://server:port/mywebapp/ServletTestRunner?suite=mytestcase&transform=yes ]]></source> <note> The stylesheet specified as initialization parameter is loaded when the ServletTestRunner gets initialized. Changes to the stylesheet will not get picked up until the web-application is reloaded. </note> </section> </section> </body> </document> 1.52 +5 -0 jakarta-cactus/documentation/docs/xdocs/sitemap.xml Index: sitemap.xml =================================================================== RCS file: /home/cvs/jakarta-cactus/documentation/docs/xdocs/sitemap.xml,v retrieving revision 1.51 retrieving revision 1.52 diff -u -r1.51 -r1.52 --- sitemap.xml 13 Jul 2003 10:32:08 -0000 1.51 +++ sitemap.xml 13 Jul 2003 16:25:29 -0000 1.52 @@ -264,6 +264,11 @@ Explains how to use the special integration Cactus provides for the Jetty servlet container. </resource> + + <resource id="integration_browser" target="integration/integration_browser.html" + name="Browser Integration"> + Explains how to run Cactus tests from a browser. + </resource> <resource id="howto_tomcat" target="integration/howto_tomcat.html" name="Tomcat Howto">
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]