blob: 88e1c6fcfb29e5a6c8948aaadffec633abcaacf5 [file] [log] [blame]
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
Copyright (c) 2013, 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
-->
<!DOCTYPE project [
<!ENTITY commonSetup SYSTEM "./../../../config/properties.xml">
<!ENTITY commonBuild SYSTEM "./../../../config/common.xml">
<!ENTITY eeCommonBuild SYSTEM "./../../../config/ee-common.xml">
<!ENTITY run SYSTEM "./../../../config/run.xml">
<!ENTITY testproperties SYSTEM "./build.properties">
]>
<project name="webcontainer_unittest" default="all" basedir=".">
&commonSetup;
&commonBuild;
&eeCommonBuild;
&testproperties;
&run;
<path id="class.path">
<pathelement location="${env.APS_HOME}/lib/reportbuilder.jar"/>
<pathelement location="build"/>
<fileset dir="${env.S1AS_HOME}/modules"/>
</path>
<pathconvert refid="class.path" property="test"/>
<target name="clean" depends="init-common">
<antcall target="clean-common"/>
<delete dir="build"/>
</target>
<target name="build" depends="compile">
<property name="hasWebclient" value="yes"/>
<antcall target="webclient-war-common">
<param name="hasWebclient" value="yes"/>
<param name="webclient.war.classes" value="**/*.class"/>
</antcall>
<javac
srcdir="."
classpath="${env.APS_HOME}/lib/reportbuilder.jar"
includes="WebTest*"/>
</target>
<target name="compile" depends="clean">
<antcall target="compile-common">
<param name="src" value="servlet"/>
</antcall>
</target>
<target name="deploy" depends="init-common">
<echo message="Deploying ${assemble.dir}/${appname}-web.war from ${basedir}." level="verbose"/>
<antcall target="asadmin-common-ignore-fail">
<param name="admin.command" value="deploy" />
<param name="operand.props"
value="--contextroot ${contextroot} --target ${cluster.name} ${assemble.dir}/${appname}-web.war"/>
</antcall>
</target>
<target name="undeploy" depends="init-common">
<echo message="Undeploying ${assemble.dir}/${appname}-web.war from ${basedir}." level="verbose"/>
<antcall target="asadmin-common-ignore-fail">
<param name="admin.command" value="undeploy" />
<param name="operand.props"
value="--target ${cluster.name} ${appname}-web"/>
</antcall>
</target>
<target name="all" depends="init-common,build,create-cluster-common,create-local-instances,setup,create-network-listener,start,deploy,run,stop-instance-1,run-again,start-instance-1,delete-network-listener,undeploy,restore,stop,delete-local-instances,delete-cluster-common"/>
<target name="run" depends="init-common">
<java classname="WebTest" fork="true">
<arg value="${http.host}"/>
<arg value="${contextroot}"/>
<arg value="${apache.port}"/>
<classpath>
<pathelement location="${env.APS_HOME}/lib/reportbuilder.jar"/>
<pathelement location="."/>
</classpath>
</java>
</target>
<target name="run-again" depends="init-common">
<java classname="WebTest2" fork="true">
<arg value="${http.host}"/>
<arg value="${contextroot}"/>
<arg value="${apache.port}"/>
<classpath>
<pathelement location="${env.APS_HOME}/lib/reportbuilder.jar"/>
<pathelement location="."/>
</classpath>
</java>
</target>
<target name="start" depends="init-common">
<antcall target="start-local-instances"/>
<sleep seconds="5"/>
</target>
<target name="stop" depends="init-common">
<antcall target="stop-local-instances"/>
<sleep seconds="5"/>
</target>
<target name="create-local-instances" depends="init-common">
<echo message="Creating local instance ${instance.name} ${instance.name.2}" level="verbose"/>
<antcall target="asadmin-common-ignore-fail">
<param name="admin.command" value="create-local-instance" />
<param name="operand.props"
value="--cluster ${cluster.name} ${instance.name}"/>
</antcall>
<antcall target="asadmin-common-ignore-fail">
<param name="admin.command" value="create-local-instance" />
<param name="operand.props"
value="--cluster ${cluster.name} ${instance.name.2}"/>
</antcall>
</target>
<target name="start-local-instances" depends="init-common">
<echo message="Starting local instance ${instance.name} ${instance.name.2}" level="verbose"/>
<antcall target="asadmin-common-ignore-fail">
<param name="admin.command" value="start-cluster" />
<param name="operand.props"
value="${cluster.name}"/>
</antcall>
</target>
<target name="start-instance-1" depends="init-common">
<echo message="Starting local instance ${instance.name}" level="verbose"/>
<antcall target="asadmin-common-ignore-fail">
<param name="admin.command" value="start-local-instance" />
<param name="operand.props"
value="${instance.name}"/>
</antcall>
</target>
<target name="stop-instance-1" depends="init-common">
<echo message="Stopping local instance ${instance.name}" level="verbose"/>
<antcall target="asadmin-common-ignore-fail">
<param name="admin.command" value="stop-local-instance" />
<param name="operand.props"
value="${instance.name}"/>
</antcall>
</target>
<target name="stop-local-instances" depends="init-common">
<echo message="Stopping local instance ${instance.name} ${instance.name.2}" level="verbose"/>
<antcall target="asadmin-common-ignore-fail">
<param name="admin.command" value="stop-cluster" />
<param name="operand.props"
value="${cluster.name}"/>
</antcall>
</target>
<target name="delete-local-instances" depends="init-common">
<echo message="Deleting local instance ${instance.name} ${instance.name.2}" level="verbose"/>
<antcall target="asadmin-common-ignore-fail">
<param name="admin.command" value="delete-local-instance" />
<param name="operand.props"
value="${instance.name}"/>
</antcall>
<antcall target="asadmin-common-ignore-fail">
<param name="admin.command" value="delete-local-instance" />
<param name="operand.props"
value="${instance.name.2}"/>
</antcall>
</target>
<target name="setup" depends="init-common">
<echo message="Creating system properties" level="verbose"/>
<antcall target="asadmin-common-ignore-fail">
<param name="admin.command" value="create-system-properties" />
<param name="operand.props"
value="--target ${instance.name} AJP_PORT=8009"/>
</antcall>
<antcall target="asadmin-common-ignore-fail">
<param name="admin.command" value="create-system-properties" />
<param name="operand.props"
value="--target ${instance.name} AJP_INSTANCE_NAME=${instance.name}"/>
</antcall>
<antcall target="asadmin-common-ignore-fail">
<param name="admin.command" value="create-system-properties" />
<param name="operand.props"
value="--target ${instance.name.2} AJP_PORT=8010"/>
</antcall>
<antcall target="asadmin-common-ignore-fail">
<param name="admin.command" value="create-system-properties" />
<param name="operand.props"
value="--target ${instance.name.2} AJP_INSTANCE_NAME=${instance.name.2}"/>
</antcall>
<antcall target="asadmin-common-ignore-fail">
<param name="admin.command" value="create-jvm-options" />
<param name="operand.props"
value="--target ${cluster.name} -DjvmRoute=\${AJP_INSTANCE_NAME}"/>
</antcall>
</target>
<target name="restore" depends="init-common">
<echo message="Creating system properties" level="verbose"/>
<antcall target="asadmin-common-ignore-fail">
<param name="admin.command" value="delete-system-property" />
<param name="operand.props"
value="--target ${instance.name} AJP_PORT"/>
</antcall>
<antcall target="asadmin-common-ignore-fail">
<param name="admin.command" value="delete-system-property" />
<param name="operand.props"
value="--target ${instance.name} AJP_INSTANCE_NAME"/>
</antcall>
<antcall target="asadmin-common-ignore-fail">
<param name="admin.command" value="delete-system-property" />
<param name="operand.props"
value="--target ${instance.name.2} AJP_PORT"/>
</antcall>
<antcall target="asadmin-common-ignore-fail">
<param name="admin.command" value="delete-system-property" />
<param name="operand.props"
value="--target ${instance.name.2} AJP_INSTANCE_NAME"/>
</antcall>
<antcall target="asadmin-common-ignore-fail">
<param name="admin.command" value="delete-jvm-options" />
<param name="operand.props"
value="--target ${cluster.name} -DjvmRoute=\${AJP_INSTANCE_NAME}"/>
</antcall>
</target>
<target name="create-network-listener" depends="init-common">
<antcall target="asadmin-common-ignore-fail">
<param name="admin.command" value="create-network-listener" />
<param name="operand.props"
value="--target ${cluster.name} --jkenabled true --listenerport &quot;${AJP_PORT}&quot; --protocol http-listener-1 jk-network-listener"/>
</antcall>
</target>
<target name="delete-network-listener" depends="init-common">
<antcall target="asadmin-common-ignore-fail">
<param name="admin.command" value="delete-network-listener" />
<param name="operand.props"
value="--target ${cluster.name} jk-network-listener"/>
</antcall>
</target>
<target name="usage">
<antcall target="usage-common"/>
</target>
</project>