| <!-- |
| |
| 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="startDomainEmbeddedStaticShell, startDomainEmbeddedUberJar"/> |
| <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="startDomainEmbeddedStaticShell" if="env.S1AS_HOME"> |
| <echo> === EMBEDDED STARTING WITH GLASSFISH INSTALLATION at ${env.S1AS_HOME} === </echo> |
| <glassfish-embedded-start installRoot="${env.S1AS_HOME}" instanceRoot="${env.S1AS_HOME}/domains/domain1/" configFile="file:///${env.S1AS_HOME}/domains/domain1/config/domain.xml" configFileReadOnly="false" httpPort="-1"/> |
| </target> |
| |
| <target name="startDomainEmbeddedUberJar" unless="env.S1AS_HOME"> |
| <echo> === EMBEDDED STARTING === </echo> |
| <glassfish-embedded-start/> |
| <!-- |
| <glassfish-embedded-start1> |
| instanceRoot="${env.S1AS_HOME}/domains/domain1" |
| installRoot="${env.S1AS_HOME}" |
| configFile="${env.S1AS_HOME}/domains/domain1/config/domain.xml"/> |
| </glassfish-embedded-start1> |
| --> |
| </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> |
| |