harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject svn commit: r629382 - in /harmony/enhanced/buildtest/branches/2.0/adaptors: struts_test/adaptor.xml tomcat-scenario/adaptor.xml
Date Wed, 20 Feb 2008 08:06:58 GMT
Author: ayza
Date: Wed Feb 20 00:06:55 2008
New Revision: 629382

URL: http://svn.apache.org/viewvc?rev=629382&view=rev
Log:
Patch for Struts and Tomcat BTI scenarios. It allows each of these scenarios to use separate
CATALINA_BASE folder while running to store config files, logs and other artifacts. This prevents
these scenarios from blocking each other. See HARMONY-5535.

Modified:
    harmony/enhanced/buildtest/branches/2.0/adaptors/struts_test/adaptor.xml
    harmony/enhanced/buildtest/branches/2.0/adaptors/tomcat-scenario/adaptor.xml

Modified: harmony/enhanced/buildtest/branches/2.0/adaptors/struts_test/adaptor.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/buildtest/branches/2.0/adaptors/struts_test/adaptor.xml?rev=629382&r1=629381&r2=629382&view=diff
==============================================================================
--- harmony/enhanced/buildtest/branches/2.0/adaptors/struts_test/adaptor.xml (original)
+++ harmony/enhanced/buildtest/branches/2.0/adaptors/struts_test/adaptor.xml Wed Feb 20 00:06:55
2008
@@ -28,10 +28,11 @@
     <property name="tests.results.dir" location="${results.dir}/${suite.name}/test-results"/>
 
     <property name="catalina.localhost.port.default" value="8080" />
-    <property name="catalina.config.file"  location="${ext.tomcat-6.0.14.location}/conf/server.xml"/>
-    <property name="catalina.base.dir" location="${ext.tomcat-6.0.14.location}"/>
     <property name="catalina.home.dir" location="${ext.tomcat-6.0.14.location}"/>
-    <property name="catalina.tmp.dir"  location="${ext.tomcat-6.0.14.location}/temp"/>
+    <property name="catalina.base.dir"
+              location="${catalina.home.dir}/bases/struts_test"/>
+    <property name="catalina.config.file"  location="${catalina.base.dir}/conf/server.xml"/>
+    <property name="catalina.tmp.dir"  location="${catalina.base.dir}/temp"/>
     <property name="catalina.out.file" location="${results.dir}/${suite.name}/catalina.out"/>
     <property name="catalina.maxwait" value="1800"/>
 
@@ -46,6 +47,7 @@
           target: setup
          ================================= -->
     <target name="setup" depends="
+        -prepare-base-dir,
         -setup-conditions,
         -create-build-dirs,
         -compile-test-sources,
@@ -78,15 +80,29 @@
           Private targets
          ================================= -->
 
+    <target name="-prepare-base-dir">
+        <mkdir dir="${catalina.base.dir}/conf"/>
+        <mkdir dir="${catalina.base.dir}/logs"/>
+        <mkdir dir="${catalina.base.dir}/shared"/>
+        <mkdir dir="${catalina.base.dir}/webapps"/>
+        <mkdir dir="${catalina.base.dir}/temp"/>
+        <mkdir dir="${catalina.base.dir}/work"/>
+        <copy todir="${catalina.base.dir}/conf">
+            <fileset dir="${catalina.home.dir}/conf"
+                     includes="*.xml, *.properties, *.policy">
+            </fileset>
+        </copy>
+    </target>
+
     <!-- - - - - - - - - - - - - - - - - - 
           target: -setup-conditions                      
          - - - - - - - - - - - - - - - - - -->
     <target name="-setup-conditions">
         <condition property="already-deployed" >
-            <available file="${catalina.home.dir}/webapps/${tomcat.deploy.app.name}" type="dir"/>
+            <available file="${catalina.base.dir}/webapps/${tomcat.deploy.app.name}" type="dir"/>
         </condition>
         <condition property="data-generation-not-needed">
-            <available file="${catalina.home.dir}/work/Catalina/localhost/${tomcat.deploy.app.name}/org/apache/jsp/validation"
type="dir" />
+            <available file="${catalina.base.dir}/work/Catalina/localhost/${tomcat.deploy.app.name}/org/apache/jsp/validation"
type="dir" />
         </condition>
         <condition property="already-deployed-and-generated">
             <and>
@@ -151,7 +167,7 @@
             <sequential>
                 <antcall target="-wait-for-server-started" />
                 <condition property="deployed.ok">
-                    <available file="${catalina.home.dir}/webapps/${tomcat.deploy.app.name}"
type="dir" />
+                    <available file="${catalina.base.dir}/webapps/${tomcat.deploy.app.name}"
type="dir" />
                 </condition>
                 <antcall target="-generate-test-data" />
                 <antcall target="-stop-server-for-setup" />
@@ -275,7 +291,7 @@
          - - - - - - - - - - - - - - - - - -->
     <target name="-copy-war">
         <copy file="${ext.struts-2.0.6.location}/apps/${tomcat.deploy.app.name}.war"
-             todir="${catalina.home.dir}/webapps" />
+             todir="${catalina.base.dir}/webapps" />
     </target>
 
     <!-- - - - - - - - - - - - - - - - - - 
@@ -394,7 +410,7 @@
 
     <path id="catalina-start-jars">
         <pathelement location="${req.driver.java.home}/lib/tools.jar" />
-        <fileset dir="${catalina.base.dir}/bin">
+        <fileset dir="${catalina.home.dir}/bin">
             <include name="**/bootstrap.jar"/>
             <include name="**/commons-logging-api.jar"/>
         </fileset>

