Author: bryanche
Date: Tue Mar  8 11:49:30 2005
New Revision: 156561

URL: http://svn.apache.org/viewcvs?view=rev&rev=156561
Log:
Enable Beeive DRT and other tests to run with app servers besides just
Tomcat.  Also, fixes a bug in
controls/test/webapps/controlsWeb/WEB-INF/web.xml.  

To run with a different app server, create a
ant/${servlet.runtime}-imports.xml file for that server and edit the
servlet.runtime property in beehive-imports.xml to point to that file.
This submit includes a jonas-imports.xml file for running beehive with
jonas.

I successfully ran the DRT and controls perf tests with these changes.

Added:
    incubator/beehive/trunk/ant/jonas-imports.xml   (with props)
Modified:
    incubator/beehive/trunk/ant/buildWebapp.xml
    incubator/beehive/trunk/build.xml
    incubator/beehive/trunk/controls/test/build.xml
    incubator/beehive/trunk/controls/test/perf/build.xml
    incubator/beehive/trunk/controls/test/perf/webapps/build.xml
    incubator/beehive/trunk/controls/test/webapps/build.xml
    incubator/beehive/trunk/controls/test/webapps/controlsWeb/WEB-INF/web.xml
    incubator/beehive/trunk/netui/test/webapps/drt/build.xml
    incubator/beehive/trunk/netui/test/webapps/urlTemplates/build.xml

Modified: incubator/beehive/trunk/ant/buildWebapp.xml
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/ant/buildWebapp.xml?view=diff&r1=156560&r2=156561
==============================================================================
--- incubator/beehive/trunk/ant/buildWebapp.xml (original)
+++ incubator/beehive/trunk/ant/buildWebapp.xml Tue Mar  8 11:49:30 2005
@@ -13,12 +13,6 @@
         <available property="webapp.dir.available" file="${webapp.dir}" 
type="dir"/>
         <fail unless="webapp.dir.available" message="Can't find the webapp 
directory ${webapp.dir}"/>
 
-        <path id="appserver.build.classpath">
-            <fileset dir="${tomcat.home}/common/lib">
-                <include name="*.jar"/>
-            </fileset>
-        </path>
-
         <!-- this is the classpath to include when building webapp sources -->
         <path id="webapp.build.classpath">
             <pathelement location="${webapp.dir}/WEB-INF/classes"/>

