git_sitools_idoc / flarecast / workspace / sitools-tests-testng / build.xml @ d2a8c3fd
1 |
<?xml version="1.0" encoding="UTF-8"?>
|
---|---|
2 |
|
3 |
<!--
|
4 |
==============================================================================
|
5 |
=== Build file to allow ant (http://jakarta.apache.org/ant/) to be used
|
6 |
=== to build the Sitools project.
|
7 |
===
|
8 |
=== Author : AKKA Technologies
|
9 |
===
|
10 |
=== name : nom du projet
|
11 |
=== default : tache ant executee par defaut
|
12 |
=== basedir : repertoire courant lors de l'execution des taches ant
|
13 |
===
|
14 |
==============================================================================
|
15 |
-->
|
16 |
|
17 |
<project name="TestNG" default="all" basedir="."> |
18 |
|
19 |
<!-- ===============================================================================
|
20 |
Lecture des fichiers "build.properties"
|
21 |
=============================================================================== -->
|
22 |
|
23 |
<property file="build.properties" /> |
24 |
|
25 |
<property name="src.dir" location="src" /> |
26 |
<property name="test.src.dir" location="src/test"/> |
27 |
<property name="build.dir" location="bin"/> |
28 |
<property name="lib.dir" location="lib"/> |
29 |
<property name="res.dir" location="res"/> |
30 |
<property name="scenario.dir" location="res/scenario"/> |
31 |
<property name="test.report.dir" location="report"/> |
32 |
<property name="test.nicereport.dir" location="nicereport"/> |
33 |
<property name="javac.debug" value="on"/> |
34 |
|
35 |
<import file="../fr.cnes.sitools.core/sitools.userlibraries.ant.xml" optional="true" /> |
36 |
|
37 |
<path id="cots.dir"> |
38 |
<fileset dir="${cots.dir}/${testng.dir}" includes="*.jar" /> |
39 |
</path>
|
40 |
|
41 |
<path id="test"> |
42 |
<fileset dir="${test.src.dir}" includes="*.java" /> |
43 |
</path>
|
44 |
|
45 |
<path id="cpath"> |
46 |
<path refid="cots.dir" /> |
47 |
<path refid="test"/> |
48 |
<!-- <fileset dir="${lib.dir}" includes="*.jar" />-->
|
49 |
<pathelement path="${build.dir}" /> |
50 |
</path>
|
51 |
|
52 |
<target name="clean" description="Nettoyage des repertoires"> |
53 |
<delete dir="${build.dir}" /> |
54 |
<delete dir="${test.report.dir}" /> |
55 |
<delete dir="${test.nicereport.dir}" /> |
56 |
</target>
|
57 |
|
58 |
<!-- COMPILE TESTS-->
|
59 |
<target name="init"> |
60 |
<!-- Create the time stamp -->
|
61 |
<tstamp/> |
62 |
<mkdir dir="${build.dir}" /> |
63 |
<mkdir dir="${test.report.dir}" /> |
64 |
<mkdir dir="${test.nicereport.dir}" /> |
65 |
</target>
|
66 |
|
67 |
<target name="compile" depends="init" description="Compilation du code"> |
68 |
<javac includeantruntime="false" |
69 |
srcdir="${src.dir}" |
70 |
destdir="${build.dir}" |
71 |
classpathref="cpath" |
72 |
debug="${javac.debug}"/> |
73 |
</target>
|
74 |
|
75 |
<!-- RUN TESTS-->
|
76 |
<taskdef resource="testngtasks" classpathref="cots.dir"/> |
77 |
|
78 |
<target name="test" depends="compile" description="Lancement des tests - Administration"> |
79 |
<echo message="args: -Dselenium.host=${selenium.host} -Dselenium.port=${selenium.port} -Dselenium.env=${selenium.env} -Dwebapp.url=${webapp.url}"/> |
80 |
<testng
|
81 |
classpathref="cpath" |
82 |
outputDir="${test.report.dir}" |
83 |
haltOnfailure="true"> |
84 |
<!--the option -ea tells the JVM to handle assertions (and to raise an exception when an assertion fails-->
|
85 |
<!-- <jvmarg value="-ea"/> -->
|
86 |
<!-- <jvmarg value="-Dselenium.host=${selenium.host}"/>
|
87 |
<jvmarg value="-Dselenium.port=${selenium.port}"/>
|
88 |
<jvmarg value="-Dselenium.env=${selenium.env}"/>
|
89 |
<jvmarg value="-Dwebapp.url=${webapp.url}"/>-->
|
90 |
<xmlfileset dir="${scenario.dir}/admin" includes="sitoolsTests.xml"/> |
91 |
|
92 |
|
93 |
|
94 |
|
95 |
|
96 |
</testng>
|
97 |
</target>
|
98 |
|
99 |
<target name="rapport" description="Generation des rapports graphiques"> |
100 |
<mkdir dir="${test.nicereport.dir}"/> |
101 |
<xslt in="${test.report.dir}/testng-results.xml" |
102 |
out="${test.nicereport.dir}/index.html" |
103 |
style="${cots.dir}/${testng.dir}/testng-results.xsl" |
104 |
force="yes" processor="SaxonLiaison"> |
105 |
<param name="testNgXslt.outputDir" expression="${test.nicereport.dir}"/> |
106 |
<param name="testNgXslt.showRuntimeTotals" expression="true"/> |
107 |
<param name="testNgXslt.testDetailsFilter" expression="FAIL,PASS,SKIP"/> |
108 |
<classpath refid="cots.dir"/> |
109 |
</xslt>
|
110 |
</target>
|
111 |
|
112 |
<target name="all" depends="test,rapport"/> |
113 |
|
114 |
</project>
|