Author: jsong
Date: Wed Aug 11 14:14:41 2004
New Revision: 36258

Modified:
   incubator/beehive/trunk/controls/test/build.xml
Log:
Reverse the chages made to controls/test/build.xml by mistake.


Modified: incubator/beehive/trunk/controls/test/build.xml
==============================================================================
--- incubator/beehive/trunk/controls/test/build.xml     (original)
+++ incubator/beehive/trunk/controls/test/build.xml     Wed Aug 11 14:14:41 2004
@@ -1,257 +1,203 @@
-<?xml version="1.0"?>
-<!-- 
-===========================================================================
-
-  This project consists of targets to build/clean a web appplication with
-  the latest Beehive NETUI artifacts, start/stop Tomcat server, and deploy
-  the web application to a started Tomcat server.
-  
-  This project originates from trunk/netui/test/webapps/drt/build.xml for
-  code reusing.
+<?xml version="1.0" ?>
 
-============================================================================ 
--->
-<project name="Beehive/Controls/TestControls-TomcatApp" default="usage" 
basedir=".">
+<project name="beehive_test" default="usage">
 
     <property environment="os"/>
     <property file="${os.BEEHIVE_HOME}/beehive.properties"/>
-    <!--property file="${os.BEEHIVE_HOME}/netui/test/ant/test.properties"/-->
-    <!--property file="${os.BEEHIVE_HOME}/netui/ant/bootstrap.properties"/-->
-    <!--property file="${os.BEEHIVE_HOME}/netui/ant/common.properties"/-->
-    <!--property file="common.properties"/-->
-    
-    <property name="webapp.name" value="controlsWeb"/>
-    <property name="webapp.waitfor.url" 
value="http://localhost:8080/${webapp.name}"/>
+    <property file="common/path.properties"/>
 
-  <target name="usage">
-    <echo message="" />
-    <echo message="" />
-    <echo message="scripts for building/deploying web apps for controls 
testing" />
-    <echo 
message="================================================================" />
-    <echo message="|                          Usage                            
   |" />
-    <echo 
message="================================================================" />
-    <echo message="" />
-    <echo 
message="-------------------------------------------------------------------" />
-    <echo message="|                       Standard Targets                    
      |" />
-    <echo 
message="-------------------------------------------------------------------" />
-    <echo message="build       - inject latest netui artifacts and build 
controlsWeb, " />
-    <echo message="              build controlsWeb includes compiling controls 
in the " />
-    <echo message="              web app.                                      
       " />
-    <echo message="start       - start Tomcat server"/>
-    <echo message="stop        - stop Tomcat server"/>
-    <echo message="deploy      - deploys a built webapp to a started Tomcat" />
-    <echo message="" />
-    <echo message="" />
-   </target>
-
-    <!-- ================================================================ -->
-    <!--                                                                  -->
-    <!-- Targets for building a webapp                                    -->
-    <!--                                                                  -->
-    <!-- ================================================================ -->
-    <target name="build" description="Build webapp">
-        <echo message="-----------------------------------------------------"/>
-        <echo message="|    Beehive Controls controlsWeb build starting    |"/>
-        <echo message="-----------------------------------------------------"/>
-
-        <property name="webapp.dir" location="./${webapp.name}"/>
-
-       <ant antfile="${buildWebapp.ant}" target="deploy.netui" 
inheritAll="false">
-               <property name="webapp.dir" value="${webapp.dir}" />
-       </ant>
-
-        <copy file="${webapp.dir}/WEB-INF/local-netui-config.xml" 
-              tofile="${webapp.dir}/WEB-INF/${netuiconfig.xml.name}" 
-              overwrite="true" failonerror="false"/>
-
-        <!--copy todir="${webapp.dir}/WEB-INF" file="${struts11.logic.tld}"/-->
-        <!--copy todir="${webapp.dir}/WEB-INF" file="${struts11.html.tld}"/-->
-        <!--copy todir="${webapp.dir}/WEB-INF" file="${struts11.bean.tld}"/-->
+    <property name="dev.root" value="${os.DEV_ROOT}"/>
 
