You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beehive.apache.org by st...@apache.org on 2005/12/13 19:20:19 UTC

svn commit: r356560 - /beehive/trunk/docs/forrest/release/src/documentation/content/xdocs/controls/tutorial_controls.xml

Author: steveh
Date: Tue Dec 13 10:20:16 2005
New Revision: 356560

URL: http://svn.apache.org/viewcvs?rev=356560&view=rev
Log:
First draft of revised controls tutorial -- uses the new JUnit test container.

Modified:
    beehive/trunk/docs/forrest/release/src/documentation/content/xdocs/controls/tutorial_controls.xml

Modified: beehive/trunk/docs/forrest/release/src/documentation/content/xdocs/controls/tutorial_controls.xml
URL: http://svn.apache.org/viewcvs/beehive/trunk/docs/forrest/release/src/documentation/content/xdocs/controls/tutorial_controls.xml?rev=356560&r1=356559&r2=356560&view=diff
==============================================================================
--- beehive/trunk/docs/forrest/release/src/documentation/content/xdocs/controls/tutorial_controls.xml (original)
+++ beehive/trunk/docs/forrest/release/src/documentation/content/xdocs/controls/tutorial_controls.xml Tue Dec 13 10:20:16 2005
@@ -7,158 +7,93 @@
     <body>
         <section id="intro">
             <title>Introduction</title>
-            <section>
+            <section id="goals">
                 <title>Tutorial Goals</title>
                 <p>
                 The Controls tutorial is provided as a way to become familiar with the concepts of Controls in Beehive.  The tutorial
-                walks through creating, building, and deploying a sample project that uses a Control from a page flow.  
-                <strong>Note:</strong> NetUI is not required to use Controls; they just provide a convenient way to demonstrate 
-                running a Control.  In this tutorial, you will learn:
+                walks through creating, building, and packaging and testing a simple Hello World control. In this tutorial, you will learn:
                 </p>
                 <ul>
                     <li>What Beehive Controls are for and what they do.</li>
                     <li>How to create a Beehive Control interface and implementation.</li>
                     <li>How to compile a Beehive Control.</li>
-                    <li>How to use a Beehive Control as a component in a larger application.</li>
+                    <li>How to package a Control as a distributable JAR file.</li>
+					<li>How to test a Control using JUnit.</li>
+					<li>How to use a Beehive Control as a component in a larger application.</li>
                     <li>How to use metadata annotations in Beehive Controls.</li>
                     <li>How to create custom metadata annotations.</li>
                 </ul>
             </section>
         </section>
         <section id="setup">
-            <title>Step 1: Setup a Beehive-enabled Web Application</title>
+            <title>Step 1: Setup Control Development</title>
             <section id="setup_shell">
                 <title>Set Shell Variables</title>
                 <p>
-                Complete all of the necessary and optional steps in the following topic: <a class="fork" href="site:setup">Beehive 
-                Installation and Setup</a>
+                    Complete all of the necessary and optional steps in the following topic: <a class="fork" href="site:setup">Beehive 
+                    Installation and Setup</a>
                  </p>
             </section>
-            <section id="setup_make_project">
-                <title>Create a Beehive-enabled Web Project</title>
+            <section id="create_control_proj">
+                <title>Create a Control Project</title>
                 <p>
-                In order to follow the steps in this tutorial, it's necessary to create a Beehive-enabled web application.  
-                Beehive-enabled web applications are described <a href="site:setup">here</a>.  A skeleton Beehive-enabled web 
-                project is provided in the samples/ directory as <a href="site:netui-blank">netui-blank</a>.  This contains 
-                a basic Ant build file and an example page flow controller.  To create the
-                web project, copy and then rename the <a href="site:netui-blank">netui-blank</a> project using these steps:
-                </p>
-                <ol>
-                <li>Create a directory <code>/beehive_projects</code> (on Windows, this would be <code>C:\beehive_projects</code>).</li>
-                <li>Run the Ant target to create a new NetUI project:
-                    <code>ant -f &lt;beehive-root>/beehive-imports.xml</code> and provide a fully-qualified web project root directory
-                    named <code>controls_tutorial</code>.  Note, <code>&lt;beehive-root></code> is the directory that contains a 
-                    Beehive distribution; a typical value might be <code>/apache/apache-beehive-1.0</code>.</li>
-                <li>Before continuing, confirm that the following directory structure exists:</li>
-                </ol>
-                <source>
-    beehive_projects/
-        controls_tutorial/
-            web/
-                Controller.java
-                index.jsp
-                resources/
-                WEB-INF/
-            build.properties
-            build.xml
-                </source>
+                    Copy the directory <code>&lt;BeehiveRoot>/samples/controls-blank</code> to a location of your choice.  For example, you might copy 
+                    to the following location: <code>/beehive_projects/controls-blank</code>.
+                </p>
                 <p>
