Author: jsong
Date: Tue Oct  5 14:26:51 2004
New Revision: 53826

Added:
   incubator/beehive/trunk/controls/test/webapps/controlsWeb/app.properties
Removed:
   
incubator/beehive/trunk/controls/test/webapps/controlsWeb/WEB-INF/lib/milton.jar
   incubator/beehive/trunk/controls/test/webapps/controlsWeb/WEB-INF/src/global/
   incubator/beehive/trunk/controls/test/webapps/controlsWeb/WEB-INF/src/org/
   incubator/beehive/trunk/controls/test/webapps/controlsWeb/controls/
   incubator/beehive/trunk/controls/test/webapps/controlsWeb/resources/milton/
Modified:
   incubator/beehive/trunk/controls/test/build.xml
   incubator/beehive/trunk/controls/test/common/path.properties
   incubator/beehive/trunk/controls/test/webapps/build.xml
Log:
Checking in [EMAIL PROTECTED]'s bug fix for BEEHIVE-5

http://nagoya.apache.org/jira/browse/BEEHIVE-5



Modified: incubator/beehive/trunk/controls/test/build.xml
==============================================================================
--- incubator/beehive/trunk/controls/test/build.xml     (original)
+++ incubator/beehive/trunk/controls/test/build.xml     Tue Oct  5 14:26:51 2004
@@ -19,17 +19,20 @@
              classpath="../build/jars/controls.jar" onerror="report" />        
     
 
     <!-- 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="controls.test.root" location="${basedir}"/>
+    <property name="controls.test.src" location="${controls.test.root}/src"/>
+    <property name="controls.test.units" 
location="${controls.test.src}/units"/>
+    <property name="controls.test.drivers" 
location="${controls.test.src}/drivers"/>
+    <property name="controls.test.controls" 
location="${controls.test.src}/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.drivers" location="${build.dir}/classes/drivers"/>
     <property name="build.beansrc" location="${build.dir}/beansrc"/>
     <property name="build.jars" location="${build.dir}/jars"/>
+    <property name="controlstestbeans.jar" 
location="${build.dir}/controlstestbeans.jar"/>
+    <property name="controlstestdrivers.jar" 
location="${build.dir}/controlstestdrivers.jar"/>
     <property name="test.logs" location="${basedir}/logs"/>
 
     <condition property="test.os" value="windows" >
@@ -72,7 +75,7 @@
         <pathelement location="../build/jars/controls.jar"/>
         <pathelement path="${build.beans}"/>
        
-        <pathelement path="${build.tests.driver}"/>
+        <pathelement path="${build.drivers}"/>
        <pathelement location="${build.tests}" />
 
        <pathelement location="${jakarta.jar}"/>
@@ -106,6 +109,7 @@
         <delete dir="${build.dir}"/>
         <delete dir="${test.logs}"/>
         <delete file="velocity.log"/>
+        <ant dir="webapps" target="clean"/>
     </target>
 
     <!-- =================================================================== 
-->
@@ -121,42 +125,31 @@
     <target name="dirs">
         <mkdir dir="${build.classes}" />
         <mkdir dir="${build.beans}" />
-        <mkdir dir="${build.tests.driver}" />
+        <mkdir dir="${build.drivers}" />
         <mkdir dir="${build.tests}" />
         <mkdir dir="${build.beansrc}" />
         <mkdir dir="${build.jars}" />
         <mkdir dir="${test.logs}" />
     </target>
 
-    <!-- obsoleted 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-beans" depends="dirs">
         <!-- Build checkers first so they can be dynamically loaded
         during build of control extensions.  Checkers may dep on public 
interfaces,
         which we need to make sure get pulled in by apt -->
-        <apt srcdir="${controls.src}" destdir="${build.beans}" 
gendir="${build.beansrc}"
+        <apt srcdir="${controls.test.controls}" destdir="${build.beans}" 
gendir="${build.beansrc}"
              classpathref="test.classpath" >
             <include name="**/checker/*.java"/>
         </apt>
 
         <!-- Build the InnerControl controls used by composition tests.  This 
is only
              necessary because the bean types are needed to compile a public 
