This repository has been archived by the owner on Nov 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild-test.xml
239 lines (197 loc) · 8.56 KB
/
build-test.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
<?xml version="1.0"?>
<!--
Ant build file for deegree test suite. Tested with Ant 1.7.0.
This file is part of deegree.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
Copyright (C) 2001-2008 by:
EXSE, Department of Geography, University of Bonn
http://www.giub.uni-bonn.de/exse/
lat/lon GmbH, Bonn, Germany
http://www.lat-lon.de
$HeadURL: https://scm.wald.intevation.org/svn/deegree/base/trunk/build-test.xml $
$Revision: 14814 $, $Date: 2008-11-11 08:26:00 +0100 (Di, 11. Nov 2008) $
$Author: aschmitz $
-->
<!DOCTYPE project [
<!ENTITY global SYSTEM "global.xml">
]>
<project name="deegreeTest" default="all" basedir=".">
<!-- include global properties -->
&global;
<!-- test.properties containing the list of test classes -->
<!--property file="test.properties"/-->
<property name="test.home" value="${basedir}" />
<property name="test.src" value="${test.home}/test/junit" />
<property name="test.build" value="${test.home}/classes-test" />
<property name="test.lib" value="${test.home}/lib/junit" />
<property name="test.etc" value="${test.home}/etc" />
<property name="test.web" value="${test.home}/webapps/deegreeTest" />
<property name="test.webapp.name" value="${ant.project.name}" />
<property name="test.war" value="${ant.project.name}.war" />
<property name="test.doc" value="${doc.base}/testapi" />
<property name="master.project" value="${basedir}" />
<property name="junit.results" value="${doc.base}/junit" />
<property name="junit.ui" value="junit.swingui.TestRunner" />
<!-- property name="junit.ui" value="junit.textui.TestRunner" / -->
<!-- property name="junit.ui" value="junit.ui.TestRunner" / -->
<!-- set classpath for testing -->
<path id="test.path">
<pathelement location="${build}" />
<pathelement location="${test.build}" />
<fileset dir="${test.lib}">
<include name="*.jar" />
</fileset>
<pathelement location="${master.project}/${build}" />
<path refid="build.path" />
</path>
<target name="all" depends="guitest" />
<!-- =================================================================== -->
<!-- prints the environment -->
<!-- =================================================================== -->
<target name="env" description="prints the environment">
<echo message="java.home = ${java.home}" />
<echo message="user.home = ${user.home}" />
<echo message="user.dir = ${user.dir}" />
<echo message="java.class.path = ${java.class.path}" />
<echo message="tomcat.home = ${tomcat.home}" />
<echo message="application.name = ${ant.project.name}" />
<echo message="application.home = ${basedir}" />
<echo message="test.home = ${test.home}" />
<echo message="test.src = ${test.src}" />
<echo message="test.build = ${test.build}" />
<echo message="test.lib = ${test.lib}" />
<echo message="test.web = ${test.web}" />
<echo message="master.project = ${master.project}" />
</target>
<!-- ########################################################## -->
<target name="init">
<tstamp />
<mkdir dir="${test.build}" />
</target>
<!-- ########################################################## -->
<target name="junit_available">
<available property="junit.present" classname="junit.framework.TestCase">
<classpath refid="test.path" />
</available>
</target>
<!-- ########################################################## -->
<target name="javac">
<available property="javac.present" classname="com.sun.tools.javac.Main">
<classpath refid="test.path" />
</available>
<echo message="${javac.present}" />
</target>
<!-- ########################################################## -->
<target name="compile" depends="init,junit_available">
<ant antfile="build.xml" dir="." target="compile" inheritall="false" />
<condition property="oraclesdo.present">
<and>
<available classname="oracle.spatial.geometry.JGeometry" classpathref="build.path" />
</and>
</condition>
<if>
<equals arg1="${oraclesdo.present}" arg2="true" />
<then>
<property name="oracle.exclude.testclasses" value="" />
<echo message="Enabling JGeometryAdapterTest." />
</then>
<else>
<property name="oracle.exclude.testclasses" value="org/deegree/io/datastore/sql/oracle/JGeometryAdapterTest.java" />
<echo message="Disabling JGeometryAdapterTest." />
</else>
</if>
<javac srcdir="${test.src}" destdir="${test.build}" includes="**/*.java" excludes="${oracle.exclude.testclasses}" fork="true" memorymaximumsize="512M" source="${source.version}" target="${target.version}" debug="true">
<classpath>
<path refid="test.path" />
</classpath>
</javac>
<copy todir="${test.build}">
<fileset dir="${test.src}" includes="**/*.*" excludes="**/package.html, **/*.java" />
</copy>
</target>
<!-- ########################################################## -->
<!--target name="test" depends="compile" if="junit.present">
<junit fork="yes" printsummary="yes"
haltonfailure="no" haltonerror="no"
errorproperty="test.failed">
<sysproperty key="user.dir" value="${basedir}"/>
<classpath>
<path refid="test.path" />
</classpath>
<batchtest todir="${junit.results}" haltonfailure="no">
<fileset dir="${test.build}">
<include name="**/*Test.class" />
<exclude name="**/AllTests.class" />
</fileset>
</batchtest>
<formatter type="plain" />
</junit>
</target-->
<!-- ########################################################## -->
<target name="guitest" depends="compile" if="junit.present">
<java fork="yes" classname="${junit.ui}" taskname="junit" failonerror="true" dir="${test.build}">
<jvmarg value="-Djava.compiler=NONE" />
<jvmarg value="-Duser.dir=${user.dir}" />
<arg value="-noloading" />
<!-- arg value="alltests.AllTests"/ -->
<classpath>
<path refid="test.path" />
</classpath>
</java>
</target>
<!-- ########################################################## -->
<target name="cctest" depends="compile" if="junit.present" description="Run unit tests">
<delete dir="${junit.results}" />
<mkdir dir="${junit.results}" />
<echo message="Running unit tests in ${user.dir}" />
<junit maxmemory="1024m" fork="yes" haltonfailure="yes" haltonerror="yes">
<classpath>
<path refid="test.path" />
</classpath>
<sysproperty key="user.dir" value="${basedir}" />
<!--formatter type="plain" usefile="true"/-->
<formatter type="xml" />
<!--batchtest todir="${junit.results}">
<fileset dir="${test.build}" includes="">
</fileset>
</batchtest-->
<test name="alltests.AllTests" />
</junit>
<junitreport todir="${junit.results}">
<fileset dir="${junit.results}">
<include name="TEST-*.xml" />
</fileset>
<report format="frames" todir="${junit.results}/html" />
</junitreport>
</target>
<!-- ########################################################## -->
<target name="javadoc" depends="compile" description="Creates JavaDoc">
<mkdir dir="${doc}" />
<javadoc packagenames="org.*,de.*,alltests.*" sourcepath="${test.src}" destdir="${test.doc}" author="true" version="true" use="true" package="true" linksource="true" overview="${test.src}/overview.html" doctitle="deegree - Test Suite" windowtitle="deegree ${version.number}.${build.number} test suite 1.0" header="deegree ${version.number}.${build.number} test suite 1.0" footer="deegree ${version.number}.${build.number} test suite 1.0" maxmemory="128m">
<bottom>
<![CDATA[<p align="center">an open source project founded by <a href="http://www.latlon.de">lat/lon</a>, Bonn, Germany.<BR>
<i>For more information visit: <a href="http://www.deegree.org">http://www.deegree.org</a>
</i>
</p>]]>
</bottom>
<tag name="todo" scope="all" description="To do:" />
<tag name="TODO" scope="all" description="To do:" />
<tag name="bug" scope="all" description="Known bug:" />
<link href="http://java.sun.com/j2se/1.4.2/docs/api/" />
<link href="http://java.sun.com/j2ee/sdk_1.3/techdocs/api/" />
<link href="http://www.junit.org/junit/javadoc/3.8/" />
<classpath>
<path refid="test.path" />
</classpath>
</javadoc>
</target>
<!-- ########################################################## -->
<target name="clean" depends="" description="clean source directory">
<delete dir="${test.doc}" />
<delete dir="${junit.results}" />
<delete dir="${test.build}" />
</target>
</project>