blob: dab20d3f722ce5b6144678dadca64e3c5004efb5 [file] [log] [blame]
<!--
Copyright (c) 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
-->
<property name="target-to-run" value="sqetests"/>
<target name="runtest" depends="init-common">
<record name="runtest.output" action="start" />
<parallel>
<!--
<antcall target="startAS"/>
-->
<sequential>
<waitfor maxwait="5" maxwaitunit="minute" checkevery="500">
<or>
<http url="http://localhost:80"/>
<http url="http://localhost:1024"/>
<http url="http://${http.host}:${http.port}"/>
</or>
</waitfor>
<antcall target="${target-to-run}"/>
<antcall target="report"/>
<antcall target="mail"/>
<!--
<antcall target="stopAS"/>
-->
</sequential>
</parallel>
<record name="runtest.output" action="stop" />
</target>
<!-- Setup and Restart the server instance-->
<target name="restart-server-instance-common">
<antcall target="stopDomain"/>
<sleep seconds="15" />
<antcall target="startDomain"/>
</target>
<target name="startDomain" depends="startDomainEmbeddedWebJar"/>
<target name="stopDomain" depends="stopDomainEmbedded"/>
<!-- CLASSPATH including embedded ant-tasks.jar and uber jar (or static-shell jar) should be set externally -->
<taskdef name="glassfish-embedded-start" classname="org.glassfish.ant.embedded.tasks.StartServerTask"/>
<taskdef name="glassfish-embedded-stop" classname="org.glassfish.ant.embedded.tasks.StopServerTask"/>
<target name="startDomainEmbeddedWebJar">
<echo> === EMBEDDED STARTING === </echo>
<glassfish-embedded-start/>
</target>
<target name="stopDomainEmbedded" >
<echo> === EMBEDDED STOPING === </echo>
<glassfish-embedded-stop/>
<sleep seconds="5"/>
</target>
<target name="delete-domain-common" depends="init-common">
<exec executable="${ASADMIN}">
<arg line="delete-domain"/>
<arg line="--domaindir ${admin.domain.dir}"/>
<arg line="${admin.domain}"/>
</exec>
</target>
<target name="create-domain-common" depends="init-common">
<exec executable="${ASADMIN}">
<arg line="create-domain"/>
<arg line="--domaindir ${admin.domain.dir}"/>
<arg line="--adminport ${admin.port}"/>
<arg line="--instanceport ${http.port}"/>
<arg line="--user ${admin.user}"/>
<arg line="--passwordfile ${admin.password.file}"/>
<arg line="--domainproperties orb.listener.port=${orb.port}" />
<arg line="${admin.domain}"/>
</exec>
</target>
<target name="start-clean-server">
<antcall target="stopDomain"/>
<antcall target="startDomain"/>
</target>
<target name="restart-instance-common">
<antcall target="stopDomain"/>
<antcall target="startDomain"/>
</target>
<macrodef name="run-test">
<attribute name="classname"/>
<attribute name="classpath"/>
<sequential>
<java classname="@{classname}" classpath="@{classpath}" fork="true">
<jvmarg value="-Das.props=${as.props}"/>
</java>
</sequential>
</macrodef>