Added: incubator/beehive/trunk/ant/jonas-imports.xml
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/ant/jonas-imports.xml?view=auto&rev=156561
==============================================================================
--- incubator/beehive/trunk/ant/jonas-imports.xml (added)
+++ incubator/beehive/trunk/ant/jonas-imports.xml Tue Mar  8 11:49:30 2005
@@ -0,0 +1,107 @@
+<?xml version="1.0"?>
+
+<project name="jonas-imports" default="" basedir=".">
+
+    <property environment="os"/>
+    <property name="jonas.root" location="${os.JONAS_ROOT}"/>
+    <property name="jonas.deploy.dir" location="${jonas.root}/webapps"/>
+
+    <!-- Properties used to run JOnAS -->
+
+    <path id="appserver.build.classpath">
+        <fileset dir="${jonas.root}/lib/catalina/common/lib">
+            <include name="*.jar"/>
+        </fileset>
+    </path>
+
+    <target name="deploy" description="Deploy a webapp to a running Jonas 
server">
+        <fail unless="context.path" message="Can't deploy webapp; the value 
${context.path} was unspecified"/>
+        <fail unless="webapp.dir" message="Can't deploy webapp; the value 
${webapp.dir} was unspecified"/>
+
+        <available property="webapp.available" file="${webapp.dir}" 
type="dir"/>
+        <fail unless="webapp.available" message="The webapp at ${webapp.dir} 
does not exist."/>
+
+        <echo>deploy webapp from ${webapp.dir} with context path 
${context.path}</echo>
+
+        <jar destfile="${jonas.deploy.dir}/${context.path}.war"
+             basedir="${webapp.dir}" />
+
+        <echo>deploying via jonas admin</echo>
+        <exec os="Windows 2000,Windows 2003,Windows XP" 
dir="${jonas.root}\bin\nt" executable="jonas.bat">
+            <env key="JONAS_ROOT" value="${jonas.root}"/>
+            <arg line="/c jonas.bat admin -a ${context.path}.war"/>
+        </exec>
+        <exec os="Linux,SunOS,Solaris,Mac OS X" dir="${jonas.root}/bin/unix" 
executable="sh">
+            <env key="JONAS_ROOT" value="${jonas.root}"/>
+            <arg line="jonas admin -a ${context.path}.war"/>
+       </exec>
+
+    </target>
+
+    <target name="undeploy" description="Undeploy a webapp running on a Jonas 
server">
+        <fail unless="context.path" message="Can't undeploy webapp; the
+        value ${context.path} was unspecified"/>
+
+        <echo>undeploying via jonas admin</echo>
+        <exec os="Windows 2000,Windows 2003,Windows XP" 
dir="${jonas.root}\bin\nt" executable="jonas.bat">
+            <env key="JONAS_ROOT" value="${jonas.root}"/>
+            <arg line="/c jonas.bat admin -r ${context.path}.war"/>
+        </exec>
+        <exec os="Linux,SunOS,Solaris,Mac OS X" dir="${jonas.root}/bin/unix" 
executable="sh">
+            <env key="JONAS_ROOT" value="${jonas.root}"/>
+            <arg line="jonas admin -r ${context.path}.war"/>
+       </exec>
+
+        <delete file="${jonas.deploy.dir}/${context.path}.war" />
+    </target>
+
+    <target name="redeploy" description="Redeploy a webapp already running on 
a JOnAS server">
+        <antcall target="undeploy" />
+        <antcall target="deploy" />
+    </target>
+
+    <target name="start" description="Start a Jonas instance.">
+
+        <condition property="cmdline.options" value="">
+            <not><isset property="cmdline.options"/></not>
+        </condition>
+
+        <condition property="java.options" value="">
+            <not><isset property="java.options"/></not>
+        </condition>
+
+        <echo>startup.dir: ${jonas.root}</echo>
+        <echo>cmdline.options: ${cmdline.options}</echo>
+        <echo>java.options: ${java.options}</echo>
+
+        <echo>Start Jonas</echo>
+        <exec os="Windows 2000,Windows 2003,Windows XP" 
dir="${jonas.root}\bin\nt" executable="jonas.bat">
+            <env key="JONAS_ROOT" value="${jonas.root}"/>
+            <env key="JAVA_OPTS" value="${java.options}"/>
+            <arg line="/c jonas.bat start ${cmdline.options}"/>
+        </exec>
+        <exec os="Linux,SunOS,Solaris,Mac OS X" spawn="true" 
dir="${jonas.root}/bin/unix" executable="sh">
+            <env key="JONAS_ROOT" value="${jonas.root}"/>
+            <env key="JAVA_OPTS" value="${java.options}"/>
+            <arg line="jonas start ${cmdline.options}"/>
+       </exec>
+    </target>
+
+    <target name="start.with.shmem" description="Start a JOnAS instance with 
shared memory debugging.">
+        <echo>shmem is not an option for JOnAS.  starting normally...</echo>
+        <antcall target="start" />
+    </target>
+
+    <target name="stop" description="Stop the NetUI server">
+        <echo>Stop Jonas in: ${jonas.root}</echo>
+        <exec os="Windows 2000,Windows 2003,Windows XP" 
dir="${jonas.root}\bin\nt" executable="jonas.bat">
+            <env key="JONAS_ROOT" value="${jonas.root}"/>
+            <arg line="/c jonas.bat stop"/>
+        </exec>
+        <exec os="Linux,SunOS,Solaris,Mac OS X" dir="${jonas.root}/bin/unix" 
executable="sh">
+            <env key="JONAS_ROOT" value="${jonas.root}"/>
+            <arg line="jonas stop"/>
+       </exec>
+    </target>
+
+</project>
\ No newline at end of file

Propchange: incubator/beehive/trunk/ant/jonas-imports.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/beehive/trunk/build.xml
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/build.xml?view=diff&r1=156560&r2=156561
==============================================================================
--- incubator/beehive/trunk/build.xml (original)
+++ incubator/beehive/trunk/build.xml Tue Mar  8 11:49:30 2005
@@ -223,6 +223,7 @@
               message="The classes in junit.jar do not seem to be available.  
Please ensure junit.jar is available in ${os.ANT_home}/lib"/>
         <echo>junit.jar appears to be available since the class 