-                Note, this directory structure is just an example; you are free to put the <code>controls_tutorial</code> 
-                directory anywhere on disk.  In the remainder of this tutorial, the directory <code>beehive_projects/controls_tutorial</code> 
-                will simply be referred to as <code>controls_tutorial</code>.
+                    Rename <code>controls-blank</code> to <code>controls_tutorial</code>.
                 </p>
-            </section>
-            <section id="setup_configure_properties">
-                <title>Configure Build Properties</title>
                 <p>
-                The <code>build.properties</code> file contains several project-related properties that must 
-                be set in order to build the web application.  Specifically, the paths to your Beehive distribution and 
-                to the JSP / Servlet API JARs for your application container must be set.  The following steps will set these properties
-                for the <code>controls_tutorial</code> webapp.
-                </p>
-                <ol>
-                <li>Open the file <code>controls_tutorial/build.properties</code> in a text editor.</li>
-                <li>Edit the <code>beehive.home</code> property so it points to the top-level folder of your Beehive distribution.</li>  
-                <li>Edit the <code>context.path</code> to use the value <code>controls_tutorial</code>.</li>
-                </ol>
-                <note>
-                The <code>context.path</code> property determines both (1) the name of the application WAR file and (2) the application URL.  
-                <br/><br/>
-                If <code>context.path=controls_tutorial</code>, then the following WAR file will be produced:
-                <br/><br/>
-                &nbsp;&nbsp;&nbsp;&nbsp;<strong><code>controls_tutorial</code></strong><code>.war</code>
-                <br/><br/>
-                and the following URL will invoke the web application:
-                <br/><br/>
-                &nbsp;&nbsp;&nbsp;&nbsp;<code>http://someapplicationserver/</code><strong><code>controls_tutorial</code></strong>
-                </note>
+                    Edit the file <code>controls_tutorial/build.properties</code> so that the property <code>beehive.home</code> points to the top level folder of your 
+                    beehive distribution.
+                </p>
                 <p>
-                For example, if your Beehive distribution is located in <code>/apache/apache-beehive-1.0</code>, 
-                then your <code>build.properties</code> file would appear as follows.</p>
+                    For example, if your Beehive distribution is located in <code>/apache/apache-beehive-1.0</code>, 
+                    then your <code>build.properties</code> file would appear as follows.
+                </p>
                 <source>
 beehive.home=<strong>/apache/apache-beehive-1.0</strong>
-servlet-api.jar=${os.CATALINA_HOME}/common/lib/servlet-api.jar
-jsp-api.jar=${os.CATALINA_HOME}/common/lib/jsp-api.jar
-
-context.path=<strong>controls_tutorial</strong>
                 </source>
                 <note>
-                Properties files should use the '/' character to separate drive, directory, and file names.
+                    Properties files should use the '/' character to separate drive, directory, and file names.
                 </note>
+            </section>
+            <section id="install_junit">
+                <title>Install JUnit</title>
                 <p>
-                If you are using an application container other than Tomcat, be sure to set the <code>servlet-api.jar</code> 
-                and <code>jsp-api.jar</code> properties to reference the JAR your server provides which contains the JSP 
-                and Servlet API classes.
+                    <a href="http://sourceforge.net/project/showfiles.php?group_id=15278">Download</a>  the latest version of JUnit.
                 </p>
-            </section>
-            <section id="setup_add_control_files">
-                <title>Add Sample Control Interface and Implementation Source Files</title>
                 <p>
