~jstys-z/helioviewer.org/client5

« back to all changes in this revision

Viewing changes to lib/jsunit-2.2/build.xml

  • Committer: V. Keith Hughitt
  • Date: 2009-04-01 21:08:05 UTC
  • Revision ID: hughitt1@kore-20090401210805-372f7dgih07vxk42
nightly build 04-01-2009

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version="1.0" encoding="utf-8"?>
 
2
 
 
3
<project name="JsUnit" default="create_distribution" basedir=".">
 
4
 
 
5
    <!--
 
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.
 
8
     -->
 
9
 
 
10
    <property
 
11
            name="browserFileNames"
 
12
            value="firefox,opera"
 
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'"
 
14
            />
 
15
 
 
16
    <property
 
17
            id="closeBrowsersAfterTestRuns"
 
18
            name="closeBrowsersAfterTestRuns"
 
19
            value=""
 
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'"
 
21
            />
 
22
 
 
23
    <property
 
24
            id="description"
 
25
            name="description"
 
26
            value=""
 
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'"
 
28
            />
 
29
 
 
30
    <property
 
31
            id="ignoreUnresponsiveRemoteMachines"
 
32
            name="ignoreUnresponsiveRemoteMachines"
 
33
            value=""
 
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'"
 
35
            />
 
36
 
 
37
    <property
 
38
            id="logsDirectory"
 
39
            name="logsDirectory"
 
40
            value=""
 
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'"
 
42
            />
 
43
 
 
44
    <property
 
45
            id="port"
 
46
            name="port"
 
47
            value="8081"
 
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'"
 
49
            />
 
50
 
 
51
    <property
 
52
            id="remoteMachineURLs"
 
53
            name="remoteMachineURLs"
 
54
            value=""
 
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'"
 
56
            />
 
57
 
 
58
    <property
 
59
            id="resourceBase"
 
60
            name="resourceBase"
 
61
            value=""
 
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'"
 
63
            />
 
64
 
 
65
    <property
 
66
            id="timeoutSeconds"
 
67
            name="timeoutSeconds"
 
68
            value=""
 
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'"
 
70
            />
 
71
 
 
72
    <property
 
73
            id="url"
 
74
            name="url"
 
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'"
 
77
            />
 
78
 
 
79
    <!--
 
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.
 
82
     -->
 
83
 
 
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"/>
 
94
   
 
95
    <path id="classpath">
 
96
        <fileset dir="${lib}">
 
97
            <include name="*.jar"/>
 
98
            <include name="*/*.jar"/>
 
99
        </fileset>
 
100
        <fileset dir="${morelibs}">
 
101
            <include name="*.jar"/>
 
102
            <include name="*/*.jar"/>
 
103
        </fileset>
 
104
        <fileset dir="${bin}">
 
105
            <include name="jsunit.jar"/>
 
106
        </fileset>
 
107
    </path>
 
108
 
 
109
    <path id="self_tests_classpath">
 
110
        <fileset dir="${lib}">
 
111
            <include name="*.jar"/>
 
112
        </fileset>
 
113
        <fileset dir="${testlib}">
 
114
            <include name="*.jar"/>
 
115
        </fileset>
 
116
        <fileset dir="${bin}">
 
117
            <include name="jsunit.jar"/>
 
118
        </fileset>
 
119
        <dirset dir="${config}"/>
 
120
    </path>
 
121
 
 
122
    <target name="_compile_source" description="Compiles the source">
 
123
        <delete dir="${bin}/net"/>
 
124
        <javac srcdir="${source_core}" destdir="${bin}" debug="true">
 
125
            <classpath>
 
126
                <fileset dir="${lib}">
 
127
                    <include name="*.jar"/>
 
128
                </fileset>
 
129
            </classpath>
 
130
        </javac>
 
131
        <javac srcdir="${source_server}" destdir="${bin}" debug="true">
 
132
            <classpath>
 
133
                <fileset dir="${lib}">
 
134
                    <include name="*.jar"/>
 
135
                </fileset>
 
136
                <path location="${bin}"/>
 
137
            </classpath>
 
138
        </javac>
 
139
    </target>
 
140
 
 
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"/>
 
144
        </javac>
 
145
        <javac srcdir="${tests_server}" destdir="${bin}" debug="true">
 
146
            <classpath refid="self_tests_classpath"/>
 
147
        </javac>
 
148
    </target>
 
149
 
 
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"/>
 
154
    </target>
 
155
 
 
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>
 
159
    </target>
 
160
 
 
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"/>
 
168
        </junit>
 
169
        <fail if="junit_test_failed"/>
 
170
    </target>
 
171
 
 
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"/>
 
181
        </junit>
 
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"/>
 
188
        </junit>
 
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"/>
 
195
        </junit>
 
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"/>
 
202
        </junit>
 
203
        <fail if="junit_test_failed"/>
 
204
    </target>
 
205
 
 
206
    <target name="create_distribution" depends="_create_jar,_run_unit_tests"
 
207
            description="Creates and tests the JsUnit distribution"/>
 
208
 
 
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}"/>
 
221
        </java>
 
222
    </target>
 
223
 
 
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}"/>
 
235
        </java>
 
236
    </target>
 
237
 
 
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"/>
 
241
        </java>
 
242
    </target>
 
243
 
 
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"/>
 
257
        </junit>
 
258
    </target>
 
259
 
 
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"/>
 
273
        </junit>
 
274
    </target>
 
275
 
 
276
</project>