-
Notifications
You must be signed in to change notification settings - Fork 0
/
buildTest.xml
executable file
·355 lines (309 loc) · 15.5 KB
/
buildTest.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
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
<?xml version="1.0"?>
<!DOCTYPE project [
<!ENTITY properties SYSTEM "file:xmls/properties.xml">
<!ENTITY paths SYSTEM "file:xmls/path_refs.xml">
<!ENTITY taskdefs SYSTEM "file:xmls/taskdefs.xml">
<!ENTITY taskdefs_post_compile SYSTEM "file:xmls/taskdefs_post_compile.xml">
<!ENTITY targets SYSTEM "file:xmls/targets.xml">
]>
<project default="printEnv" basedir=".">
<!-- =================================================================== -->
<description>
Test Files Build file for Axis
Notes:
This is a build file for use with the Jakarta Ant build tool.
Prerequisites:
jakarta-ant from http://jakarta.apache.org
Optional components:
SOAP Attachment support enablement:
activation.jar from http://java.sun.com/products/javabeans/glasgow/jaf.html
mailapi.jar from http://java.sun.com/products/javamail/
Security support enablement:
xmlsec.jar from fresh build of CVS from http://xml.apache.org/security/
Other support jars from http://cvs.apache.org/viewcvs.cgi/xml-security/libs/
Build Instructions:
To build, run
ant "target"
on the directory where this file is located with the target you want.
Most useful targets:
- compile : compiles the tests and WSDL files
Author:
Matt Seibert [email protected]
Copyright:
Copyright (c) 2002-2003 Apache Software Foundation.
</description>
<!-- ==================================================================== -->
&properties;
&paths;
&taskdefs;
&taskdefs_post_compile;
&targets;
<!-- Give user a chance to override without editing this file
(and without typing -D each time it compiles it) -->
<property file="test.properties"/>
<property file="${user.home}/test.properties"/>
<!-- =========================================================================== -->
<target name="compile" depends="printEnv,copy">
<!-- Compile the code -->
<antcall target="compileJunit"/>
<antcall target="compileFunctional"/>
</target>
<target name="compileJunit" depends="printEnv,copy">
<!-- Compile the code -->
<foreach target="component-compile" fork="${foreach.fork}" inheritAll="${ant.inheritAll}" inheritRefs="${ant.inheritRefs}">
<param name="file">
<fileset dir="${axis.home}" >
<patternset>
<include name="test/**/build.xml"/>
<exclude name="test/wsdl/**/build.xml" />
<exclude name="test/functional/build.xml"/>
</patternset>
</fileset>
</param>
</foreach>
</target>
<target name="compileFunctional" depends="printEnv,copy">
<!-- Compile the code -->
<foreach target="component-compile" fork="${foreach.fork}" inheritAll="${ant.inheritAll}" inheritRefs="${ant.inheritRefs}">
<param name="file">
<fileset dir="${axis.home}" >
<patternset>
<include name="test/wsdl/**/build.xml" />
<include name="test/rpc/**/build.xml" />
<include name="test/functional/build.xml"/>
<exclude name="test/wsdl/attachments/**/build.xml" unless="attachments.present"/>
<exclude name="test/wsdl/interop3/**/build.xml" />
<exclude name="test/wsdl/adaptive/**/build.xml" />
</patternset>
</fileset>
</param>
</foreach>
</target>
<!-- =================================================================== -->
<!-- Compiles the JUnit testcases -->
<!-- =================================================================== -->
<!-- =================================================================== -->
<!-- Runs the JUnit package testcases -->
<!-- =================================================================== -->
<target name="junit" if="junit.present">
<available file="${axis.home}/junit-exclude-tests.txt" property="junit-exclude-tests.present"/>
<junit printsummary="yes" haltonfailure="${test.functional.fail}" fork="yes">
<jvmarg value="-Xbootclasspath:${sun.boot.class.path}"/>
<classpath refid="classpath" />
<formatter type="xml" />
<batchtest todir="${test.functional.reportdir}">
<fileset dir="${build.dir}/classes">
<!-- Convention: each package that's being tested
has its own test class collecting all the tests -->
<include name="**/PackageTests.class" />
<excludesfile name="${axis.home}/junit-exclude-tests.txt" if="junit-exclude-tests.present"/>
<!-- <include name="**/test/*TestSuite.class"/> -->
</fileset>
</batchtest>
</junit>
</target>
<!-- =================================================================== -->
<!-- Functional tests, no server (for testing under debugger) -->
<!-- =================================================================== -->
<target name="functional-tests-noserver">
<ant inheritAll="${ant.inheritAll}" inheritRefs="${ant.inheritRefs}" dir="${axis.home}/test" antfile="build_functional_tests.xml" target="junit-functional-noserver">
<property name="test.functional.usefile" value="${test.functional.usefile}"/>
</ant>
</target>
<!-- =================================================================== -->
<!-- Cleans everything -->
<!-- =================================================================== -->
<target name="clean">
<delete dir="${build.dir}/test"/>
</target>
<target name="copy"/>
<!-- =================================================================== -->
<!-- Prepares the JUnit functional test -->
<!-- =================================================================== -->
<target name="junit-functional-prepare" if="junit.present">
<path id="deploy.xml.files">
<fileset dir="${build.dir}/work">
<include name="**/deploy.wsdd"/>
<exclude name="mssoapinterop/interop*/deploy.wsdd"/>
</fileset>
</path>
<path id="undeploy.xml.files">
<fileset dir="${build.dir}/work">
<include name="**/undeploy.wsdd"/>
<exclude name="mssoapinterop/interop*/undeploy.wsdd"/>
</fileset>
</path>
<property name="deploy.xml.property" refid="deploy.xml.files"/>
<property name="undeploy.xml.property" refid="undeploy.xml.files"/>
</target>
<!-- =================================================================== -->
<!-- Runs the JUnit functional test -->
<!-- =================================================================== -->
<target name="junit-functional" if="junit.present" depends="junit-functional-prepare">
<mkdir dir="${test.functional.reportdir}" />
<java classname="org.apache.axis.client.AdminClient" fork="yes">
<classpath refid="classpath" />
<arg line="${deploy.xml.property}"/>
</java>
<available file="${axis.home}/junit-exclude-tests.txt" property="junit-exclude-tests.present"/>
<!-- now, run the actual test -->
<junit dir="${axis.home}" printsummary="yes" haltonfailure="${test.functional.fail}" fork="yes">
<!-- See if this helps with Gump test failures -->
<sysproperty key="build.clonevm" value="true"/>
<!-- Pass the parser settings -->
<jvmarg value="-Djavax.xml.parsers.DocumentBuilderFactory=${javax.xml.parsers.DocumentBuilderFactory}"/>
<jvmarg value="-Djavax.xml.parsers.SAXParserFactory=${javax.xml.parsers.SAXParserFactory}"/>
<jvmarg value="-Xbootclasspath:${sun.boot.class.path}"/>
<jvmarg value="-Djikes.class.path=${jikes.class.path}"/>
<!-- Pass through the proxy parameters -->
<jvmarg value="-Dhttp.proxyHost=${http.proxyHost}"/>
<jvmarg value="-Dhttp.proxyPort=${http.proxyPort}"/>
<jvmarg value="-Dhttp.nonProxyHosts=${http.nonProxyHosts}"/>
<jvmarg value="-Dhttp.proxyUser=${http.proxyUser}"/>
<jvmarg value="-Dhttp.proxyPassword=${http.proxyPassword}"/>
<!-- Pass the port for SimpleAxisServer -->
<jvmarg value="-Dtest.functional.SimpleAxisPort=${test.functional.SimpleAxisPort}"/>
<jvmarg value="-Dtest.functional.ServicePort=${test.functional.ServicePort}"/>
<classpath refid="classpath" />
<formatter type="xml" usefile="${test.functional.usefile}"/>
<batchtest todir="${test.functional.reportdir}">
<fileset dir="${build.dest}">
<!-- Convention: each package that's being tested
has its own test class collecting all the tests -->
<include name="**/FunctionalTests.class" />
<include name="**/*TestCase.class" />
<exclude name="**/Interop3TestCase.class"/>
<exclude name="**/DataServiceTestCase.class"/>
<exclude name="**/WhiteMesaSoap12TestSvcTestCase.class"/>
<exclude name="**/test/wsdl/attachments/**/*.class" unless="attachments.present" />
<exclude name="**/test/wsdl/adaptive/**/*.class"/>
<excludesfile name="${axis.home}/junit-exclude-tests.txt" if="junit-exclude-tests.present"/>
</fileset>
</batchtest>
</junit>
<java classname="org.apache.axis.client.AdminClient" fork="yes">
<classpath refid="classpath" />
<arg line="${undeploy.xml.property}"/>
</java>
</target>
<target name="junit-functional-secure" if="junit.present" depends="junit-functional-prepare,start-signature-signing-and-verification">
<available file="${axis.home}/junit-exclude-tests.txt" property="junit-exclude-tests.present"/>
<!-- now, run the actual test -->
<junit dir="${axis.home}" printsummary="yes" haltonfailure="${test.functional.fail}" fork="yes">
<classpath refid="classpath" />
<formatter type="xml" usefile="${test.functional.usefile}"/>
<batchtest todir="${test.functional.reportdir}">
<fileset dir="${build.dest}">
<!-- Convention: each package that's being tested
has its own test class collecting all the tests -->
<include name="**/TestBidBuySample.class" />
<exclude name="**/Interop3TestCase.class"/>
<excludesfile name="${axis.home}/junit-exclude-tests.txt" if="junit-exclude-tests.present"/>
</fileset>
</batchtest>
</junit>
</target>
<!-- =================================================================== -->
<!-- Run functional tests -->
<!-- =================================================================== -->
<target name="functional-tests" depends="printEnv,transport-layer" if="junit.present" >
<!-- This uses a custom Ant task. See test/functional/ant/RunAxisFunctionalTests.java -->
<!-- This pattern taken from Cactus, http://jakarta.apache.org/commons/cactus -->
<runaxisfunctionaltests
url="http://localhost:8088"
tcpServerTarget="start-functional-test-tcp-server"
httpServerTarget="start-functional-test-http-server"
testTarget="junit-functional"
httpStopTarget="stop-functional-test-http-server" />
<!-- now run security test -->
<antcall target="functional-tests-secure"/>
</target>
<!-- =================================================================== -->
<!-- Run secure functional tests ONLY -->
<!-- =================================================================== -->
<target name="functional-tests-secure" if="security.present">
<runaxisfunctionaltests
url="http://localhost:8088"
tcpServerTarget="start-functional-test-tcp-server"
httpServerTarget="start-functional-test-http-server-secure"
testTarget="junit-functional-secure"
httpStopTarget="stop-functional-test-http-server-secure" />
</target>
<!-- =================================================================== -->
<!-- Run simple tests -->
<!-- =================================================================== -->
<target name="simple-tests" depends="setenv" if="junit.present" >
<runaxisfunctionaltests
url="http://localhost:8088"
tcpServerTarget="start-functional-test-tcp-server"
httpServerTarget="start-functional-test-http-server"
testTarget="printEnv"
httpStopTarget="stop-functional-test-http-server" />
</target>
<!-- =================================================================== -->
<!-- This simply echos the component files, for sanity checks -->
<!-- =================================================================== -->
<target name="echoTest" >
<foreach target="echo-file" fork="${foreach.fork}" inheritAll="${ant.inheritAll}" inheritRefs="${ant.inheritRefs}">
<param name="file">
<fileset dir="${axis.home}" >
<patternset>
<include name="test/**/build.xml"/>
<exclude name="test/wsdl/interop3/**/build.xml" />
</patternset>
</fileset>
</param>
</foreach>
</target>
<!-- =================================================================== -->
<!-- This runs each test component, instantiating the server each time -->
<!-- =================================================================== -->
<target name="componentTest" >
<foreach target="batch-component-run" fork="${foreach.fork}" inheritAll="${ant.inheritAll}" inheritRefs="${ant.inheritRefs}">
<param name="file">
<fileset dir="${axis.home}" >
<patternset>
<include name="test/**/build.xml"/>
<exclude name="test/wsdl/interop3/**/build.xml" />
</patternset>
</fileset>
</param>
</foreach>
</target>
<!-- =================================================================== -->
<!-- This runs all the tests, but only execs the server ONCE -->
<!-- =================================================================== -->
<target name="batchTest" depends="transport-layer">
<runaxisfunctionaltests
url="http://localhost:${test.functional.TCPListenerPort}"
tcpServerTarget="start-functional-test-tcp-server"
httpServerTarget="start-functional-test-http-server"
testTarget="batch-junit-functional"
httpStopTarget="stop-functional-test-http-server" />
<ant inheritAll="${ant.inheritAll}" inheritRefs="${ant.inheritRefs}" dir="${axis.home}/test/functional" antfile="build.xml" target="run"/>
</target>
<target name="batch-junit-functional" depends="start-signature-signing-and-verification">
<foreach target="batch-component-test" fork="${foreach.fork}" inheritAll="${ant.inheritAll}" inheritRefs="${ant.inheritRefs}">
<param name="file">
<fileset dir="${axis.home}" >
<patternset>
<include name="test/**/build.xml"/>
<exclude name="test/wsdl/interop/build.xml" />
<exclude name="test/wsdl/interop3/**/build.xml" />
</patternset>
</fileset>
</param>
</foreach>
</target>
<!-- generate a report from all the tests.
requires Xalan or other XSLT engine in ant\lib-->
<target name="create-test-report" description="create the test report" >
<mkdir dir="${test.reports.dir}"/>
<junitreport todir="${test.functional.reportdir}">
<fileset dir="${test.functional.reportdir}">
<include name="TEST-*.xml"/>
</fileset>
<report format="frames" todir="${test.reports.dir}" styledir="xmls"/>
</junitreport>
</target>
</project>