Modified: harmony/enhanced/buildtest/branches/2.0/adaptors/tomcat-scenario/adaptor.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/buildtest/branches/2.0/adaptors/tomcat-scenario/adaptor.xml?rev=629382&r1=629381&r2=629382&view=diff
==============================================================================
--- harmony/enhanced/buildtest/branches/2.0/adaptors/tomcat-scenario/adaptor.xml (original)
+++ harmony/enhanced/buildtest/branches/2.0/adaptors/tomcat-scenario/adaptor.xml Wed Feb 20
00:06:55 2008
@@ -22,6 +22,9 @@
 
     <property name="tomcat.results.dir" location="${results.dir}/${suite.name}"/>
     <property name="tomcat.src.dir" location="${checkouts.dir}/tomcat-scenario" />
+    <property name="catalina.home.dir" location="${ext.tomcat.location}"/>
+    <property name="catalina.base.dir"
+              location="${catalina.home.dir}/bases/tomcat-scenario"/>
     <property environment="env"/>
 
     <condition property="shell" value="cmd" else="sh">
@@ -43,12 +46,12 @@
               value="http://localhost:${tomcat-scenario.parameters.optional.port.number}/examples/jsp/jsp2/el/basic-comparisons.jsp"/>
 
     <!-- Setup of the Tomcat scenario -->
-    <target name="setup">
+    <target name="setup" depends="-prepare-base-dir">
         
         <!--
             Setup port number for Tomcat server
         -->
-        <replaceregexp file="${ext.tomcat.location}/conf/server.xml"
+        <replaceregexp file="${catalina.base.dir}/conf/server.xml"
                        match="port=\&quot;.*\&quot; protocol=\&quot;HTTP(.*)\&quot;"
                        replace="port=\&quot;${tomcat-scenario.parameters.optional.port.number}\&quot;
protocol=\&quot;HTTP\1\&quot;"
                        flags="g" byline="true"/>
@@ -61,10 +64,31 @@
             Make Tomcat startup scripts executable
         -->
         <chmod perm="a+x">
-            <fileset dir="${ext.tomcat.location}/bin" includes="*.sh"/>
+            <fileset dir="${catalina.home.dir}/bin" includes="*.sh"/>
         </chmod>
 
     </target>
+
+    <!-- Prepare CATALINA_BASE dir for running server tomcat instance -->    
+    <target name="-prepare-base-dir">
+        <mkdir dir="${catalina.base.dir}/conf"/>
+        <mkdir dir="${catalina.base.dir}/logs"/>
+        <mkdir dir="${catalina.base.dir}/shared"/>
+        <mkdir dir="${catalina.base.dir}/webapps"/>
+        <mkdir dir="${catalina.base.dir}/temp"/>
+        <mkdir dir="${catalina.base.dir}/work"/>
+        <copy todir="${catalina.base.dir}/conf">
+            <fileset dir="${catalina.home.dir}/conf"
+                     includes="*.xml, *.properties, *.policy">
+            </fileset>
+        </copy>
+        <copy todir="${catalina.base.dir}/webapps/ROOT">
+            <fileset dir="${catalina.home.dir}/webapps/ROOT"/>
+        </copy>
+        <copy todir="${catalina.base.dir}/webapps/examples">
+            <fileset dir="${catalina.home.dir}/webapps/examples"/>
+        </copy>
+    </target>
     
     <target name="run" depends="clean">
 
@@ -75,11 +99,13 @@
                     Starting Tomcat server
                 -->
                 <exec executable="${shell}"
-                      dir="${ext.tomcat.location}/bin"
+                      dir="${catalina.home.dir}/bin"
                       spawn="true">
                     <arg line="${start.script}"/>
                     <env key="JRE_HOME" path="${tested.runtime}"/>
                     <env key="JAVA_OPTS" value="${tomcat-scenario.parameters.optional.tested.vm.options}"/>
+                    <env key="CATALINA_HOME" value="${catalina.home.dir}"/>
+                    <env key="CATALINA_BASE" value="${catalina.base.dir}"/>
                     <env key="PATH" path="${tested.runtime}${file.separator}bin${path.separator}${env.PATH}"/>
                 </exec>
 
@@ -91,7 +117,7 @@
                 -->
                 <waitfor maxwait="300" maxwaitunit="second" timeoutproperty="failed.timeout">
                     <length when="greater" length="0">
-                        <fileset dir="${ext.tomcat.location}/logs">
+                        <fileset dir="${catalina.base.dir}/logs">
                             <filename name="catalina*.log"/>
                             <contains text="INFO: Server startup in"/>
                         </fileset>
@@ -115,10 +141,12 @@
                     Stop Tomcat server
                 -->
                 <exec executable="${shell}"
-                      dir="${ext.tomcat.location}/bin">
+                      dir="${catalina.home.dir}/bin">
                     <arg line="${stop.script}"/>
                     <env key="JRE_HOME" path="${tested.runtime}"/>
                     <env key="JAVA_OPTS" value="${tomcat-scenario.parameters.optional.tested.vm.options}"/>
+                    <env key="CATALINA_HOME" value="${catalina.home.dir}"/>
+                    <env key="CATALINA_BASE" value="${catalina.base.dir}"/>
                     <env key="PATH" path="${tested.runtime}${file.separator}bin${path.separator}${env.PATH}"/>
                 </exec>
             </sequential>
@@ -149,7 +177,7 @@
             Removing logs of previous Tomcat run
         -->
         <delete failonerror="false">
-            <fileset dir="${ext.tomcat.location}/logs" includes="*.log"/>
+            <fileset dir="${catalina.base.dir}/logs" includes="*.log"/>
         </delete>
     </target>
 



Mime
View raw message