"junit.framework.TestCase" was successfully loaded</echo>
 
+
         <!-- note, to ease the transition when removing Tomcat from the build, 
this will check a hard reference to CATALINA_HOME -->
         <available file="${os.CATALINA_HOME}" type="dir" 
property="tomcat.available"/>
         <fail unless="tomcat.available" 

Modified: incubator/beehive/trunk/controls/test/build.xml
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/controls/test/build.xml?view=diff&r1=156560&r2=156561
==============================================================================
--- incubator/beehive/trunk/controls/test/build.xml (original)
+++ incubator/beehive/trunk/controls/test/build.xml Tue Mar  8 11:49:30 2005
@@ -60,9 +60,9 @@
        <os family="unix" />
     </condition>
         
-    <condition property="do.start.tomcat" value="true" >
+    <condition property="do.start.appserver" value="true" >
        <not>
-           <isset  property="start.tomcat"/>
+           <isset  property="start.appserver"/>
        </not>
     </condition>
 
@@ -370,7 +370,7 @@
         <antcall target="clean" />
         <antcall target="build" />
         <antcall target="run" />
-        <echo message="${do.start.tomcat}"/>
+        <echo message="${do.start.appserver}"/>
         <property name="test.freq" value="checkin"/>
         <antcall target="run.test" />
     </target>
@@ -384,11 +384,11 @@
     
     <target name="run.test">
        <parallel>
-                       <echo message="start a new thread to build 
controlsWeb"/>
-               <antcall target="tomcat.start"/>
+               <echo message="start a new thread to build controlsWeb"/>
+                <start-server shmem="false" javaOptions=""/>
                <sequential>
                        <antcall target="build-test-webapp" />
-                       <echo message="continue the new thread, wait for tomcat 
to start"/>
+                       <echo message="continue the new thread, wait for app 
server to start"/>
                        <sleep seconds="20"/>
                        <echo message="continue the new thread, deploy 
controlsWeb"/>
                        <ant dir ="./webapps" antfile="build.xml" 
target="ensure.deployed"/>
@@ -396,29 +396,12 @@
                        <antcall target="run"/>
                        <ant dir ="./webapps" antfile="build.xml" 
target="undeploy"/>
                        <echo message="continue the new thread, undeploy 
controlsWeb"/>
-                       <echo message="stop tomcat server, finish the new 
thread"/>
-            <antcall target="tomcat.stop"/>
+                       <echo message="stop app server, finish the new thread"/>
+                <stop-server />
                </sequential>
         </parallel>
     </target>   
 
-  <!-- =========================================================== -->
-  <!-- target to start Tomcat server -->
-  <!-- =========================================================== -->
-
-    <target name="tomcat.start">
-       <echo message="starting tomcat"/>
-       <ant dir ="./webapps" antfile="build.xml" target="start"/>
-    </target>
-
-  <!-- =========================================================== -->
-  <!-- target to stop Tomcat server -->
-  <!-- =========================================================== -->
-
-    <target name="tomcat.stop">
-       <echo message="stopping tomcat"/>
-       <ant dir ="./webapps" antfile="build.xml" target="stop"/>
-    </target>
 
   <!-- =========================================================== -->
   <!-- targets to run junit tests -->
@@ -441,7 +424,7 @@
         <property name="gtlf.dtd.local" 
value="infra/gtlf/gtlf-config-2.0.dtd"/>
 
         <property name="test.hostname" value="${hostname}" />
-        <property name="test.hostname.port" value="8080" /> <!-- tomcat 
default port -->
+        <property name="test.hostname.port" value="8080" /> <!-- app server 
default port -->
         <property name="test-suite" value="${mantis.tch.srcgen.dir}/root.xml"/>
         <property name="tch.base-logfile-name" value="tch"/>
 

Modified: incubator/beehive/trunk/controls/test/perf/build.xml
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/controls/test/perf/build.xml?view=diff&r1=156560&r2=156561
==============================================================================
--- incubator/beehive/trunk/controls/test/perf/build.xml (original)
+++ incubator/beehive/trunk/controls/test/perf/build.xml Tue Mar  8 11:49:30 
2005
@@ -241,15 +241,15 @@
                <antcall target="run_client"/>
        </target>
 
-       <!-- run targets that start tomcat, buid/deploy webapp, run tests and 
then undeploy/stop -->    
+       <!-- run targets that start the app server, buid/deploy webapp, run 
tests and then undeploy/stop -->    
   <target name="checkin.tests">
                <parallel>
