| <?xml version="1.0" encoding="ISO-8859-1"?> |
| <!DOCTYPE project [ |
| <!-- |
| |
| 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 |
| |
| --> |
| |
| <!ENTITY commonSetup SYSTEM "file:./../../../config/properties.xml"> |
| <!ENTITY commonBuild SYSTEM "file:./../../../config/common.xml"> |
| <!ENTITY testproperties SYSTEM "file:./build.properties"> |
| ]> |
| |
| <project name="corba_unittest" default="all" basedir="."> |
| |
| &commonSetup; |
| &commonBuild; |
| &testproperties; |
| |
| |
| <target name="all" depends="build,run-java-testng-xml,report"/> |
| |
| <target name="clean" depends="init-common"> |
| <antcall target="clean-common"/> |
| <delete dir="${build.dir}"/> |
| <delete dir="gen"/> |
| <delete dir="test-output"/> |
| <delete dir="test-report"/> |
| <delete file="stats.html"/> |
| </target> |
| |
| <path id="compile.classpath"> |
| <pathelement location="${env.S1AS_HOME}/lib/appserv-rt.jar" /> |
| <pathelement location="${env.APS_HOME}/lib/testng.jar"/> |
| </path> |
| |
| <target name="compile" depends="init-common"> |
| <mkdir dir="${build.dir}/classes" /> |
| <echo message="compile, build.class.dir=${build.dir}/classes"/> |
| <javac srcdir="src" destdir="${build.dir}/classes" |
| debug="true" source="1.5"> |
| <classpath> |
| <path refid="compile.classpath" /> |
| </classpath> |
| </javac> |
| </target> |
| |
| <target name="build" depends="compile"> |
| </target> |
| |
| <path id="run.classpath"> |
| <pathelement location="${build.dir}/classes"/> |
| <path refid="compile.classpath"/> |
| </path> |
| |
| <!-- a few ways to invoke tests --> |
| <target name="run-java-client" depends="compile"> |
| <echo message="1. run-java-client"/> |
| <java fork="yes" |
| classpathref="run.classpath" |
| classname="corba.timer.Client"> |
| <jvmarg value="-ea"/> |
| </java> |
| </target> |
| |
| <target name="run-java-testng-noxml" depends="compile"> |
| <echo message="2. run-java-testng-noxml with -testclass"/> |
| <java fork="yes" |
| classpathref="run.classpath" |
| classname="org.testng.TestNG"> |
| <arg value="-d"/> |
| <arg value="test-output"/> |
| <arg value="-testclass"/> |
| <arg value="corba.timer.Client"/> |
| <jvmarg value="-ea"/> |
| </java> |
| </target> |
| |
| <target name="run-java-testng-xml" depends="compile"> |
| <echo message="3. run-java-testng-xml"/> |
| <java fork="yes" |
| classpathref="run.classpath" |
| classname="org.testng.TestNG"> |
| <arg value="src/testng.xml"/> |
| <jvmarg value="-ea"/> |
| </java> |
| </target> |
| |
| <!-- not work --> |
| <target name="run-ant-noxml" depends="compile"> |
| <echo message="4. run-ant-noxml"/> |
| <echo message="build.dir=${build.dir}"/> |
| <fileset id="run.fileset" dir="${build.dir}/classes"> |
| <include name="*/Client.class"/> |
| </fileset> |
| <taskdef |
| classpathref="run.classpath" |
| name="testng" |
| classname="org.testng.TestNGAntTask"/> |
| <testng |
| classpathref="run.classpath" |
| outputdir="test-output" |
| target="1.5" |
| classfilesetref="run.fileset"> |
| </testng> |
| </target> |
| |
| <target name="run-ant-xml" depends="compile"> |
| <echo message="5. run-ant-xml"/> |
| <taskdef |
| classpathref="run.classpath" |
| name="testng" |
| classname="org.testng.TestNGAntTask"/> |
| <testng |
| classpathref="run.classpath" |
| outputdir="test-output"> |
| <xmlfileset dir="src" includes="testng.xml"/> |
| </testng> |
| </target> |
| |
| |
| <target name="report"> |
| <mkdir dir="test-report"/> |
| <junitreport todir="test-report"> |
| <fileset dir="test-output"> |
| <include name="*.xml"/> |
| </fileset> |
| <report format="noframes" todir="test-report"/> |
| </junitreport> |
| </target> |
| </project> |
| |