-        <ant antfile="${buildWebapp.ant}" target="build.webapp" 
inheritAll="false">
-            <property name="webapp.dir" location="${webapp.dir}"/>
-        </ant>
+    <taskdef name="apt" 
classname="org.apache.beehive.controls.runtime.generator.AptTask" 
+             classpath="../build/jars/controls.jar" onerror="report" />
 
-        <echo message="----------------------------------------------"/>
-        <echo message="|     Controls controlsWeb build ending      |"/>
-        <echo message="----------------------------------------------"/>
-    </target>
+    <!-- BeeHive test specific properties -->
+    <property name="test.root" location="${basedir}/src"/>
+    <property name="tests.src" location="${test.root}/units"/>
+    <property name="tests.driver.src" location="${test.root}/drivers"/>
+    <property name="controls.src" location="${test.root}/controls"/>
+    <property name="build.dir" location="${basedir}/build"/>
+    <property name="build.classes" location="${build.dir}/classes"/>
+    <property name="build.beans" location="${build.dir}/classes/beans"/>
+    <property name="build.tests" location="${build.dir}/classes/tests"/>
+    <property name="build.tests.driver" 
location="${build.dir}/classes/drivers"/>
+    <property name="build.beansrc" location="${build.dir}/beansrc"/>
+    <property name="build.jars" location="${build.dir}/jars"/>
+    <property name="test.logs" location="${basedir}/logs"/>
+    <condition property="test.os" value="windows" >
+       <os family="windows" />
+    </condition>
+    <condition property="test.os" value="unix" >
+       <os family="unix" />
+    </condition>
+
+
+    <path id="tch.run.classpath">
+       <pathelement location="${tch.jar}"/>
+       <pathelement location="${tch.schema.jar}"/>
+       <pathelement location="${tch.xbean.jar}"/>
+       <pathelement location="${milton.jar}"/>
+        <pathelement location="${ant.jar}"/>
+        <pathelement path="${os.ANT_HOME}/lib/ant-launcher.jar"/>
+       
+        <pathelement location="${junit.jar}"/>
+        <pathelement location="${tools.jar}"/>
+        <pathelement location="${velocity14.jar}"/>
+        <pathelement location="${velocitydep14.jar}"/>
+        <pathelement location="${servlet24.jar}"/>
+        <pathelement location="../build/jars/controls.jar"/>
+        <pathelement path="${build.beans}"/>
+       
+        <pathelement path="${build.tests.driver}"/>
+       <pathelement location="${build.tests}" />
 
-    <!-- Fix me: currently, netui\ant\webappTemplate.xml 
undeploy.netui.runtime delete all the jars -->
-    <!-- Fix me: milton.jar is deleted by mistake. undeploy.netui.runtime 
should be fixed and -->
-    <!-- Fix me: not delete milton.jar -->
-    <target name="clean" description="Clean webapp">
-        <echo message="----------------------------------------------"/>
-        <echo message="|     Controls controlsWeb clean starting    |"/>
-        <echo message="----------------------------------------------"/>
-
-        <ant antfile="${buildWebapp.ant}" target="undeploy.netui" 
inheritAll="false">
-            <property name="webapp.dir" location="./${webapp.name}"/>
-        </ant>
-        <ant antfile="${buildWebapp.ant}" target="clean.webapp" 
inheritAll="false">
-            <property name="webapp.dir" location="./${webapp.name}"/>
-        </ant>
+       <pathelement location="${jakarta.jar}"/>
+    </path>
 
-        <echo message="****************************************************"/>
-        <echo message="* milton.jar is deleted by undeploy.netui.runtime, *"/>
-        <echo message="* please put it back to controlsWeb/WEB-INF/lib/   *"/>
-        <echo message="****************************************************"/>
-
-        <echo message="----------------------------------------------"/>
-        <echo message="|     Controls controlsWeb clean ending      |"/>
-        <echo message="----------------------------------------------"/>
+    
+    <!-- =================================================================== 
-->
+    <!-- Usage - print the usage -->
+    <!-- ==================================================================== 
-->
+    <target name="usage">
+        <echo message=""/>
+        <echo message=""/>
+        <echo message="Controls Test Build file"/>
+        <echo 
message="================================================================"/>
+        <echo message="|                          Usage                        
       |"/>