interface -->
-        <apt srcdir="${controls.src}" destdir="${build.beans}" 
gendir="${build.beansrc}"
+        <apt srcdir="${controls.test.controls}" destdir="${build.beans}" 
gendir="${build.beansrc}"
              classpathref="test.classpath" compileByExtension="true"
              srcExtensions="*.java,*.jcx,*.jcs" >
             <include name="**/composition/InnerControl*"/>
         </apt>
 
-        <apt srcdir="${controls.src}" destdir="${build.beans}" 
gendir="${build.beansrc}"
+        <apt srcdir="${controls.test.controls}" destdir="${build.beans}" 
gendir="${build.beansrc}"
              classpathref="test.classpath" compileByExtension="true"
              srcExtensions="*.java,*.jcx,*.jcs" >
         </apt>
@@ -172,15 +165,15 @@
                 <include name="**/*.controls.properties"/>
             </fileset>
         </assemble>
-        <control-jar destfile="${build.jars}/checkinbeans.jar"  
basedir="${build.beans}" />
+        <control-jar destfile="${controlstestbeans.jar}"  
basedir="${build.beans}" />
     </target>
 
 
     <target name="build-test-drivers" depends="build-beans" 
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}"
+        <javac srcdir="${controls.test.drivers}"
+            destdir="${build.drivers}"
             classpathref="test.classpath"
             debug="on"
             optimize="on"
@@ -191,13 +184,14 @@
                <pathelement location="${milton.jar}"/>
             </classpath>
         </javac>
+        <jar destfile="${controlstestdrivers.jar}" basedir="${build.drivers}"/>
         <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 -->
-        <apt srcdir="${tests.src}"
+        <apt srcdir="${controls.test.units}"
             destdir="${build.tests}"
             gendir="${build.beansrc}"
             classpathref="test.classpath"
@@ -211,7 +205,7 @@
                <pathelement location="${milton.jar}"/>
                <pathelement location="${mantis.jar}"/>
                <pathelement location="${httpunit.jar}"/>
-               <pathelement path="${build.tests.driver}"/>
+               <pathelement path="${build.drivers}"/>
             </classpath>
         </apt>
         <property name="_build.java.tests.ran" value="true"/>
@@ -347,7 +341,7 @@
        <pathelement path="${jsr173.jar}"/>
        <pathelement path="../build/jars/controls.jar"/>
        <pathelement path="${build.beans}"/>
-               <pathelement path="${build.tests.driver}"/>
+               <pathelement path="${build.drivers}"/>
   </path>
   <property name="mantis.run.classpath" refid="mantis.classpath"/>
 

Modified: incubator/beehive/trunk/controls/test/common/path.properties
==============================================================================
--- incubator/beehive/trunk/controls/test/common/path.properties        
(original)
+++ incubator/beehive/trunk/controls/test/common/path.properties        Tue Oct 
 5 14:26:51 2004
@@ -17,6 +17,7 @@
 tch.xbean.jar=${tch.home}/xbean-1.0.2.jar
 
 milton.jar=${controls.test.infra.dir}/milton/milton.jar
+milton.templates=${controls.test.dir}/webapps/common/milton
 
 crimson.jar=${external.dir}/crimson/crimson-1.1.jar
 jakarta.jar=${external.dir}/jakarta/jakarta-regexp-1.2.jar

Modified: incubator/beehive/trunk/controls/test/webapps/build.xml
==============================================================================
--- incubator/beehive/trunk/controls/test/webapps/build.xml     (original)
+++ incubator/beehive/trunk/controls/test/webapps/build.xml     Tue Oct  5 
14:26:51 2004
@@ -15,10 +15,7 @@
 
     <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 file="../common/path.properties"/>
     
     <property name="webapp.name" value="controlsWeb"/>
     <property name="webapp.waitfor.url" 
value="http://localhost:8080/${webapp.name}"/>
@@ -44,59 +41,161 @@
     <echo message="" />
    </target>
 
