1
<?xml version="1.0" encoding="utf-8"?>
3
<project name="JsUnit" default="create_distribution" basedir=".">
6
The following are the properties used to configure the JsUnit server. You need to provide values for the mandatory properties.
7
See the documentation at http://www.jsunit.net for more information.
11
name="browserFileNames"
13
description="browserFileNames is the list of browsers in which to run tests when StandaloneTest is invoked on this machine. For a JsUnit Server, this is a mandatory property. For example: 'c:\program files\internet explorer\iexplore.exe,c:\program files\netscape\netscape7.1\netscp.exe'"
17
id="closeBrowsersAfterTestRuns"
18
name="closeBrowsersAfterTestRuns"
20
description="closeBrowsersAfterTestRuns determines whether to attempt to close browsers after test runs. This is not a mandatory property. The default is true. For example: 'true'"
27
description="description is a human-readable description of a standard or farm server. This is not a mandatory property. The default is blank. For example: 'This is our Mac - it's only running Safari right now'"
31
id="ignoreUnresponsiveRemoteMachines"
32
name="ignoreUnresponsiveRemoteMachines"
34
description="ignoreUnresponsiveRemoteMachines is a property used only by the JsUnit Farm Server and the distributed_test target. Its value is whether to ignore a remove machine that does not respond. If true, test runs will be green even if one or more remove machines fail to respond; if false, an unresponsive remove machine results in a failure. This is not a mandatory property. Its default is false. For example: 'true'"
41
description="logsDirectory is the directory in which the JsUnitStandardServer stores the XML logs produced from tests run. It can be specified relative to the working directory. This is not a mandatory property. If not specified, the directory called 'logs' inside resourceBase is assumed. For example: 'c:\jsunit\java\logs'"
48
description="port is the port on which the JsUnitStandardServer runs. This is not a mandatory property. If not specified, 8080 is assumed. For exapmle: '8080'"
52
id="remoteMachineURLs"
53
name="remoteMachineURLs"
55
description="remoteMachineURLs is a property used only by the JsUnit Farm Server and the distributed_test target. Its value is the list of URLs of remove machines to which a request to run tests will be sent. For example: 'http://machine1.company.com:8080,http://localhost:8080,http://192.168.1.200:9090'"
62
description="resourceBase is the directory that the JsUnitStandardServer considers to be its document root. It can be specified relative to the working directory. This is not a mandatory property. If not specified, the working directory is assumed. For example: 'c:\jsunit'"
69
description="timeoutSeconds is the number of seconds to wait before timing out a browser during a test run. This is not a mandatory property. If not specified, 60 is assumed. For example: '60'"
75
value="http://localhost/hv/lib/jsunit-2.2/testRunner.html?testPage=http://localhost/hv/test/testUserSettings.html"
76
description="url is the URL (HTTP or file protocol) to open in the browser. For a JsUnit Server, this is a mandatory property for a test run if the server is not passed the 'url' parameter. For example: 'file:///c:/jsunit/testRunner.html?testPage=c:/jsunit/tests/jsUnitTestSuite.html'"
80
The remainder of this build file is not intended to be modified by the end user.
81
Those targets whose name begins with an underscore are not intended to be run directly by the end user.
84
<property name="source_core" location="java/source_core"/>
85
<property name="source_server" location="java/source_server"/>
86
<property name="tests_core" location="java/tests_core"/>
87
<property name="tests_server" location="java/tests_server"/>
88
<property name="bin" location="java/bin"/>
89
<property name="lib" location="java/lib"/>
90
<property name="testlib" location="java/testlib"/>
91
<property name="config" location="java/config"/>
92
<property name="loggingPropertiesFile" location="logging.properties"/>
93
<property name="morelibs" location="/usr/share/java"/>
96
<fileset dir="${lib}">
97
<include name="*.jar"/>
98
<include name="*/*.jar"/>
100
<fileset dir="${morelibs}">
101
<include name="*.jar"/>
102
<include name="*/*.jar"/>
104
<fileset dir="${bin}">
105
<include name="jsunit.jar"/>
109
<path id="self_tests_classpath">
110
<fileset dir="${lib}">
111
<include name="*.jar"/>
113
<fileset dir="${testlib}">
114
<include name="*.jar"/>
116
<fileset dir="${bin}">
117
<include name="jsunit.jar"/>
119
<dirset dir="${config}"/>
122
<target name="_compile_source" description="Compiles the source">
123
<delete dir="${bin}/net"/>
124
<javac srcdir="${source_core}" destdir="${bin}" debug="true">
126
<fileset dir="${lib}">
127
<include name="*.jar"/>
131
<javac srcdir="${source_server}" destdir="${bin}" debug="true">
133
<fileset dir="${lib}">
134
<include name="*.jar"/>
136
<path location="${bin}"/>
141
<target name="_compile_tests" description="Compiles the self-tests">
142
<javac srcdir="${tests_core}" destdir="${bin}" debug="true">
143
<classpath refid="self_tests_classpath"/>
145
<javac srcdir="${tests_server}" destdir="${bin}" debug="true">
146
<classpath refid="self_tests_classpath"/>
150
<target name="_create_jar" depends="_compile_source" description="Creates jsunit.jar">
151
<delete file="${bin}/jsunit.jar"/>
152
<jar jarfile="${bin}/jsunit.jar" basedir="${bin}"/>
153
<delete dir="${bin}/net"/>
156
<target name="_generateJsUnitPropertiesSample" description="Generates the jsunit.properties.sample file">
157
<xslt in="build.xml" out="jsunit.properties.sample" destdir="."
158
style="xsl/buildDotXmlToJsUnitDotProperties.xsl"></xslt>
161
<target name="_run_unit_tests" depends="_compile_tests" description="Runs the JsUnit Java unit tests">
162
<junit fork="yes" haltonfailure="false" forkmode="once" showoutput="yes" printsummary="withOutAndErr"
163
failureproperty="junit_test_failed">
164
<formatter type="plain" usefile="false"/>
165
<classpath refid="self_tests_classpath"/>
166
<classpath path="${bin}"/>
167
<test name="net.jsunit.UnitTestSuite"/>
169
<fail if="junit_test_failed"/>
172
<target name="_run_all_tests" depends="_create_jar,_compile_tests"
173
description="Runs all the JsUnit Java tests. Used in the continuous build">
174
<junit fork="yes" haltonfailure="false" forkmode="once" showoutput="yes" printsummary="withOutAndErr"
175
failureproperty="junit_test_failed">
176
<formatter type="xml"/>
177
<classpath refid="self_tests_classpath"/>
178
<classpath path="${bin}"/>
179
<sysproperty key="java.security.manager" value="com.thoughtworks.ashcroft.runtime.JohnAshcroft"/>
180
<test name="net.jsunit.PureUnitTestSuite"/>
182
<junit fork="yes" haltonfailure="false" forkmode="once" showoutput="yes" printsummary="withOutAndErr"
183
failureproperty="junit_test_failed">
184
<formatter type="xml"/>
185
<classpath refid="self_tests_classpath"/>
186
<classpath path="${bin}"/>
187
<test name="net.jsunit.ImpureUnitTestSuite"/>
189
<junit fork="yes" haltonfailure="false" forkmode="once" showoutput="yes" printsummary="withOutAndErr"
190
failureproperty="junit_test_failed">
191
<formatter type="xml"/>
192
<classpath refid="self_tests_classpath"/>
193
<classpath path="${bin}"/>
194
<test name="net.jsunit.FunctionalTestSuite"/>
196
<junit fork="yes" haltonfailure="false" forkmode="once" showoutput="yes" printsummary="withOutAndErr"
197
failureproperty="junit_test_failed">
198
<formatter type="xml"/>
199
<classpath refid="self_tests_classpath"/>
200
<classpath path="${bin}"/>
201
<test name="net.jsunit.FarmServerFunctionalTestSuite"/>
203
<fail if="junit_test_failed"/>
206
<target name="create_distribution" depends="_create_jar,_run_unit_tests"
207
description="Creates and tests the JsUnit distribution"/>
209
<target name="start_server" description="Starts a JsUnit Server">
210
<java fork="true" classname="net.jsunit.JsUnitStandardServer">
211
<classpath refid="classpath"/>
212
<sysproperty key="java.util.logging.config.file" value="${loggingPropertiesFile}"/>
213
<sysproperty key="description" value="${description}"/>
214
<sysproperty key="browserFileNames" value="${browserFileNames}"/>
215
<sysproperty key="url" value="${url}"/>
216
<sysproperty key="port" value="${port}"/>
217
<sysproperty key="resourceBase" value="${resourceBase}"/>
218
<sysproperty key="logsDirectory" value="${logsDirectory}"/>
219
<sysproperty key="timeoutSeconds" value="${timeoutSeconds}"/>
220
<sysproperty key="closeBrowsersAfterTestRuns" value="${closeBrowsersAfterTestRuns}"/>
224
<target name="start_farm_server" description="Starts a JsUnit Farm Server">
225
<java fork="true" classname="net.jsunit.JsUnitFarmServer">
226
<classpath refid="classpath"/>
227
<sysproperty key="java.util.logging.config.file" value="${loggingPropertiesFile}"/>
228
<sysproperty key="description" value="${description}"/>
229
<sysproperty key="ignoreUnresponsiveRemoteMachines" value="${ignoreUnresponsiveRemoteMachines}"/>
230
<sysproperty key="logsDirectory" value="${logsDirectory}"/>
231
<sysproperty key="port" value="${port}"/>
232
<sysproperty key="remoteMachineURLs" value="${remoteMachineURLs}"/>
233
<sysproperty key="resourceBase" value="${resourceBase}"/>
234
<sysproperty key="url" value="${url}"/>
238
<target name="stop_server" description="Stops the JsUnit Server">
239
<java fork="true" classname="org.mortbay.stop.Main" failonerror="true">
240
<classpath refid="classpath"/>
244
<target name="standalone_test" description="Runs tests on the local machine">
245
<junit showoutput="true" haltonerror="true" haltonfailure="true">
246
<formatter type="plain" usefile="false"/>
247
<classpath refid="classpath"/>
248
<sysproperty key="browserFileNames" value="${browserFileNames}"/>
249
<sysproperty key="description" value="${description}"/>
250
<sysproperty key="closeBrowsersAfterTestRuns" value="${closeBrowsersAfterTestRuns}"/>
251
<sysproperty key="logsDirectory" value="${logsDirectory}"/>
252
<sysproperty key="port" value="${port}"/>
253
<sysproperty key="resourceBase" value="${resourceBase}"/>
254
<sysproperty key="timeoutSeconds" value="${timeoutSeconds}"/>
255
<sysproperty key="url" value="${url}"/>
256
<test name="net.jsunit.StandaloneTest"/>
260
<target name="distributed_test" description="Runs tests the remote machines">
261
<junit showoutput="true" haltonerror="true" haltonfailure="true">
262
<formatter type="plain" usefile="false"/>
263
<classpath refid="classpath"/>
264
<sysproperty key="browserFileNames" value="${browserFileNames}"/>
265
<sysproperty key="description" value="${description}"/>
266
<sysproperty key="ignoreUnresponsiveRemoteMachines" value="${ignoreUnresponsiveRemoteMachines}"/>
267
<sysproperty key="logsDirectory" value="${logsDirectory}"/>
268
<sysproperty key="port" value="${port}"/>
269
<sysproperty key="remoteMachineURLs" value="${remoteMachineURLs}"/>
270
<sysproperty key="resourceBase" value="${resourceBase}"/>
271
<sysproperty key="url" value="${url}"/>
272
<test name="net.jsunit.DistributedTest"/>