blob: 17cef4fcf4ff721070785c887240a2ae59064a4e [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 autodeployUtil SYSTEM "./../util/util.xml">
<!ENTITY commonBuild SYSTEM "./../../config/common.xml">
]>
<!--
This makes sure that redeployment of an autodeployed app works. Specifically,
it tests that the validations (governing app refcs in particular) pass as
the autodeployed app is removed and then redeployed.
-->
<project name="autodeploy-simple" default="all" basedir=".">
&commonBuild;
&autodeployUtil;
<property name="testName" value="simpleautodeploy"/>
<target name="prepare" depends="init">
<property name="result.property.file" value="${build}/result.properties"/>
<echo>in simple/build.xml and build is ${build}</echo>
<mkdir dir="${build}" />
</target>
<target name="build" depends="prepare">
<echo>Using previously-built ${autodeploy.archive}</echo>
<!--
Some earlier tests should have run already, so the app we use for autodeploy testing
should already be in place in the build directory.
-->
</target>
<target name="private-all" depends="build">
<antcall target="declare-test">
<param name="description" value="autodeploy/simple Test autodeploy, auto-redeploy, and autoundeploy"/>
</antcall>
<!--
The next task discards any previous temporary file used to gather property settings that
record the results of the autodeploy directory monitoring Java class.
-->
<delete file="${result.property.file}" quiet="true"/>
<!--
Do the auto-deployment.
-->
<antcall target="deploy.autodeploy">
<param name="archive.name" value="${autodeploy.archive.name}"/>
<param name="archive.file" value="${autodeploy.archive}"/>
<param name="autodeploy.dir" value="${autodeploy.dir}"/>
<param name="deployResultPropertyName" value="deployResult1"/>
</antcall>
<!--
Redeploy the archive. This used to trigger an error because the
app ref was not removed before the app was removed.
-->
<antcall target="deploy.autodeploy">
<param name="archive.name" value="${autodeploy.archive.name}"/>
<param name="archive.file" value="${autodeploy.archive}"/>
<param name="autodeploy.dir" value="${autodeploy.dir}"/>
<param name="deployResultPropertyName" value="deployResult2"/>
</antcall>
<!--
Now undeploy the app.
-->
<antcall target="deploy.autoundeploy">
<param name="archive.file" value="${autodeploy.archive}"/>
<param name="archive.name" value="${autodeploy.archive.name}"/>
<param name="autodeploy.dir" value="${autodeploy.dir}"/>
<param name="undeployResultPropertyName" value="undeployResult"/>
</antcall>
<!--
Make the result properties of the several substeps accessible now because we need them in
the next several steps. The prefix attribute helps avoid possible collisions with other
property names that might already be present.
-->
<property file="${result.property.file}" prefix="simple.autodeploy"/>
<!--
Decide whether the test was successful or not. Make sure that the deploy and
undeploy results are good.
-->
<condition property="result" value="0">
<and>
<equals arg1="${simple.autodeploy.deployResult1}" arg2="0"/>
<equals arg1="${simple.autodeploy.deployResult2}" arg2="0"/>
<equals arg1="${simple.autodeploy.undeployResult}" arg2="0"/>
</and>
</condition>
<!--
If the property "result" was not set by the "condition" task just above then something
went wrong and we set result to 1 now.
-->
<condition property="result" value="1">
<not>
<isset property="result"/>
</not>
</condition>
<antcall target="processResult">
<param name="result" value="${result}"/>
<param name="log" value="${build}/output.log"/>
</antcall>
</target>
</project>