+    <target name="-init">
+
+        <property name="staging.dir" location="stage"/>
+        <property name="webapp.dir" location="${staging.dir}/${webapp.name}"/>
+       
+        <available file="${webapp.dir}" property="webapp.dir.present"/>
+
+        <mkdir dir="${staging.dir}"/>
+
+        <property file="${webapp.name}/app.properties"/>
+
+        <condition property="do.inject.netui">
+           <istrue value="${app.inject.netui}"/>
+        </condition>
+        <condition property="do.inject.milton">
+           <istrue value="${app.inject.milton}"/>
+        </condition>
+        <condition property="do.inject.test.controls">
+           <isset property="app.inject.test.controls"/>
+        </condition>
+        <condition property="do.inject.test.controls.src">
+           <equals arg1="${app.inject.test.controls}" arg2="src"/>
+        </condition>
+        <condition property="do.inject.test.controls.jar">
+           <equals arg1="${app.inject.test.controls}" arg2="jar"/>
+        </condition>
+        <condition property="do.inject.test.drivers">
+           <isset property="app.inject.test.drivers"/>
+        </condition>
+        <condition property="do.inject.test.drivers.src">
+           <equals arg1="${app.inject.test.drivers}" arg2="src"/>
+        </condition>
+        <condition property="do.inject.test.drivers.jar">
+           <equals arg1="${app.inject.test.drivers}" arg2="jar"/>
+        </condition>
+    </target>
+
     <!-- ================================================================ -->
     <!--                                                                  -->
     <!-- Targets for building a webapp                                    -->
     <!--                                                                  -->
     <!-- ================================================================ -->
-    <target name="build" description="Build webapp">
+    <target name="build" description="Build webapp" depends="-init">
         <echo message="-----------------------------------------------------"/>
         <echo message="|    Beehive Controls controlsWeb build starting    |"/>
         <echo message="-----------------------------------------------------"/>
 
-        <!--property name="webapp.dir" 
location="C:/beehive/work_dir/controls/test/webapps/${webapp.name}"/-->
-        <property name="webapp.dir" location="./${webapp.name}"/>
-
-       <ant antfile="${deployNetui.ant}" target="deploy.netui" 
inheritAll="false">
-               <property name="webapp.dir" value="${webapp.dir}" />
-       </ant>
+        <!-- webapps are copied into a staging directory where additional 
build steps 
+             can be performed -->
+        <copy todir="${staging.dir}/${webapp.name}" overwrite="true">
+           <fileset dir="${webapp.name}"/>
+        </copy>
+
+        <antcall target="-inject.netui"/>
+        <antcall target="-inject.milton"/>
+        <antcall target="-inject.test.controls"/>
+        <antcall target="-inject.test.drivers"/>
+        <antcall target="-build.webapp"/>
 
-        <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}"/-->
+        <echo message="----------------------------------------------"/>
+        <echo message="|     Controls controlsWeb build ending      |"/>
+        <echo message="----------------------------------------------"/>
+    </target>
 
+    <target name="-build.webapp">
         <ant antfile="${buildWebapp.ant}" target="build.webapp" 
inheritAll="false">
             <property name="webapp.dir" location="${webapp.dir}"/>
         </ant>
+    </target>
+
+    <target name="-inject.netui" if="do.inject.netui">
+        <echo message="Injecting Netui in ${webapp.name}"/>
+        <ant antfile="${deployNetui.ant}" target="deploy.netui" 
inheritAll="false">
+           <property name="webapp.dir" value="${webapp.dir}" />
+        </ant>
 
