blob: ea569b1e8647d66fce37d5110097f7dc5017ea18 [file] [log] [blame]
<?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:./../../properties.xml">
<!ENTITY anotherCommonBuild SYSTEM "file:./../../common-build.xml">
<!ENTITY testproperties SYSTEM "file:./build.properties">
]>
<project name="webcontainer_unittest" default="all" basedir=".">
&commonSetup;
&testproperties;
&anotherCommonBuild;
<target name="all" depends="build,deploy,run,report,undeploy"/>
<!-- Classpath definition -->
<path id="run.classpath">
<path refid="path2testng"/>
<pathelement location="${build.dir}"/>
</path>
<!-- TestNG xml fileset and class files defintions -->
<fileset id="run.xmlfileset"
dir="."
includes="testng.xml">
</fileset>
<fileset id="run.classfileset"
dir="${build.dir}/"
includes="WebTestNG.class">
</fileset>
<!-- Compile the servlet classes to be deployed -->
<target name="compile" depends="clean">
<antcall target="common-compile">
<param name="compile.source.dir" value="servlet"/>
</antcall>
</target>
<!-- Compile TestNG tests -->
<target name="compile-tests">
<antcall target="common-compile-testng-tests">
<param name="compile.testng.srcdir" value="tests"/>
<param name="compile.testng.destdir" value="${build.dir}"/>
<param name="compile.testng.classpath" value="path2testng"/>
</antcall>
</target>
<!-- create war file -->
<target name="build" depends="compile">
<antcall target="common-build-war">
<param name="hasWebclient" value="yes"/>
</antcall>
</target>
<!-- deploy war file -->
<target name="deploy" depends="init-common">
<antcall target="common-deploy-war"/>
</target>
<!-- Run the tests -->
<target name="run" depends="compile-tests">
<antcall target="common-run">
<param name="run.testng.classpath" value="run.classpath"/>
<param name="run.testng.xmlfileset" value="run.xmlfileset"/>
</antcall>
</target>
<!-- Run tests beloging to specified groups only -->
<target name="run-groups" depends="compile-tests">
<antcall target="common-run-groups">
<param name="run.testng.classpath" value="run.classpath"/>
<param name="run.testng.classfileset" value="run.classfileset"/>
</antcall>
</target>
<!-- Run failed testng tests from previous runs -->
<target name="run-failed">
<antcall target="common-run-failed">
<param name="run.testng.classpath" value="run.classpath"/>
</antcall>
</target>
<!-- Generate test report -->
<target name="report" depends="common-report"/>
<!-- Undeploy the test app -->
<target name="undeploy" depends="init-common">
<antcall target="common-undeploy-war"/>
</target>
<!-- Cleanup -->
<target name="clean" depends="init-common">
<antcall target="common-clean"/>
<delete dir="${build.dir}"/>
<delete dir="gen"/>
<delete dir="test-output"/>
<delete dir="test-report"/>
</target>
</project>