-                This tutorial uses a sample Hello World control that is contained in 
-                <strong><code>&lt;BeehiveDistribution>/samples/controls-blank/src/pkg</code></strong>.  Copy the <code>pkg</code> 
-                sub-directory from this path into the directory <strong><code>controls_tutorial/src</code></strong>.
+                    Unzip the junit.zip file into a directory of your choice.
                 </p>
                 <p>
-                Now, confirm that in addition to the files described above that the following directories and files exist:
+                    In your shell, set <code>JUNIT_HOME</code> to refer to the directory where <code>junit.jar</code> resides:  
                 </p>
                 <source>
-controls_tutorial/
-    src/
-        pkg/
-            Hello.java
-            HelloImpl.java</source>
-            </section>
-            <section id="setup_start_server">
-                <title>Start the Server</title>
-                <p>If you are using Tomcat, enter the following at the command prompt:</p>
-                <source>$CATALINA_HOME/bin/startup.bat</source>
-                <p>If you aren't using Tomcat, start your application container as per its directions.</p>
-            </section>
-            <section id="setup_urls">
-                <title>Using URLs in the Examples</title>
+JUNIT_HOME = /some/directory
+                </source>
                 <p>
-                In the Beehive tutorials, you will often encounter URLs like <code>http://localhost:8080/controls_tutorial/begin.do</code>.
-                When you see these URLs, they are meant to be accessed via your web browser to demonstrate functionality built in the 
-                tutorial.  These URLs are setup to run on Tomcat, so if you are unable to run these URLs, be sure that they are appropriate 
-                for your application server.  Specifically, check the port numbers to make sure that your server is running on the 
-                referenced port.
+                    Add <code>junit.jar</code> to the classpath: 
                 </p>
+                <source>
+export CLASSPATH=$JUNIT_HOME/junit.jar
+                </source>
             </section>
         </section>
-        <section id="create">
+        <section id="compile">
             <title>Step 2: Compile the Control Implementation and Interface Files</title>
-            <section id="create-introduction">
+            <section id="compile_introduction">
                 <title>Introduction</title>
                 <p>A Beehive Control consists of two files: an interface file and an implementation file.  The interface file is the 
                     public face of your control.  It lists all of the methods which can be invoked by 
                     users.  The implementation file contains the implementation code for the methods 
                     listed in the interface file.</p>
             </section>
-            <section id="create-examine"><title>Examine the Control Files</title>
-            <p>Open the file <code>/beehive_projects/controls_tutorial/WEB-INF/src/pkg/HelloImpl.java</code>.</p>
-            <p>The implementation file appears as follows. (There is no need to edit the file at 
-                this point in the tutorial.)</p>
-<source>
+            <section id="compile_examine"><title>Examine the Control Files</title>
+                <p>Open the file <code>/controls_tutorial/src/pkg/HelloImpl.java</code>.</p>
+                <p>The implementation file appears as follows. (There is no need to edit the file at 
+                    this point in the tutorial.)</p>
+                <source>
 package pkg;
 
 import org.apache.beehive.controls.api.bean.ControlImplementation;
@@ -170,249 +105,172 @@
     public String hello() {
         return "hello!";
     }
-}</source>
-            <p>Open the file <code>controls_tutorial/WEB-INF/src/pkg/Hello.java</code>.  The interface file should appear appears as follows.</p>
-<source>
-package pkg;
+}
+                </source>
+                <p>
+                    Open the file <code>controls_tutorial/src/pkg/Hello.java</code>.  The interface file should appear appears as follows.
+                </p>
+                <source>package pkg;
 
 import org.apache.beehive.controls.api.bean.ControlInterface;
 
 @ControlInterface