+        <echo 
message="================================================================"/>
+        <echo 
message="----------------------------------------------------------------"/>
+        <echo message="|                      Standard Targets                 
       |"/>
+        <echo 
message="----------------------------------------------------------------"/>
+        <echo message="clean               - Delete the junit classes."/>
+        <echo message="build               - build controls,test drivers and 
java tests."/>
+        <echo message="run                 - run java tests that have already 
been built"/>
+        <echo message="test                - clean, build and run"/>
+        <echo 
message="----------------------------------------------------------------"/>
+    </target>
+
+    <path id="test.classpath">
+        <pathelement location="${junit.jar}"/>
+        <pathelement location="${tools.jar}"/>
+        <pathelement location="${velocity14.jar}"/>
+        <pathelement location="${velocitydep14.jar}"/>
+        <pathelement location="${servlet24.jar}"/>
+        <pathelement path="../build/jars/controls.jar"/>
+        <pathelement path="${build.beans}"/>
+    </path>
+
+    <target name="clean">
+        <delete dir="${build.dir}"/>
+        <delete dir="${test.logs}"/>
+        <delete file="velocity.log"/>
+    </target>
+
+    <target name="dirs">
+        <mkdir dir="${build.classes}" />
+        <mkdir dir="${build.beans}" />
+        <mkdir dir="${build.tests.driver}" />
+        <mkdir dir="${build.tests}" />
+        <mkdir dir="${build.beansrc}" />
+        <mkdir dir="${build.jars}" />
+        <mkdir dir="${test.logs}" />
+    </target>
+
+    <target name="build" depends="dirs">
+        <ant target="build-controls" />
+        <ant target="build-test-drivers" />
+        <ant target="build-java-tests" />
+    </target>
+
+    <target name="build-controls" depends="dirs" unless="_build.controls.ran">
+
+        <apt srcdir="${controls.src}" destdir="${build.beans}" 
gendir="${build.beansrc}"
+             classpathref="test.classpath" 
+             srcExtensions="*.jcs,*.jcx,*.java" >
+        </apt>
+        <jar destfile="${build.jars}/testbeans.jar"  basedir="${build.beans}" 
/>
+        <property name="_build.controls.ran" value="true"/>
+    </target>
+
+    <target name="build-test-drivers" depends="build-controls" 
unless="_build.test.drivers.ran">
+       <echo>build helper class for testing controls</echo>
+        <!-- Build the test source directory -->
+        <javac srcdir="${tests.driver.src}"
+            destdir="${build.tests.driver}"
+            classpathref="test.classpath"
+            debug="on"
+            optimize="on"
+            verbose="false"
+            failonerror="true"
+            >
+            <classpath>
+               <pathelement location="${milton.jar}"/>
+            </classpath>
+        </javac>
+        <property name="_build.test.drivers.ran" value="true"/>
+    </target>
+
+
+    <target name="build-java-tests" depends="build-test-drivers" 
unless="_build.java.tests.ran">
+        <!-- Build the test source directory -->
+        <javac srcdir="${tests.src}"
+            destdir="${build.tests}"
+            classpathref="test.classpath"
+            debug="on"
+            optimize="on"
+            verbose="false"
+            failonerror="true">
+            <classpath>
+               <pathelement location="${milton.jar}"/>
+               <pathelement path="${build.tests.driver}"/>
+            </classpath>
+        </javac>
+        <property name="_build.java.tests.ran" value="true"/>
     </target>
 
-    <target name="scrub" depends="clean" description="Scrub webapp">
-        <delete dir="${tomcat.dir}/work/Catalina/localhost/${webapp.name}" 
includeEmptyDirs="true"/>
-        <delete 
file="${tomcat.dir}/conf/Catalina/localhost/${webapp.name}.xml"/>
-    </target>
+    <target name="test" depends="tests"/>
+    
+    <target name="tests" >
 
