Author: rich
Date: Tue Mar  8 15:18:33 2005
New Revision: 156583

URL: http://svn.apache.org/viewcvs?view=rev&rev=156583
Log:
Fix for http://issues.apache.org/jira/browse/BEEHIVE-408 : test distribution's 
test recorder config jar contains files that have hard coded paths rather than 
the desired tokens

This is a contribution from Julie Zhuo.

tests: drt in trunk (WinXP)
BB: self (linux)


Modified:
    incubator/beehive/trunk/netui/test/ant/testRecorderCore.xml
    incubator/beehive/trunk/netui/test/dist-test/ant/netui-test.properties
    incubator/beehive/trunk/netui/test/dist-test/ant/testWebBuild.xml
    incubator/beehive/trunk/netui/test/dist-test/build.xml

Modified: incubator/beehive/trunk/netui/test/ant/testRecorderCore.xml
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/ant/testRecorderCore.xml?view=diff&r1=156582&r2=156583
==============================================================================
--- incubator/beehive/trunk/netui/test/ant/testRecorderCore.xml (original)
+++ incubator/beehive/trunk/netui/test/ant/testRecorderCore.xml Tue Mar  8 
15:18:33 2005
@@ -54,6 +54,11 @@
         <echo>drt.mode: ${drt.mode}</echo>
         <echo>drt.cc.mode: ${drt.cc.mode}</echo>
 
+        <condition property="cc.mode" value="true">
+                 <istrue value="${drt.cc.mode}"/>
+        </condition>
+
+
         <!-- set the output flags according to whether the tests are running 
in DRT mode -->
         <condition property="formatter.type" value="plain">
             <and>
@@ -106,7 +111,6 @@
             playback.target == 
      -->
     <target name="server.test" description="Runs Test Recorder regression 
tests">
-
         <echo>Start a NetUI test server</echo>
 
         <parallel>
@@ -154,7 +158,7 @@
  
         app.build.file == 
       -->
-    <target name="stop.server" if="drt.cc.mode">
+    <target name="stop.server" if="cc.mode">
         <echo>Stop the server with the 'stop' target in this build file: 
${app.build.file}</echo>
         <ant target="stop" antfile="${app.build.file}"/>
     </target>

Modified: incubator/beehive/trunk/netui/test/dist-test/ant/netui-test.properties
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/dist-test/ant/netui-test.properties?view=diff&r1=156582&r2=156583
==============================================================================
--- incubator/beehive/trunk/netui/test/dist-test/ant/netui-test.properties 
(original)
+++ incubator/beehive/trunk/netui/test/dist-test/ant/netui-test.properties Tue 
Mar  8 15:18:33 2005
@@ -35,15 +35,15 @@
 
 # Netui test JARs/resources
 testRecorder.config.name=netui-server-drt-config
-_testRecorder.base.dir=${test.dir}/testRecorder
-_testRecorder.resource.dir=${_testRecorder.base.dir}/testRecorder-jsp
+_testRecorder.base.dir=${build.dir}/testRecorder
+testRecorder.dir=${test.dir}/testRecorder
 
 test-recorder.jar.name=testRecorder.jar
-test-recorder.jar=${_testRecorder.base.dir}/lib/${test-recorder.jar.name}
+test-recorder.jar=${testRecorder.dir}/lib/${test-recorder.jar.name}
 
 commons-logging.jar=${webapp.dir}/WEB-INF/lib/commons-logging.jar
 httpClient.jar.name=commons-httpclient-2.0.jar
-httpClient.jar=${_testRecorder.base.dir}/lib/${httpClient.jar.name}
+httpClient.jar=${testRecorder.dir}/lib/${httpClient.jar.name}
 
 drt.testResults.dir=${test.result.root}/netui/drt.testResults
 bvt.testResults.dir=${test.result.root}/netui/bvt.testResults

Modified: incubator/beehive/trunk/netui/test/dist-test/ant/testWebBuild.xml
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/dist-test/ant/testWebBuild.xml?view=diff&r1=156582&r2=156583
==============================================================================
--- incubator/beehive/trunk/netui/test/dist-test/ant/testWebBuild.xml (original)
+++ incubator/beehive/trunk/netui/test/dist-test/ant/testWebBuild.xml Tue Mar  
8 15:18:33 2005
@@ -23,7 +23,8 @@
         <echo message="--------------------------------------------------"/>
         <echo message="|     NetUI test webApp build starting           |"/>
         <echo message="--------------------------------------------------"/>
-      
+
+        <antcall target="prepare.testRecorder"/>     
         <antcall target="update.runtime"/>
         <antcall target="deploy.testrecorder"/>
         <build-webapp webappDir="${webapp.dir}"/>
@@ -33,6 +34,28 @@
         <echo message="--------------------------------------------------"/>
     </target>
 