-public interface Hello {
+public interface Hello
+{
     String hello();
-}</source>
-                </section>       
-            <section id="create-edit-controller">
-                <title>Edit the Controller.java File</title>
-            <p>To test the Hello control, you need to call the control from some other resource, such as a 
-               Java application, JSP, a web application, etc.  In the following two steps you will call the 
-               control from a <a href="site:tutorial_pageflow">page flow contoller</a> in a web application and display the results on a JSP.</p>
-            <p>Open the file <code>controls_tutorial/Controller.java</code> in a code editor and modify so it appears as:</p>
-            <source>
-import javax.servlet.http.HttpSession;
-
-import org.apache.beehive.netui.pageflow.Forward;
-import org.apache.beehive.netui.pageflow.PageFlowController;
-import org.apache.beehive.netui.pageflow.annotations.Jpf;
-
-<strong>import org.apache.beehive.controls.api.bean.Control;
-import pkg.Hello;</strong>
-
-@Jpf.Controller(
-    simpleActions={
-        @Jpf.SimpleAction(name="<strong>old_</strong>begin", path="index.jsp")
-    },
-    sharedFlowRefs={
-        @Jpf.SharedFlowRef(name="shared", type=shared.SharedFlow.class)
-    }
-)
-public class Controller 
-    extends PageFlowController {
-
-    <strong>@Control
-    private Hello _helloControl;
-    
-    @Jpf.Action(
-      forwards={
-        @Jpf.Forward(name="success", path="index.jsp")
-      }
-    )
-    protected Forward begin() 
-        throws Exception {
-        Forward f = new Forward("success");
-        f.addActionOutput("helloMessage", _helloControl.hello());
-        return f;
-    }</strong>    
-    
-}
-</source>
-     <p>The two import statements import the @Control annotation and the <code>Hello</code> control, respectively.</p>
-     <p>The <code>@Jpf.SimpleAction</code> named <code>begin</code> is renamed to <code>old_begin</code>
-        because the Beehive runtime automatically looks for and runs any action named <code>begin</code> when 
-        a page flow is first instantiated.  The renaming makes the runtime run the action method <code>begin()</code>, 
-        which allows us to call the <code>Hello</code> control inside of the method body.</p>
-        </section>
-        <section id="create_edit_page">
-            <title>Edit the index.jsp Test Page</title>
-            <p>Edit the file <code>/beehive_projects/controls_tutorial/index.jsp</code> to appear as follows; changes are shown in <strong>bold</strong>:</p>
-            <source>
-&lt;%@ page language="java" contentType="text/html;charset=UTF-8"%>
-&lt;%@ taglib uri="http://beehive.apache.org/netui/tags-databinding-1.0" prefix="netui-data"%>
-&lt;%@ taglib uri="http://beehive.apache.org/netui/tags-html-1.0" prefix="netui"%>
-&lt;%@ taglib uri="http://beehive.apache.org/netui/tags-template-1.0" prefix="netui-template"%>
-&lt;netui:html>
-  &lt;head>
-    &lt;title><strong>Control Tutorial Test Page</strong>&lt;/title>
-    &lt;netui:base/>
-  &lt;/head>
-  &lt;netui:body>
-    <strong>&lt;h3>Control Tutorial Test Page&lt;/h3></strong>
-    &lt;p>
-        <strong>Response from the hello() method on the Hello Control: 
-        &lt;netui:span style="color:#FF0000" value="${pageInput.helloMessage}"/></strong>
-    &lt;/p>
-  &lt;/netui:body>
-&lt;/netui:html>
-            </source>
-            </section>
-            <section id="create_build_deploy">
-                <title>Compile and Deploy the Web Application</title>
-                <p>You are now ready to compile the page flow and deploy it to Tomcat.</p>
-                <p>
-                The following Ant command assumes that you are in the <code>controls_tutorial</code> directory.  At the command prompt, enter:</p>
-                <source>ant clean build war</source>
-                <p>
-                This will build the webapp by running the Beehive annotation processors and will produce class files in <code>WEB-INF/classes</code>.
-                Now, the application is ready to deploy to your server.  On Tomcat, copy the WAR file into Tomcat's <code>$CATALINA_HOME/webapps</code> 
-                directory.</p>
-                <p>On Windows:</p>
-                <source>
-    copy controls_tutorial.war %CATALINA_HOME%\webapps /Y</source>
-                <note>
-                    On Windows, there are file-locking issues that Tomcat versions 5.5.x and above are sensitive to.
-                    In particular, any web application that uses Struts will <strong>fail to redeploy</strong> if you
-                    copy in a new .war file as described here.  The Commons Digester team is adding a workaround for the
-                    issue (see
-                    <a href="http://issues.apache.org/bugzilla/show_bug.cgi?id=37034">this bug</a>), but in the meantime,
-                    you can work around it with the <code>antiResourceLocking</code> option in Tomcat.  Just add a file
-                    called <code>context.xml</code> in a directory called <code>META-INF</code> inside the
-                    <code>web</code> directory before building (so it will end up as <code>META-INF/context.xml</code>
-                    in your <code>controls_tutorial.war</code>):
-                    <br/>
-                    <br/>
-                    <code>&nbsp;&nbsp;&nbsp;&nbsp;&lt;?xml version="1.0" encoding="UTF-8"?></code><br/>
-                    <code>&nbsp;&nbsp;&nbsp;&nbsp;&lt;Context antiResourceLocking="true"></code><br/>
-                    <code>&nbsp;&nbsp;&nbsp;&nbsp;&lt;/Context></code>
-                </note>
-                <p>Everywhere else:</p>
-                <source>
-    cp controls_tutorial.war $CATALINA_HOME/webapps</source>
-                <p>If you are asked to overwrite the old WAR file, enter 'yes'.  Note, during redeployment, you may have to wait a few seconds 
-                   for Tomcat to redeploy the WAR file.  Once deployment or redeployment has completed, the webapp can be accessed through a browser.</p>
-                <p>If you are not using Tomcat, follow your server's web application deployment instructions to deploy the webapp.</p>
+} 
+                </source>
             </section>
