blob: f64f004982ec6527b4fd346e3b0d23452f302cd5 [file] [log] [blame]
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE project [
<!--
Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
This program and the accompanying materials are made available under the
terms of the Eclipse Public License v. 2.0, which is available at
http://www.eclipse.org/legal/epl-2.0.
This Source Code may also be made available under the following Secondary
Licenses when the conditions for such availability set forth in the
Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
version 2 with the GNU Classpath Exception, which is available at
https://www.gnu.org/software/classpath/license.html.
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-->
<!ENTITY commonBuild SYSTEM "./../../config/common.xml">
]>
<project name="deploydirApp" default="usage" basedir=".">
&commonBuild;
<property name="contextRoot" value="deploydir"/>
<property name="testName" value="deploydir"/>
<target name="prepare" depends="init">
<mkdir dir="${build}/${testName}/WEB-INF/classes"/>
</target>
<target name="compile" depends="prepare">
<javac srcdir="."
destdir="${build}/${testName}/WEB-INF/classes"
debug="on"
failonerror="true">
<classpath refid="gfv3.classpath" />
</javac>
</target>
<target name="assemble" depends="compile">
<copy todir="${build}/${testName}/WEB-INF">
<fileset dir="${basedir}" includes="*web.xml"/>
</copy>
</target>
<target name="redeploydir.asadmin" depends="prepare">
<antcall target="common.redeploydir.asadmin">
<param name="arg.list"
value="${build}/${testName}"/>
</antcall>
</target>
<target name="deploydir.asadmin" depends="prepare">
<antcall target="common.deploydir.asadmin">
<param name="arg.list"
value="${build}/${testName}"/>
</antcall>
</target>
<target name="v3.redeploy.asadmin" depends="prepare">
<antcall target="common.v3.redeploy.asadmin">
<param name="arg.list"
value="--name ${testName} ${build}/${testName}"/>
</antcall>
</target>
<target name="v3.redeploydir.asadmin" depends="prepare">
<antcall target="common.v3.redeploy.asadmin">
<param name="arg.list"
value="--name ${testName}"/>
</antcall>
</target>
<target name="redeploydir.asadmin.foo" depends="prepare">
<antcall target="common.redeploydir.asadmin">
<param name="arg.list"
value="--contextroot foo ${build}/${testName}"/>
</antcall>
</target>
<target name="undeploy.asadmin">
<antcall target="common.undeploy.asadmin">
<param name="arg.list"
value="${testName}"/>
</antcall>
</target>
<target name="run" depends="run.positive"/>
<target name="run.positive" depends="setHttpPort">
<property name="url" value="http://${http.host}:${depltest.port}/${contextRoot}/${testName}"/>
<antcall target="runclient">
<param name="arg.list" value="${url} true"/>
<param name="log.id" value="${log.id}"/>
</antcall>
</target>
<target name="run.positive.foo" depends="setHttpPort">
<property name="url" value="http://${http.host}:${depltest.port}/foo/${testName}"/>
<antcall target="runclient">
<param name="arg.list" value="${url} true"/>
<param name="log.id" value="${log.id}"/>
</antcall>
</target>
<target name="run.negative" depends="setHttpPort">
<property name="url" value="http://${http.host}:${depltest.port}/${contextRoot}/${testName}"/>
<antcall target="runclient">
<param name="arg.list" value="${url} false"/>
<param name="log.id" value="${log.id}"/>
</antcall>
</target>
<target name="runclient" depends="init">
<echo message="TestClient ${arg.list}"/>
<javaWithResult
fork="true"
failonerror="false"
jvm="${JAVA}"
classname="deploydir.client.TestClient"
output="${build}/${log.id}.output.log"
resultproperty="result">
<jvmarg value="-Dorg.omg.CORBA.ORBInitialHost=${http.host}"/>
<jvmarg value="-Dorg.omg.CORBA.ORBInitialPort=${orb.port}"/>
<classpath>
<path location="${inst}/lib/javaee.jar"/>
<path location="${build}/${testName}/WEB-INF/classes"/>
</classpath>
<arg line="${arg.list}"/>
</javaWithResult>
<antcall target="processResult">
<param name="result" value="${result}"/>
<param name="log" value="${build}/${log.id}.output.log"/>
</antcall>
</target>
<target name="private-all" unless="EE">
<antcall target="assemble"/>
<antcall target="declare-test">
<param name="description" value="war/deploydir Test asadmin deploydir"/>
</antcall>
<antcall target="deploydir.asadmin"/>
<antcall target="run.positive"><param name="log.id" value="1"/></antcall>
<antcall target="declare-test">
<param name="description" value="war/deploydir Test asadmin redeploydir"/>
</antcall>
<antcall target="redeploydir.asadmin"/>
<antcall target="run.positive"><param name="log.id" value="2"/></antcall>
<antcall target="declare-test">
<param name="description" value="war/deploydir Test asadmin v3 redeploydir"/>
</antcall>
<antcall target="v3.redeploydir.asadmin"/>
<antcall target="run.positive"><param name="log.id" value="3"/></antcall>
<antcall target="declare-test">
<param name="description" value="war/deploydir Test asadmin v3 redeploy"/>
</antcall>
<antcall target="v3.redeploy.asadmin"/>
<antcall target="run.positive"><param name="log.id" value="4"/></antcall>
<antcall target="declare-test">
<param name="description" value="war/deploydir Test asadmin deploydir with a different context root"/>
</antcall>
<antcall target="redeploydir.asadmin.foo"/>
<antcall target="run.positive.foo"><param name="log.id" value="5"/></antcall>
<antcall target="declare-test">
<param name="description" value="war/deploydir Test asadmin redeploydir preserves context root"/>
</antcall>
<antcall target="redeploydir.asadmin"/>
<antcall target="run.positive.foo"><param name="log.id" value="6"/></antcall>
<antcall target="declare-test">
<param name="description" value="war/deploydir Test v3 asadmin redeploydir preserves context root"/>
</antcall>
<antcall target="v3.redeploydir.asadmin"/>
<antcall target="run.positive.foo"><param name="log.id" value="7"/></antcall>
<antcall target="declare-test">
<param name="description" value="war/deploydir Test asadmin undeploydir"/>
</antcall>
<antcall target="undeploy.asadmin"/>
<antcall target="run.negative"><param name="log.id" value="8"/></antcall>
</target>
<target name="clobber" depends="clean">
<delete dir="${build}"/>
</target>
<target name="usage">
<antcall target="all"/>
</target>
</project>