-                       <echo message="start a new thread to build controlsWeb 
and start/deploy tomcat"/>
+                       <echo message="start a new thread to build controlsWeb 
and start/deploy app server"/>
        <ant antfile="webapps/build.xml" target="start"/>
                        <sequential>
                                <ant antfile="webapps/build.xml" target="clean" 
/>
                                <ant antfile="webapps/build.xml" target="build" 
/>
-                               <echo message="sleep to allow tomcat to become 
available for deployment"/>
+                               <echo message="sleep to allow app server to 
become available for deployment"/>
                                <sleep seconds="20"/>
                                <echo message="continue the new thread, deploy 
controlsPerfWeb"/>
                                <ant antfile="webapps/build.xml" 
target="ensure.deployed"/>
@@ -257,7 +257,7 @@
                                <antcall target="checkin.tests.client"/>
                                <echo message="continue the new thread, 
undeploy controlsPerfWeb"/>
                                <ant antfile="webapps/build.xml" 
target="undeploy"/>
-                               <echo message="stop tomcat server, finish the 
new thread"/>
+                               <echo message="stop app server, finish the new 
thread"/>
                        <ant antfile="webapps/build.xml" target="stop"/>
                        </sequential>
     </parallel>

Modified: incubator/beehive/trunk/controls/test/perf/webapps/build.xml
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/controls/test/perf/webapps/build.xml?view=diff&r1=156560&r2=156561
==============================================================================
--- incubator/beehive/trunk/controls/test/perf/webapps/build.xml (original)
+++ incubator/beehive/trunk/controls/test/perf/webapps/build.xml Tue Mar  8 
11:49:30 2005
@@ -3,8 +3,8 @@
 ===========================================================================
 
   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.
+  the latest Beehive NETUI artifacts, start/stop app server, and deploy
+  the web application to a started app server.
   
   This project originates from trunk/netui/test/webapps/drt/build.xml for
   code reusing.
@@ -18,7 +18,6 @@
 
     <property name="controls.perf.root" 
value="${beehive.home}/controls/test/perf"/> 
     <property name="buildWebapp.xml" 
value="${beehive.home}/test/ant/buildWebapp.xml"/> 
-    <property name="runTomcat.xml" 
value="${beehive.home}/test/ant/runTomcat.xml"/> 
     <property name="webapp.stage.dir" 
value="${controls.perf.root}/webapps/stage"/>
     <property name="webapp.name" value="controlsPerfWeb"/>
     <property name="webapp.dir" 
location="${controls.perf.root}/webapps/${webapp.name}"/>
@@ -42,9 +41,9 @@
     <echo message="build       - inject latest netui artifacts and build 
${webapp.name}, " />
     <echo message="              includes compiling controls in the webapp     
       "/>
     <echo message="clean       - clean ${webapp.name}"/>
-    <echo message="start       - start Tomcat server"/>
-    <echo message="stop        - stop Tomcat server"/>
-    <echo message="deploy      - deploys built webapp to a started Tomcat" />
+    <echo message="start       - start app server"/>
+    <echo message="stop        - stop app server"/>
+    <echo message="deploy      - deploys built webapp to a started app" />
     <echo message="" />
     <echo message="" />
    </target>
@@ -149,12 +148,6 @@
         <echo message="----------------------------------------------"/>
     </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>
-
-
     <!-- ================================================================ -->
     <!--                                                                  -->
     <!-- Targets for deploying the webapp on a server                     -->
@@ -185,7 +178,6 @@
         <stop-server/>
     </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>
 
@@ -210,12 +202,7 @@
 
     <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>
+        <re-webapp contextPath="${webapp.name}"/>
 
         <waitfor maxwait="120" maxwaitunit="second" 
timeoutproperty="still.unavailable">
             <http url="${webapp.waitfor.url}"/>

Modified: incubator/beehive/trunk/controls/test/webapps/build.xml
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/controls/test/webapps/build.xml?view=diff&r1=156560&r2=156561
==============================================================================
--- incubator/beehive/trunk/controls/test/webapps/build.xml (original)
+++ incubator/beehive/trunk/controls/test/webapps/build.xml Tue Mar  8 11:49:30 
2005
@@ -3,8 +3,8 @@
 ===========================================================================
 
   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.