-    <!-- ================================================================ -->
-    <!--                                                                  -->
-    <!-- Targets for running test recorder test suites                    -->
-    <!--                                                                  -->
-    <!-- ================================================================ -->
-    <target name="playback" description="Playback a specified list of test 
recorder tests">
-        <ant antfile="${test.dir}/ant/testRecorder.xml" target="playback" 
inheritAll="false">
-            <property name="testRecorder.config.name" 
value="${testRecorder.config.name}"/>
-        </ant>
-    </target>
+        <antcall target="clean" />
+        <antcall target="build" />
+        <antcall target="run" />
 
-    <target name="drt.running" description="Playback the 'drt' category to a 
running server">
-        <ant antfile="${test.dir}/ant/testRecorder.xml" 
target="suite.callback" inheritAll="false">
-            <property name="testRecorder.config.name" 
value="${testRecorder.config.name}"/>
-            <property name="suite.name" value="drt"/>
-            <property name="waitfor.url" value="${webapp.waitfor.url}"/>
-        </ant>
     </target>
 
-    <target name="bvt.running" description="Playback the 'bvt' category to a 
running server">
-        <ant antfile="${test.dir}/ant/testRecorder.xml" 
target="suite.callback" inheritAll="false">
-            <property name="testRecorder.config.name" 
value="${testRecorder.config.name}"/>
-            <property name="suite.name" value="bvt"/>
-            <property name="waitfor.url" value="http://localhost:8080/"/>
-        </ant>
-    </target>
+    
+    
+    <!-- =============================================== -->
+    <!-- stuff below this is stuff i added -->
+    <!-- =============================================== -->
 
-    <target name="drt" description="Run the drt suite with full server start / 
stop support.">
-        <ant dir="${test.dir}" antfile="${test.dir}/ant/testRecorder.xml" 
inheritAll="false" target="server.test">
-            <property name="app.build.file" 
location="${app.dir}/drt/build.xml"/>
-            <property name="waitfor.url" value="http://localhost:8080/"/>
-            <property name="testRecorder.config.name" 
value="${testRecorder.config.name}"/>
-            <property name="suite.name" value="drt"/>
-            <property name="drt.mode" value="true"/>
-        </ant>
-    </target>
+    <property name="junit.src.dir" value="${basedir}/src/units"/>
+  
+    <taskdef name="tch"
+             classname="org.apache.beehive.test.tools.tch.TchVMTask"
+             classpathref="tch.run.classpath"/>
 
-    <target name="bvt" description="Run the bvt suite with full server start / 
stop support.">
-        <ant antfile="${test.dir}/ant/testRecorder.xml" inheritAll="false" 
target="server.test">
-            <property name="app.build.file" 
location="${app.dir}/drt/build.xml"/>
-            <property name="waitfor.url" value="http://localhost:8080/"/>
-            <property name="testRecorder.config.name" 
value="${testRecorder.config.name}"/>
-            <property name="suite.name" value="bvt"/>
-            <property name="drt.mode" value="true"/>
-        </ant>
-    </target>
+    <echo message="milton.jar: ${milton.jar}"/>
+    
+    <target name="run">
+        <property name="test-suite" value="${junit.src.dir}/root.xml"/>
+       <property name="tch.base-logfile-name" value="tch"/>
 
-    <!-- ================================================================ -->
-    <!--                                                                  -->
-    <!-- Targets for deploying the webapp on a server                     -->
-    <!--                                                                  -->
-    <!-- ================================================================ -->
-    <target name="deploy" description="Deploy webapp">
-        <ant antfile="${runTomcat.ant}" target="deploy" inheritAll="false">
-            <property name="context.path" value="${webapp.name}"/>
-            <property name="webapp.root" 
value="C:/beehive/work_dir/controls/test/webapps/${webapp.name}"/>
-        </ant>
-    </target>
 
-    <target name="undeploy" description="Undeploy webapp">
-        <ant antfile="${runTomcat.ant}" target="undeploy" inheritAll="false">
-            <property name="context.path" value="${webapp.name}"/>
-        </ant>
-    </target>
+       <tch tchHome="${tch.home}"
+            testfile="${test-suite}"
+            fork="true"
+            classpathref="tch.run.classpath"
+            failureproperty="run.failed">
 
