| <?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="Admin Framework Devtests" default="all" basedir="."> | |
| <!-- ========== Initialize Properties =================================== --> | |
| <property environment="env"/> | |
| <property file="./build.properties"/> | |
| <path id="test.compile.classpath"> | |
| <pathelement location="${appserv-rt.jar}"/> | |
| <pathelement location="${appserv-admin.jar}"/> | |
| <pathelement location="${j2ee.jar}"/> | |
| <pathelement location="${junit.jar}"/> | |
| </path> | |
| <path id="test.run.classpath"> | |
| <pathelement location="${tests.workfiles.dir}/testserverbeans.jar"/> | |
| <pathelement location="${component.tests.classes.dir}"/> | |
| <path refid="test.compile.classpath"/> | |
| <!-- <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}"/> | |
| <mkdir dir="${tests.workfiles.dir}/samples"/> | |
| <copy todir="${tests.workfiles.dir}"> | |
| <fileset dir="${testfiles.dir}" includes="*"/> | |
| <fileset dir="${testfiles.dir}" includes="samples/*"/> | |
| </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="compile-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="init-tests,compile-tests"> | |
| <java fork="true" failonerror="true" | |
| classname="com.sun.enterprise.admin.AdminInfraTest" > | |
| <!-- <jvmarg value="-Djcov.file=${jcov.file}"/> | |
| --> | |
| <arg line="-testpath ${tests.workfiles.dir}" /> | |
| <classpath refid="test.run.classpath"/> | |
| </java> | |
| </target> | |
| <target name="run-tests-create" depends="init-tests,compile-tests"> | |
| <delete> | |
| <fileset dir="${tests.workfiles.dir}/samples" includes="*"/> | |
| <fileset dir="${testfiles.dir}/samples" includes="*"/> | |
| </delete> | |
| <java fork="true" failonerror="true" | |
| classname="com.sun.enterprise.admin.AdminInfraTest" > | |
| <!-- | |
| <jvmarg value="-Xdebug"/> | |
| <jvmarg value="-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=9009"/> | |
| <jvmarg value="-Djcov.server_port=3330"/> | |
| <jvmarg value="-Xbootclasspath/p:/export/ias/sqe-pe/codecoverage/jcov/lib/jcov.jar"/> | |
| --> | |
| <arg line="-testpath ${tests.workfiles.dir} create" /> | |
| <classpath refid="test.run.classpath"/> | |
| </java> | |
| <copy todir="${testfiles.dir}"> | |
| <fileset dir="${tests.workfiles.dir}" includes="samples/*"/> | |
| </copy> | |
| </target> | |
| <target name="run-tests-print" depends="init-tests,compile-tests"> | |
| <java fork="true" failonerror="true" | |
| classname="com.sun.enterprise.admin.AdminInfraTest" > | |
| <arg line="-testpath ${tests.workfiles.dir} print" /> | |
| <!-- | |
| <jvmarg value="-Xdebug"/> | |
| <jvmarg value="-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=1044"/> | |
| --> | |
| <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="init-tests,compile-tests" > | |
| <delete dir="./test-output"/> | |
| <java fork="yes" | |
| classpathref="tng-run.cp" | |
| classname="org.testng.TestNG" > | |
| <arg value="./testng/testng.xml"/> | |
| <jvmarg value="-ea"/> | |
| </java> | |
| </target> | |
| </project> | |