-            <section id="create_run">
-                <title>Test the Control</title>
-                <p>Visit the following address in a web browser:</p>
-                <p class="quote">
-                    <a class="fork" href="http://localhost:8080/controls_tutorial/begin.do">http://localhost:8080/controls_tutorial/begin.do</a>
+            <section id="set_jar_name">
+                <title>Set the Name of the Built Control JAR File</title>
+                <p>
+                    In this task you will set the name of the built JAR file.
                 </p>
-                <p>This will render the <code>index.jsp</code> page.</p>
-                <p>Note the message on the page: "hello!" which is provided by <code>Hello</code> control.</p>
+                <p>
+                    Edit the file <code>controls_tutorial/build.xml</code> so it appears as follows.  Code to edit appears in bold.
+                </p>
+                <source>
+&lt;project name="<strong>controls_tutorial</strong>" default="usage" basedir=".">
+                    
+...                 
+
+    &lt;property name="build.jar" value="<strong>helloControl.jar</strong>"/>
+                    
+...
+                </source>                
+            </section>       
+            <section id="build">
+                <title> Compile the Control </title>
+                <p> You are now ready to compile the control. </p>
+                <p> The following Ant command assumes that you are in the
+                    <code>controls_tutorial</code> directory. At the command prompt, enter: </p>
+                <source>ant clean build</source>
+                <p> A JAR file is created and saved at
+                    <code>controls_tutorial/build/helloControl.jar</code> </p>
             </section>
         </section>
-        <section id="add_method">
-            <title>Step 3: Add a Parameterized Method to the Control</title>
-            <section id="add_method_edit">
-                <title>Edit the Interface and Implementation Files</title>
-                <p>Edit <code>controls_tutorial/WEB-INF/src/pkg/HelloImpl.java</code> so it appears as follows.  Code to add appears in bold.</p>
-<source>
-package pkg;
-
-import org.apache.beehive.controls.api.bean.ControlImplementation;
+        <section id="test">
+            <title>Step 3: Create a JUnit Test for the Control</title>
+            <section id="add_test_class">
+                <title>Add a Test Class</title>
+                <p>In the directory <code>/controls_tutorial/src</code> create a directory named <code>tests</code>.</p>
+                <p>In the directory <code>/controls_tutorial/src/tests</code> create a file named <code>Tests.java</code>.</p>
+                <p>Edit the file <code>Tests.java</code> so appears as follows</p>
+                <source>
+package tests;
 