+       <target name="prepare.testRecorder" description="prepare test recorder 
in the build area">
+               <copy todir="${_testRecorder.base.dir}/config">
+                       <fileset dir="${test.dir}/testRecorder/config"/>
+                       <filterset>
+                <filter token="BASE_DIR" value="${_testRecorder.base.dir}"/>
+                               <filter token="DOMAIN_DIR" value="${test.dir}"/>
+            </filterset>
+               </copy>
+               <antcall target="build.config.jar"/>
+       </target>
+       
+       <target name="build.config.jar" description="Filter and package test 
recorder config jar file">
+        <jar 
jarfile="${_testRecorder.base.dir}/config/${testRecorder.config.name}.jar">
+            <fileset dir="${_testRecorder.base.dir}/config" includes="*.xml"/>
+        </jar>
+        <delete>
+           <fileset dir="${_testRecorder.base.dir}/config" includes="*.xml"/>
+        </delete>
+
+       </target>
+
+
     <target name="deploy.testrecorder" description="Deploy the test recorder 
to the test webapp - coreWeb at this time">
         <echo>Deploying the test recorder to webapp at root: 
${webapp.dir}</echo>
         <ant antfile="${test.dir}/ant/testRecorder.xml" 
target="deployTestRecorder" inheritAll="false"/>
@@ -77,13 +100,10 @@
             <property name="playback.webapps" value="${webapp.name}"/>
             <property name="drt.mode" value="true"/>
             <property name="drt.cc.mode" value="true"/>
-            <property name="formatter.type" value="xml"/>           
-            <property name="formatter.usefile" value="true"/> 
             <property name="test.dir" value="${test.dir}"/>
             <property name="os.CATALINA_HOME" value="${tomcat.dir}"/>
             <property name="dist.home" value="${dist.home}"/>
             <property name="_report.root.dir" 
value="${test.result.root}/netui/testRecorder"/>
-            <property file="${test.dir}/test-dist.properties"/>
         </ant>
     </target>
 
@@ -94,15 +114,13 @@
             <property name="waitfor.url" value="${server.root.url}"/>
             <property name="suite.name" value="bvt"/>
             <property name="playback.webapps" value="${webapp.name}"/>
-            <property name="drt.mode" value="true"/>
-            <property name="drt.cc.mode" value="true"/>
+            <property name="cc.mode" value="true"/>
             <property name="formatter.type" value="xml"/>           
             <property name="formatter.usefile" value="true"/> 
             <property name="test.dir" value="${test.dir}"/>
             <property name="os.CATALINA_HOME" value="${tomcat.dir}"/>
             <property name="dist.home" value="${dist.home}"/>
             <property name="_report.root.dir" 
value="${test.result.root}/netui/testRecorder"/>
-            <property file="${test.dir}/test-dist.properties"/>
         </ant>
     </target>
 

Modified: incubator/beehive/trunk/netui/test/dist-test/build.xml
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/dist-test/build.xml?view=diff&r1=156582&r2=156583
==============================================================================
--- incubator/beehive/trunk/netui/test/dist-test/build.xml (original)
+++ incubator/beehive/trunk/netui/test/dist-test/build.xml Tue Mar  8 15:18:33 
2005
@@ -1,6 +1,6 @@
 <?xml version="1.0"?>
 
-<project name="Beehive/NetUI/BuildTestDist" default="build.test.dist" 
basedir=".">
+<project name="Beehive/NetUI/BuildTestDist" default="usage" basedir=".">
     
     <import file="../ant/test-imports.xml"/>
 
@@ -15,15 +15,19 @@
         <!-- Build the Junit tests -->
         <ant antfile="${test.dir}/ant/build.xml" target="test.build" 
inheritAll="false"/>
 
+       
         <!-- Build testRecorder config jar file  -->
+       <!--
         <ant antfile="${test.dir}/ant/testRecorder.xml" 
target="build.config.jar" inheritAll="false">
             <property name="testRecorder.config.name" 
value="netui-server-drt-config"/>
             <property name="test.file" 
location="${app.dir}/drt/testRecorder/config/testRecorder-tests.xml"/>
             <property name="config.file" 
location="${app.dir}/drt/testRecorder/config/testRecorder-config.xml"/>
             <property name="webapp.file" 
location="${app.dir}/drt/testRecorder/config/testRecorder-webapp.xml"/>
         </ant>
-
+        -->
     </target>
+       
+       
 
     <target name="assemble.tests" description="Assemble all netui tests for 
test distribution">
         <!-- Clean coreWeb -->
@@ -56,8 +60,10 @@
        </copy>
 
        <copy 
todir="${test.dist.base.dir}/beehive-test-dist/netui/testRecorder/config">
-            <fileset dir="${build.dir}/testRecorder/config"/>
+            <fileset dir="${app.dir}/drt/testRecorder/config" 
includes="*.xml"/>
        </copy>
+       
+       <replace 
dir="${test.dist.base.dir}/beehive-test-dist/netui/testRecorder/config" 
token="@DOMAIN_DIR@/drt" value="@DOMAIN_DIR@"/>
 
        <copy 
todir="${test.dist.base.dir}/beehive-test-dist/netui/testRecorder">
             <fileset dir="${build.dir}/tools/testRecorder"/>
@@ -75,5 +81,10 @@
             <fileset dir="${build.dir}/lib" includes="*.tldx"/>
        </copy>
 
+    </target>
+       
+    <target name="usage" description="How to use this build file">
+        <echo message="Build the tests first by build.tests"/>
+       <echo message="Assemble the tests after the tests are being built by 
assemble the tests"/>
     </target>
 </project>


Reply via email to