|
106 | 106 | </fileset>
|
107 | 107 | </javadoc>
|
108 | 108 | </target>
|
| 109 | + |
| 110 | + <target name="test-prepare"> |
| 111 | + <property name="haltOnFailureJunit" value="yes" /> |
| 112 | + <property name="haltOnFailureJava" value="true" /> |
| 113 | + </target> |
109 | 114 |
|
110 |
| - <target name="test-build"> |
| 115 | + <target name="test-build" depends="test-prepare"> |
111 | 116 | <antcall target="test-build-param">
|
112 | 117 | <param name="javac.source" value="${standard.javac.source}"/>
|
113 | 118 | <param name="javac.target" value="${standard.javac.target}"/>
|
114 | 119 | </antcall>
|
115 | 120 | </target>
|
116 | 121 |
|
117 |
| - <target name="test-build-alt"> |
| 122 | + <target name="test-build-alt" depends="test-prepare"> |
118 | 123 | <antcall target="test-build-param">
|
119 | 124 | <param name="javac.source" value="${alt.javac.source}"/>
|
120 | 125 | <param name="javac.target" value="${alt.javac.target}"/>
|
|
148 | 153 | </target>
|
149 | 154 |
|
150 | 155 | <target name="test-main" depends="test-build">
|
151 |
| - <java fork="true" classname="${test.main}"> |
| 156 | + <java fork="true" classname="${test.main}" |
| 157 | + failonerror="${haltOnFailureJava}" errorproperty="test.failure"> |
152 | 158 | <jvmarg value="-Xdebug"/>
|
153 | 159 | <arg value="${broker.hostname}"/>
|
154 | 160 | <arg value="${broker.port}"/>
|
|
161 | 167 | </target>
|
162 | 168 |
|
163 | 169 | <target name="test-main-silent" depends="test-build">
|
164 |
| - <java fork="true" classname="${test.main}"> |
| 170 | + <java fork="true" classname="${test.main}" |
| 171 | + failonerror="${haltOnFailureJava}" errorproperty="test.failure"> |
165 | 172 | <jvmarg value="-Xdebug"/>
|
166 | 173 | <jvmarg value="-Dsilent=true"/>
|
167 | 174 | <arg value="${broker.hostname}"/>
|
|
176 | 183 |
|
177 | 184 | <!-- Alternate version that runs using Java 1.4 as a compatibility test -->
|
178 | 185 | <target name="test-main-silent-1.4" depends="dist1.4">
|
179 |
| - <java fork="true" classname="${test.main}" jvm="${java-jvm-1.4}"> |
| 186 | + <java fork="true" classname="${test.main}" |
| 187 | + jvm="${java-jvm-1.4}" failonerror="${haltOnFailureJava}" |
| 188 | + errorproperty="test.failure"> |
180 | 189 | <jvmarg value="-Xdebug"/>
|
181 | 190 | <jvmarg value="-Dsilent=true"/>
|
182 | 191 | <arg value="${broker.hostname}"/>
|
|
192 | 201 | </target>
|
193 | 202 |
|
194 | 203 | <target name="test-main-silent-alt" depends="test-build-alt">
|
195 |
| - <java fork="true" classname="${test.main}"> |
| 204 | + <java fork="true" classname="${test.main}" |
| 205 | + failonerror="${haltOnFailureJava}" errorproperty="test.failure"> |
196 | 206 | <jvmarg value="-Xdebug"/>
|
197 | 207 | <jvmarg value="-Dsilent=true"/>
|
198 | 208 | <arg value="${broker.hostname}"/>
|
|
236 | 246 | </java>
|
237 | 247 | </target>
|
238 | 248 |
|
239 |
| - <target name="test-suite" depends="test, test-persister-restart, test-functional, test-main-silent"/> |
| 249 | + <target name="test-suite-prepare"> |
| 250 | + <property name="haltOnFailureJunit" value="no" /> |
| 251 | + <property name="haltOnFailureJava" value="false" /> |
| 252 | + </target> |
| 253 | + |
| 254 | + <target name="test-suite" depends="test-suite-prepare, test-suite-run"> |
| 255 | + <fail message="Errors occured in tests"> |
| 256 | + <condition> |
| 257 | + <not> |
| 258 | + <equals arg1="${test.failure}" arg2="" /> |
| 259 | + </not> |
| 260 | + </condition> |
| 261 | + </fail> |
| 262 | + </target> |
| 263 | + |
| 264 | + <target name="test-suite-run" depends="test, test-persister-restart, test-functional, test-main-silent"/> |
240 | 265 |
|
241 | 266 | <target name="test" depends="test-build">
|
242 |
| - <junit printSummary="withOutAndErr" haltOnFailure="no" fork="yes"> |
| 267 | + <junit printSummary="withOutAndErr" |
| 268 | + haltOnFailure="${haltOnFailureJunit}" |
| 269 | + failureproperty="test.failure" |
| 270 | + fork="yes"> |
243 | 271 | <classpath refid="test.classpath"/>
|
244 | 272 |
|
245 | 273 | <formatter type="plain"/>
|
|
249 | 277 | </target>
|
250 | 278 |
|
251 | 279 | <target name="test-functional" depends="test-build">
|
252 |
| - <junit printSummary="withOutAndErr" haltOnFailure="no" fork="yes"> |
| 280 | + <junit printSummary="withOutAndErr" |
| 281 | + haltOnFailure="${haltOnFailureJunit}" |
| 282 | + failureproperty="test.failure" |
| 283 | + fork="yes"> |
253 | 284 | <classpath refid="test.classpath"/>
|
254 | 285 |
|
255 | 286 | <formatter type="plain"/>
|
|
259 | 290 | </target>
|
260 | 291 |
|
261 | 292 | <target name="test-persister-restart" depends="test-build">
|
262 |
| - <junit printSummary="withOutAndErr" haltOnFailure="no" fork="yes"> |
| 293 | + <junit printSummary="withOutAndErr" |
| 294 | + haltOnFailure="${haltOnFailureJunit}" |
| 295 | + failureproperty="test.failure" |
| 296 | + fork="yes"> |
263 | 297 | <classpath refid="test.classpath"/>
|
264 | 298 | <formatter type="plain"/>
|
265 | 299 | <formatter type="xml"/>
|
|
0 commit comments