blob: ed206696be84f5683ba7dbbf9c4f27b00c38d39e [file] [log] [blame]
<?xml version="1.0" encoding="iso-8859-1"?>
<!--
Copyright (c) 2002, 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
-->
<project name="OfflineConfig admin devtests" default="all" basedir=".">
<!-- ========== Initialize Properties =================================== -->
<property environment="env"/>
<property file="./build.properties"/>
<path id="test.compile.classpath">
<pathelement location="${appserv-se.jar}"/>
<pathelement location="${appserv-rt.jar}"/>
<pathelement location="${appserv-admin.jar}"/>
<pathelement location="${appserv-admin-ee.jar}"/>
<!--
<pathelement location="${appserv-deployment-client.jar}"/>
<pathelement location="${imqjmsra.jar}"/>
-->
<pathelement location="${j2ee.jar}"/>
<pathelement location="${junit.jar}"/>
<pathelement location="${testng.jar}"/>
</path>
<path id="test.run.classpath">
<pathelement location="${component.tests.classes.dir}"/>
<path refid="test.compile.classpath"/>
<!--
<pathelement location="${schema2beans.jar}"/>
<pathelement location="${jmxri.jar}"/>
<pathelement location="/export/ias/sqe-pe/codecoverage/jcov/lib/jcov.jar"/>
-->
</path>
<!-- init. Initialization involves creating publishing directories and
OS specific targets. -->
<target name="init-tests" description="${component.name} initialization">
<tstamp>
<format property="start.time" pattern="MM/dd/yyyy hh:mm aa"/>
</tstamp>
<echo message="Building component ${component.name}"/>
<mkdir dir="${component.tests.classes.dir}"/>
<delete dir="${tests.workfiles.dir}"/>
<mkdir dir="${tests.workfiles.dir}"/>
<copy todir="${tests.workfiles.dir}">
<fileset dir="${testfiles.dir}" includes="*"/>
</copy>
</target>
<!-- all -->
<target name="all" depends="run-tests"
description="Build entire component">
</target>
<!-- clean -->
<target name="clean">
<delete dir="${component.publish.home}"/>
</target>
<target name="build" depends="init-tests">
<echo message="Compiling {component.name}"/>
<javac srcdir="${testsrc.dir}"
destdir="${component.tests.classes.dir}"
debug="${javac.debug}"
optimize="${javac.optimize}"
source="${javac.source}"
deprecation="${javac.deprecation}"
failonerror="true"
classpathref="test.compile.classpath">
<include name="**/*.java"/>
<!-- <include name="**/*Test.java"/>
<include name="**/*Tests.java"/> -->
</javac>
</target>
<target name="run-tests" depends="build">
<java fork="true" failonerror="true"
classname="com.sun.enterprise.admin.config.OfflineConfigTest" >
<!-- <jvmarg value="-Djcov.file=${jcov.file}"/>
-->
<arg line="-testpath ${tests.workfiles.dir}" />
<jvmarg value="-Xdebug"/>
<jvmarg value="-Xnoagent"/>
<jvmarg value="-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=25001"/>
<classpath refid="test.run.classpath"/>
</java>
</target>
<target name="offline-commander" depends="build">
<java fork="true" failonerror="true"
classname="com.sun.enterprise.admin.config.OfflineCommander" >
<!-- <jvmarg value="-Djcov.file=${jcov.file}"/>
-->
<arg line="-testpath ${tests.workfiles.dir}" />
<jvmarg value="-Xdebug"/>
<jvmarg value="-Xnoagent"/>
<jvmarg value="-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=25001"/>
<classpath refid="test.run.classpath"/>
</java>
</target>
<path id="tng-run.cp">
<path refid="test.run.classpath"/>
<pathelement location="${testng.jar}"/>
</path>
<target name="run-tests-ng"
description="run examples with java"
depends="build" >
<java fork="yes"
classpathref="tng-run.cp"
classname="org.testng.TestNG" >
<arg value="./testng/testng.xml"/>
<jvmarg value="-ea"/>
</java>
</target>
</project>