| <?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"> | |
| ]> | |
| <!-- | |
| Test directory deployment for war with directory structure such | |
| as bar | |
| --> | |
| <project name="directoryDeploy-War" default="all" basedir="."> | |
| &commonBuild; | |
| <property name="testName" value="dirDeployWar"/> | |
| <property name="contextRoot" value="foo"/> | |
| <property name="web.build.dir" | |
| value="${build}/${testName}"/> | |
| <property name="client.build.dir" value="${build}/client"/> | |
| <target name="prepare" depends="init"> | |
| <mkdir dir="${build}" /> | |
| <mkdir dir="${web.build.dir}" /> | |
| <mkdir dir="${web.build.dir}/WEB-INF/classes" /> | |
| <mkdir dir="${client.build.dir}" /> | |
| </target> | |
| <target name="compile" depends="prepare"> | |
| <javac srcdir="war" destdir="${web.build.dir}/WEB-INF/classes"> | |
| <classpath refid="gfv3.classpath"/> | |
| </javac> | |
| <javac destdir="${client.build.dir}/"> | |
| <src path="../client"/> | |
| <include name="TestClient.java"/> | |
| <classpath> | |
| <path refid="gfv3.classpath"/> | |
| <path location="${ejb.build.dir}"/> | |
| </classpath> | |
| </javac> | |
| </target> | |
| <target name="assemble" depends="compile"> | |
| <copy file="descriptor/web.xml" todir="${web.build.dir}/WEB-INF"/> | |
| <copy file="descriptor/sun-web.xml" | |
| todir="${web.build.dir}/WEB-INF" | |
| failonerror="false"/> | |
| </target> | |
| <target name="deploydir.asadmin" depends="prepare"> | |
| <antcall target="common.deploydir.asadmin"> | |
| <param name="arg.list" | |
| value="--name ${testName} ${build}/${testName}"/> | |
| </antcall> | |
| </target> | |
| <target name="redeploydir.asadmin" depends="prepare"> | |
| <antcall target="common.redeploydir.asadmin"> | |
| <param name="arg.list" | |
| value="--name ${testName} ${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}/servletonly"/> | |
| <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="directorydeploy.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 refid="gfv3.classpath"/> | |
| <path location="${client.build.dir}"/> | |
| </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"> | |
| <antcall target="assemble"/> | |
| <antcall target="declare-test"> | |
| <param name="description" value="directorydeploy/war 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="directorydeploy/war 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="directorydeploy/war Test asadmin undeploydir"/> | |
| </antcall> | |
| <antcall target="undeploy.asadmin"/> | |
| <antcall target="run.negative"><param name="log.id" value="3"/></antcall> | |
| </target> | |
| <target name="clobber" depends="clean"> | |
| <delete dir="${build}"/> | |
| </target> | |
| </project> |