-        <echo message="----------------------------------------------"/>
-        <echo message="|     Controls controlsWeb build ending      |"/>
-        <echo message="----------------------------------------------"/>
+        <copy file="${webapp.dir}/WEB-INF/local-netui-config.xml" 
+              tofile="${webapp.dir}/WEB-INF/${netuiconfig.xml.name}" 
+              overwrite="true" failonerror="false"/>
+    </target>
+
+    <target name="-inject.milton" if="do.inject.milton">
+        <echo message="Injecting ${milton.jar} to ${webapp.name}"/>
+        <mkdir dir="${webapp.dir}/WEB-INF/lib"/>
+
+        <copy file="${milton.jar}" todir="${webapp.dir}/WEB-INF/lib" 
+              overwrite="true" verbose="true"/>
+
+        <copy todir="${webapp.dir}/WEB-INF" verbose="true" overwrite="true">
+            <fileset dir="${milton.templates}">
+                <include name="src/**"/>
+            </fileset>
+        </copy>
+
+        <copy todir="${webapp.dir}" verbose="true" overwrite="true">
+            <fileset dir="${milton.templates}">
+                <include name="resources/**"/>
+            </fileset>
+        </copy>
+    </target>
+ 
+    <target name="-inject.test.controls" if="do.inject.test.controls">
+        <antcall target="-inject.test.controls.src"/>
+        <antcall target="-inject.test.controls.jar"/>
+    </target>
+
+    <target name="-inject.test.controls.src" if="do.inject.test.controls.src">
+        <echo message="Injecting Controls Source"/>
+        <copy todir="${webapp.dir}/WEB-INF/src" verbose="true" 
overwrite="true">
+            <fileset dir="${controls.test.controls}">
+                <include name="*/**"/>
+                <exclude name="*/.svn/**"/>
+            </fileset>
+        </copy>
+    </target>
+
+    <target name="-inject.test.controls.jar" if="do.inject.test.controls.jar">
+        <echo message="Injecting Controls Jar"/>
+        <copy todir="${webapp.dir}/WEB-INF/lib" 
+              file="${controlstestbeans.jar}" verbose="true" 
+              overwrite="true"/>
+    </target>
+
+    <target name="-inject.test.drivers" if="do.inject.test.drivers">
+        <antcall target="-inject.test.drivers.src"/>
+        <antcall target="-inject.test.drivers.jar"/>
+    </target>
+    
+    <target name="-inject.test.drivers.src" if="do.inject.test.drivers.src">
+        <echo message="Injecting Drivers Source"/>
+        <copy todir="${webapp.dir}/WEB-INF/src" overwrite="true" 
verbose="true">
+            <fileset dir="${controls.test.drivers}">
+                <include name="*/**"/>
+                <exclude name="*/.svn/**"/>
+            </fileset>
+        </copy>
+    </target>
+
+    <target name="-inject.test.drivers.jar" if="do.inject.test.drivers.jar">
+        <echo message="Injecting Drivers Jar"/>
+        <copy todir="${webapp.dir}/WEB-INF/lib" 
+              file="${controlstestdrivers.jar}" 
+              verbose="true" overwrite="true"/>
     </target>
 
-    <!-- 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">
+    <target name="clean" description="Clean webapp" depends="-init" 
if="webapp.dir.present">
         <echo message="----------------------------------------------"/>
         <echo message="|     Controls controlsWeb clean starting    |"/>
         <echo message="----------------------------------------------"/>
 
         <ant antfile="${deployNetui.ant}" target="undeploy.netui" 
inheritAll="false">
-            <property name="webapp.dir" location="./${webapp.name}"/>
-        </ant>
-        <ant antfile="${deployNetui.ant}" target="clean.webapp" 
inheritAll="false">
-            <property name="webapp.dir" location="./${webapp.name}"/>
+            <property name="webapp.dir" location="${webapp.dir}"/>
         </ant>
 
-        <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="****************************************************"/>
+        <delete dir="${staging.dir}"/>
 
         <echo message="----------------------------------------------"/>
         <echo message="|     Controls controlsWeb clean ending      |"/>
@@ -110,60 +209,13 @@
 
     <!-- ================================================================ -->
     <!--                                                                  -->
-    <!-- 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>
-
-    <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>
-
-    <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>
-
-    <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>
-
-    <!-- ================================================================ -->
-    <!--                                                                  -->
     <!-- Targets for deploying the webapp on a server                     -->
     <!--                                                                  -->
     <!-- ================================================================ -->
-    <target name="deploy" description="Deploy webapp">
+    <target name="deploy" description="Deploy webapp" depends="-init">
         <ant antfile="${runTomcat.ant}" target="deploy" inheritAll="false">
-            <property name="context.path" value="${webapp.name}"/>
-            <property name="webapp.root" value="${basedir}/${webapp.name}"/>
+            <property name="context.path" value="${webapp.name}"/> <!-- whats 
this for? -->
+            <property name="webapp.root" value="${webapp.dir}"/>
         </ant>
     </target>
 
@@ -206,16 +258,6 @@
 
     <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 -->

Added: incubator/beehive/trunk/controls/test/webapps/controlsWeb/app.properties
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/controls/test/webapps/controlsWeb/app.properties    
Tue Oct  5 14:26:51 2004
@@ -0,0 +1,5 @@
+app.inject.netui: true
+app.inject.milton: true
+### these two can be set to 'jar' or 'src' ###
+app.inject.test.drivers: jar
+app.inject.test.controls: jar

Reply via email to