blob: 0e6f2b07292341394741cb393a9b3a632cca8741 [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 1997, 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="ejb30-session-hello" default="default" basedir=".">
<property file="build.properties"/>
<description>Builds, tests, and runs the project Hello JSP Application</description>
<!-- <import file="nbproject/build-impl.xml"/>-->
<target name="echo">
<echo message="Hello World"/>
</target>
<target name="sun-taskdef">
<taskdef name="sun-appserv-deploy" classname="org.apache.tools.ant.taskdefs.optional.sun.appserv.DeployTask">
<classpath>
<pathelement location="${sun.appserver.antjar}" />
</classpath>
</taskdef>
<taskdef name="sun-appserv-undeploy" classname="org.apache.tools.ant.taskdefs.optional.sun.appserv.UndeployTask">
<classpath>
<pathelement location="${sun.appserver.antjar}" />
</classpath>
</taskdef>
</target>
<!--<env key="APPCPATH" path="${env.APS_HOME}/lib/testng.jar"/>-->
<path id="path2testng">
<pathelement location="testng-5.0-jdk15.jar"/>
</path>
<path id="class.path">
<fileset dir="${install.dir}/lib">
<include name="**/*.jar"/>
</fileset>
<pathelement location="classes"/>
</path>
<path id="test.classpath">
<fileset dir="${install.dir}/lib">
<include name="**/*.jar"/>
</fileset>
<fileset dir="../../../lib">
<include name="**/*.jar"/>
</fileset>
<pathelement location="classes/app"/>
<pathelement location="classes/test"/>
</path>
<!-- TestNG class fileset -->
<target name="build">
<delete dir="classes"/>
<mkdir dir="classes/app"/>
<javac debug="true"
fork="true"
source="1.5"
classpathref="class.path"
srcdir="src/ejb"
destdir="classes/app"/>
<delete dir="dist" failonerror="false"/>
<mkdir dir="dist"/>
<jar destfile="dist/${ejbjar.file}">
<fileset dir="classes/app">
<include name="**/*.class"/>
</fileset>
<metainf dir="descriptor">
<include name="*.xml"/>
</metainf>
</jar>
<echo message="======================================================="/>
<echo message="Packaged Archive at ./dist/${ejbjar.file}"/>
<echo message="======================================================="/>
</target>
<taskdef name="testng"
classpathref="path2testng"
classname="org.testng.TestNGAntTask"/>
<!-- Generate the TestNG report -->
<target name="report">
<!--<delete dir="../../test-report"/>-->
<mkdir dir="../../../test-report"/>
<junitreport todir="../../../test-report">
<fileset dir="../../../">
<include name="**/test-output/**/*.xml"/>
<exclude name="**/testng-failed.xml"/>
</fileset>
<report format="noframes" todir="../../../test-report"/>
</junitreport>
</target>
<target name="compile-tests"
description="compile the test ng example" depends="">
<delete dir="classes/test" failonerror="false"/>
<mkdir dir="classes/test"/>
<javac debug="true"
fork="true"
source="1.5"
classpathref="test.classpath"
srcdir="src/test"
destdir="classes/test"
/>
</target>
<target name="run">
<echo message="=============Starting TestNG test at \n ${basedir} ============"/>
<mkdir dir="../../test-output"/>
<testng outputdir="../../../test-output"
classpathref="test.classpath" groups="">
<classfileset dir="classes/test" includes="**/TestClient.class"/>
<!--<xmlfileset dir="../../../" includes="testng.xml"/>-->
</testng>
</target>
<target name="deploy" depends="sun-taskdef">
<echo message="${sun.appserver.antjar}"/>
<sun-appserv-deploy file="dist/${ejbjar.file}"
name="helloworld"
force="true"
precompilejsp="true"
verify="false"
upload="true"
user="${admin.user}"
passwordfile="${install.dir}/pass.txt"
host="${admin.host}"
port="${admin.port}"
asinstalldir="${install.dir}" />
</target>
<target name="dist">
<echo message="Save EAR/WAR/JAR file"/>
</target>
<target name="_start-selenium">
<java jar="../lib/selenium/${selenium-srvr-jar}" fork="true" spawn="true" />
<antcall target="_run-ua-tests" />
<get dest="${testreportdir}/results.txt"
src="${selenium-srvr-loc}/selenium-server/driver/?cmd=shutDown" />
</target>
<target name="run">
<taskdef classpathref="build.classpath" resource="testngtasks" />
<testng outputDir="${testreportdir}"
classpath="${testclassesdir};${classesdir}" haltonfailure="true">
<xmlfileset dir="." includes="testng.xml" />
<classpath>
<path refid="build.classpath" />
</classpath>
</testng>
</target>
</project>