-    <target name="redeploy" description="Redeploy webapp">
-        <ant antfile="${runTomcat.ant}" target="redeploy" inheritAll="false">
-            <property name="context.path" value="${webapp.name}"/>
-        </ant>
-    </target>
 
-    <!-- ================================================================ -->
-    <!--                                                                  -->
-    <!-- Targets for starting / stopping a server                         -->
-    <!--                                                                  -->
-    <!-- ================================================================ -->
-    <target name="start" description="Start server">
-        <ant antfile="${runTomcat.ant}" target="start" inheritAll="false"/>
-    </target>
 
-    <target name="start.with.shmem" description="Start server">
-        <ant antfile="${runTomcat.ant}" target="start.with.shmem" 
inheritAll="false"/>
-    </target>
-
-    <target name="start.with.asserts" description="Start server with asserts 
enabled for org.apache.beehive.netui">
-        <ant antfile="${runTomcat.ant}" target="start" inheritAll="false">
-            <property name="java.options" 
value="-ea:org.apache.beehive.netui..."/>
-        </ant>
-    </target>
+            <arg value="-emacs"/>
+            <property name="tch.replication.entry-point" value="ant -f 
${controls.test.dir}/build.xml run"/>
+        </tch>
 
-    <target name="start.with.shmem.asserts" description="Start server with 
asserts enabled for org.apache.beehive.netui">
-        <ant antfile="${runTomcat.ant}" target="start.with.shmem" 
inheritAll="false">
-            <property name="java.options" 
value="-ea:org.apache.beehive.netui..."/>
+       
+       <ant antfile="${controls.test.infra.dir}/tch/runtime/build.xml" 
target="generate-html-log" dir="${basedir}">
+               <property name="gtlf.file" 
value="${basedir}/${tch.base-logfile-name}.xml"/>
+               <property name="output.file" 
value="${basedir}/${tch.base-logfile-name}.html"/>
         </ant>
-    </target>
-
-    <target name="stop" description="Stop server">
-        <ant antfile="${runTomcat.ant}" target="stop" inheritAll="false"/>
-    </target>
-
-    <target name="package.drts" description="Package the NetUI DRT 
application.">
-        <antcall target="clean"/>
-
-        <mkdir dir="../../../build/drt"/>
-
-        <zip destfile="../../../build/drt/beehive-netui-drt.zip">
-            <zipfileset dir="." prefix="drt"/>
-        </zip>
-    </target>
-
-    <!-- todo: this needs to compost down into runTomcat.xml; until we're sure 
it works, it stays here -->
-    <target name="ensure.deployed" description="Deploy webapp for the test 
recorder">
-        <echo>Ensuring that the webapp ${webapp.name} is deployed on a running 
server at the url ${webapp.waitfor.url}</echo>
-
-        <waitfor maxwait="5" maxwaitunit="second" 
timeoutproperty="unavailable">
-            <http url="${webapp.waitfor.url}"/>
-        </waitfor>
-        <antcall target="do.deploy"/>
-        <antcall target="do.redeploy"/>
-        <fail if="still.unavailable" message="Couldn't find webapp with path 
${webapp.waitfor.url}"/>
-    </target>
-
-    <target name="do.deploy" if="unavailable">
-        <echo>Webapp is not deployed; deploying</echo>
-
-        <antcall target="deploy"/>
-        <echo>...deploy complete</echo>
-
-        <waitfor maxwait="120" maxwaitunit="second" 
timeoutproperty="still.unavailable">
-            <http url="${webapp.waitfor.url}"/>
-        </waitfor>
-    </target>
-
-    <target name="do.redeploy" unless="unavailable">
-        <echo>Webapp is deployed; undeploy and redeploy</echo>
-
-        <antcall target="undeploy"/>
-        <echo>...undeploy complete</echo>
-
-        <antcall target="deploy"/>
-        <echo>...deploy complete</echo>
-
-        <waitfor maxwait="120" maxwaitunit="second" 
timeoutproperty="still.unavailable">
-            <http url="${webapp.waitfor.url}"/>
-        </waitfor>
-    </target>
-
+    </target>  
 </project>

Reply via email to