blob: 0f9b4ebad18bb46d581fb75365145b35405cfa60 [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
-->
<!--
This is the common targets for all lazyInit tests
imported into all the leaf level build files
-->
<!-- ================================================================ -->
<!-- Setup and Restart the server instance-->
<target name="norestart">
<echo message="The tests will not restart the server before running" />
<property name="no.restart" value="true"/>
</target>
<target name="pre-start" depends="printmessage">
<antcall target="restart-before-test"/>
</target>
<target name="restart-before-test" unless="no.restart.test">
<antcall target="restart-server-internal"/>
</target>
<target name="restart-server" depends="printmessage">
<antcall target="restart-server-internal"/>
</target>
<target name="restart-server-internal" unless="no.restart">
<antcall target="stopDomain"/>
<antcall target="startDomain"/>
</target>
<target name="printmessage" if="no.retstart">
<echo message="The test will be run without restarting the server"/>
</target>
<target name="startDomain" depends="startDomainUnix, startDomainWindows"/>
<target name="startDomainUnix" depends="init-common" if="isUnix">
<exec executable="${ASADMIN}" failonerror="true">
<arg line="start-domain"/>
<arg line="--domaindir ${admin.domain.dir}"/>
<arg line="${admin.domain}"/>
</exec>
</target>
<target name="startDomainWindows" depends="init-common" if="isWindows">
<delete file="${ASADMIN}.marker"/>
<exec executable="${ASADMIN}" spawn="true">
<!--
<arg line="${ASADMIN}"/>
-->
<arg line="start-domain"/>
<arg line="--domaindir ${admin.domain.dir}"/>
<arg line="${admin.domain}"/>
</exec>
<waitfor checkevery="10" maxwait="30" maxwaitunit="second">
<available file="${ASADMIN}.marker"/>
</waitfor>
</target>
<target name="stopDomain" depends="init-common">
<echo message="run.xml:stopping domain..."/>
<exec executable="${ASADMIN}" failonerror="true">
<arg line="stop-domain"/>
<arg line="--domaindir ${admin.domain.dir}"/>
<arg line="${admin.domain}"/>
</exec>
</target>