+  the latest Beehive NETUI artifacts, start/stop app server, and deploy
+  the web application to a started app server.
   
 ============================================================================ 
 -->
@@ -32,9 +32,9 @@
     <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="start       - start app server"/>
+    <echo message="stop        - stop app server"/>
+    <echo message="deploy      - deploys a built webapp to a started app" />
     <echo message="" />
     <echo message="" />
    </target>
@@ -231,11 +231,6 @@
         <echo message="----------------------------------------------"/>
         <echo message="|     Controls ${controls.test.webapp.name} clean 
ending      |"/>
         <echo message="----------------------------------------------"/>
-    </target>
-
-    <target name="scrub" depends="clean" description="Scrub webapp">
-        <delete 
dir="${tomcat.dir}/work/Catalina/localhost/${controls.test.webapp.name}" 
includeEmptyDirs="true"/>
-        <delete 
file="${tomcat.dir}/conf/Catalina/localhost/${controls.test.webapp.name}.xml"/>
     </target>
 
     <!-- ================================================================ -->

Modified: 
incubator/beehive/trunk/controls/test/webapps/controlsWeb/WEB-INF/web.xml
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/controls/test/webapps/controlsWeb/WEB-INF/web.xml?view=diff&r1=156560&r2=156561
==============================================================================
--- incubator/beehive/trunk/controls/test/webapps/controlsWeb/WEB-INF/web.xml 
(original)
+++ incubator/beehive/trunk/controls/test/webapps/controlsWeb/WEB-INF/web.xml 
Tue Mar  8 11:49:30 2005
@@ -58,7 +58,6 @@
 
   <servlet>
     <servlet-name>AxisServlet</servlet-name>
-    <display-name>Apache-Axis Servlet</display-name>
     <servlet-class>
         org.apache.axis.transport.http.AxisServlet
     </servlet-class>
@@ -66,7 +65,6 @@
 
   <servlet>
     <servlet-name>AdminServlet</servlet-name>
-    <display-name>Axis Admin Servlet</display-name>
     <servlet-class>
         org.apache.axis.transport.http.AdminServlet
     </servlet-class>
@@ -75,7 +73,6 @@
 
   <servlet>
     <servlet-name>SOAPMonitorService</servlet-name>
-    <display-name>SOAPMonitorService</display-name>
     <servlet-class>
         org.apache.axis.monitor.SOAPMonitorService
     </servlet-class>

Modified: incubator/beehive/trunk/netui/test/webapps/drt/build.xml
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/build.xml?view=diff&r1=156560&r2=156561
==============================================================================
--- incubator/beehive/trunk/netui/test/webapps/drt/build.xml (original)
+++ incubator/beehive/trunk/netui/test/webapps/drt/build.xml Tue Mar  8 
11:49:30 2005
@@ -3,11 +3,11 @@
 <!-- 
 ================================================================
 
-  This project is a test of using the test recorder against a
-  Tomcat web application.  Below are targets that show how 
-  the test recorder runs against Tomcat for running a test suite 
-  against a running server, a test suite without the server running,
-  and a set of named tests against a running server.
+  This project is a test of using the test recorder against a web
+  application.  Below are targets that show how the test recorder runs
+  against an app server for running a test suite against a running
+  server, a test suite without the server running, and a set of named
+  tests against a running server.
 
 ================================================================ 
 -->
@@ -79,11 +79,6 @@
         <echo message="--------------------------------------------------"/>
         <echo message="|     NetUI coreWeb DRT webapp clean ending      |"/>
         <echo message="--------------------------------------------------"/>
-    </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>
 
     <!-- ================================================================ -->

Modified: incubator/beehive/trunk/netui/test/webapps/urlTemplates/build.xml
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/urlTemplates/build.xml?view=diff&r1=156560&r2=156561
==============================================================================
--- incubator/beehive/trunk/netui/test/webapps/urlTemplates/build.xml (original)
+++ incubator/beehive/trunk/netui/test/webapps/urlTemplates/build.xml Tue Mar  
8 11:49:30 2005
@@ -68,12 +68,6 @@
         <echo message="--------------------------------------------------"/>
     </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>
-
     <!-- ================================================================ -->
     <!--                                                                  -->
     <!-- Targets for running test recorder test suites                    -->


Reply via email to