-@ControlImplementation(isTransient=true)
-public class HelloImpl 
-    implements Hello {
+import org.apache.beehive.controls.api.bean.Control;
+import pkg.Hello;
 
-    public String hello() {
-        return "hello!";
-    }
+import org.apache.beehive.controls.test.junit.ControlTestCase;
 
-    <strong>public String helloParam(String name) {
-        return "Hello, " + name + "!";
+public class Tests extends ControlTestCase
+{   
+    @Control
+    private Hello _helloControl;
+    
+    public void testHello() throws Exception
+    {
+    	String message = _helloControl.hello();
+        if(!message.equalsIgnoreCase("hello!"))
+            fail("Method hello() failed to return message 'hello!'.");
     }
-</strong>
-}
-</source>
-<p>Edit <code>controls_tutorial/WEB-INF/src/pkg/Hello.java</code> so it appears as follows; modifications are shown in <strong>bold</strong>:</p>
-<source>
-package pkg;
-
-import org.apache.beehive.controls.api.bean.ControlInterface;
-
-@ControlInterface
-public interface Hello {
-
-    String hello();
-
-    <strong>String helloParam(String name);</strong>
 }
-</source>
+                    </source>
                 </section>
-                <section id="edit_jpf_3">
-                    <title>Edit the Controller.java File</title>
-                    <p>Edit the <code>begin()</code> method in <code>Controller.java</code> so it appears as 
-                       follows; modifications are shown in <strong>bold</strong>.</p>
-    <source>
-...
-        
-public class Controller 
-    extends PageFlowController {
-
-    ...
-
-    @Jpf.Action(
-      forwards={
-        @Jpf.Forward( name="success", path="index.jsp" )
-      }
-    )
-    protected Forward begin() 
-        throws Exception {
-        Forward f = new Forward("success");
-        f.addActionOutput("helloMessage", _helloControl.hello());
-        <strong>f.addActionOutput("helloParamMessage", _helloControl.helloParam("World"));</strong>
-        return f;
-    }    
-
-   ...
+                <section id="add_test_to_build">
+                    <title>Edit the build.xml File</title>
+                    <p>
+                        Edit the file build.xml so it appears as follows.  Code to edit and add appears in bold:    
+                    </p>
+                    <source>
+&lt;?xml version="1.0" ?>
+
+&lt;project name="controls_tutorial" default="usage" basedir=".">
+
+    &lt;property environment="os"/>
+    &lt;property file="build.properties"/>
+    &lt;import file="${beehive.home}/beehive-imports.xml"/>
+    &lt;import file="${beehive.home}/ant/beehive-tools.xml"/>
+
+    &lt;property name="source.dir" location="${basedir}/src"/>
+    &lt;property name="build.dir" location="${basedir}/build"/>
+    &lt;property name="build.classes" location="${build.dir}/classes"/>
+    &lt;property name="build.beansrc" location="${build.dir}/beansrc"/>
+    &lt;property name="build.jar" value="helloControl.jar"/>
+    <strong>&lt;property name="junit.jar" value="PATH/TO/YOUR/junit.jar"/>
+    &lt;property name="commons.disc.jar" value="${beehive.home}/lib/common/commons-discovery-0.2.jar"/>
+    &lt;property name="commons.log.jar" value="${beehive.home}/lib/common/commons-logging-1.0.4.jar"/></strong>
+    
+ 
+    &lt;path id="build.classpath">
+        &lt;pathelement path="${build.classes}"/>
+        &lt;path refid="controls.dependency.path"/>
+    &lt;/path>
+ 
+    <strong>&lt;path id="test.classpath">
+        &lt;pathelement path="${junit.jar}"/>
+        &lt;pathelement path="${commons.disc.jar}"/>
+        &lt;pathelement path="${commons.log.jar}"/>
+        &lt;pathelement path="${build.classes}"/>
+        &lt;path refid="controls.dependency.path"/>
+    &lt;/path></strong>    
+    
+    &lt;target name="clean" description="Delete all generated files">
+        &lt;delete dir="${build.dir}"/>
+        &lt;delete file="velocity.log"/>
+    &lt;/target>
+
+    &lt;target name="build" description="Build control sources">
+        &lt;mkdir dir="${build.classes}"/>
+        &lt;mkdir dir="${build.beansrc}"/>
+
+        &lt;build-controls srcdir="${source.dir}"
+                        destdir="${build.classes}"
+                        tempdir="${build.beansrc}"
+                        classpathref="build.classpath"/>
 
-}
-</source>
-    </section>
-<section id="add_method_edit_page">
-    <title>Edit a Test JSP</title>
-    <p>Edit <code>index.jsp</code> so it appears as follows.  Code to add appears in bold.</p>
-    <source>
-&lt;%@ page language="java" contentType="text/html;charset=UTF-8"%>
-&lt;%@ taglib uri="http://beehive.apache.org/netui/tags-databinding-1.0" prefix="netui-data"%>
-&lt;%@ taglib uri="http://beehive.apache.org/netui/tags-html-1.0" prefix="netui"%>
-&lt;%@ taglib uri="http://beehive.apache.org/netui/tags-template-1.0" prefix="netui-template"%>
-&lt;netui:html>
-  &lt;head>
-    &lt;title>Control Tutorial Test Page&lt;/title>
-    &lt;netui:base/>
-  &lt;/head>
-  &lt;netui:body>
-    &lt;jsp:useBean class="pkg.HelloBean" id="helloBean" scope="session"/>
-    &lt;h3>Control Tutorial Test Page&lt;/h3>
-    &lt;p>
-        Response from the hello() method on the Hello Control: 
-        &lt;netui:span style="color:#FF0000" value="${pageInput.helloMessage}"/>
-    &lt;/p>
-    <strong>&lt;p>
-        Response from the helloParam() method on the Hello Control: 
-        &lt;netui:span style="color:#FF0000" value="${pageInput.helloParamMessage}"/>
-    &lt;/p></strong>
-  &lt;/netui:body>
-&lt;/netui:html></source>
-</section>
-            <section id="add_method_build_deploy">
-                <title>Compile and Redeploy the Web Application</title>
-                <p>Compile and deploy the web application using the Ant commands described <a href="#create_build_deploy">here</a>.</p>
-            </section>
-            <section id="add_method_run">
-                <title>Test the Control</title>
-                <p>Visit the following address in a web browser:</p>
-                <p class="quote"><a class="fork" href="http://localhost:8080/controls_tutorial/begin.do">http://localhost:8080/controls_tutorial/begin.do</a></p>
-                <p>This will render the <code>index.jsp</code> page.</p>
-                <p>Note the messages on the page: "hello!" and "Hello, World!" which are provided by the <code>Hello</code> control.</p>
+        &lt;control-jar destfile="${build.dir}/${build.jar}"  basedir="${build.classes}" />
+    &lt;/target>
+    
+    <strong>&lt;target name="test" description="Run the JUnit Tests">
+        &lt;java 
+            classname="junit.textui.TestRunner"
+            classpathref="test.classpath">
+            &lt;arg line="tests.Tests"/>
+        &lt;/java> 
+    &lt;/target></strong>
+
+    &lt;target name="usage" description="Print the usage for this build.xml">
+        &lt;echo message=""/>
+        &lt;echo message=""/>
+        &lt;echo message="Controls Project Template Build file"/>
+        &lt;echo message=""/>
+        &lt;echo message=""/>
+        &lt;echo message="----------------------------------------------------------------"/>
+        &lt;echo message="|                      Standard Targets                        |"/>
+        &lt;echo message="----------------------------------------------------------------"/>
+        &lt;echo message="clean               - Delete all generated files"/>
+        &lt;echo message="build               - Build control sources"/>
+        <strong>&lt;echo message="test                - Test the control"/></strong>
+        &lt;echo message="----------------------------------------------------------------"/>
+    &lt;/target>
+
+&lt;/project>
+                        
+                    </source>
+                </section>
+                <section id="run_test">
+                    <title>Run the Test</title>
+                    <p>Run the following Ant command to test the control.</p>
+                    <source>
+ant clean build test                        
+                    </source>
+                </section>
             </section>
-        </section>
        </body>
     <footer>
-        <legal>Java, J2EE, and JCP are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries.<br/>
-    &copy; 2005, Apache Software Foundation
+        <legal>Java, J2EE, and JCP are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries.<br/>&copy; 2005, Apache Software Foundation
         </legal>
     </footer>
 </document>