Skip to content

Commit afc0a2f

Browse files
author
Matthias Radestock
committed
merge bug19469
2 parents 393ef92 + f398b73 commit afc0a2f

File tree

3 files changed

+46
-12
lines changed

3 files changed

+46
-12
lines changed

build.xml

Lines changed: 44 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -106,15 +106,20 @@
106106
</fileset>
107107
</javadoc>
108108
</target>
109+
110+
<target name="test-prepare">
111+
<property name="haltOnFailureJunit" value="yes" />
112+
<property name="haltOnFailureJava" value="true" />
113+
</target>
109114

110-
<target name="test-build">
115+
<target name="test-build" depends="test-prepare">
111116
<antcall target="test-build-param">
112117
<param name="javac.source" value="${standard.javac.source}"/>
113118
<param name="javac.target" value="${standard.javac.target}"/>
114119
</antcall>
115120
</target>
116121

117-
<target name="test-build-alt">
122+
<target name="test-build-alt" depends="test-prepare">
118123
<antcall target="test-build-param">
119124
<param name="javac.source" value="${alt.javac.source}"/>
120125
<param name="javac.target" value="${alt.javac.target}"/>
@@ -148,7 +153,8 @@
148153
</target>
149154

150155
<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">
152158
<jvmarg value="-Xdebug"/>
153159
<arg value="${broker.hostname}"/>
154160
<arg value="${broker.port}"/>
@@ -161,7 +167,8 @@
161167
</target>
162168

163169
<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">
165172
<jvmarg value="-Xdebug"/>
166173
<jvmarg value="-Dsilent=true"/>
167174
<arg value="${broker.hostname}"/>
@@ -176,7 +183,9 @@
176183

177184
<!-- Alternate version that runs using Java 1.4 as a compatibility test -->
178185
<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">
180189
<jvmarg value="-Xdebug"/>
181190
<jvmarg value="-Dsilent=true"/>
182191
<arg value="${broker.hostname}"/>
@@ -192,7 +201,8 @@
192201
</target>
193202

194203
<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">
196206
<jvmarg value="-Xdebug"/>
197207
<jvmarg value="-Dsilent=true"/>
198208
<arg value="${broker.hostname}"/>
@@ -236,10 +246,28 @@
236246
</java>
237247
</target>
238248

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"/>
240265

241266
<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">
243271
<classpath refid="test.classpath"/>
244272

245273
<formatter type="plain"/>
@@ -249,7 +277,10 @@
249277
</target>
250278

251279
<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">
253284
<classpath refid="test.classpath"/>
254285

255286
<formatter type="plain"/>
@@ -259,7 +290,10 @@
259290
</target>
260291

261292
<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">
263297
<classpath refid="test.classpath"/>
264298
<formatter type="plain"/>
265299
<formatter type="xml"/>

test/src/com/rabbitmq/examples/ConsumerMain.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ public void summariseProgress(long now) {
291291
double intervalRate = countOverInterval / ((now - _previousReportTime) / 1000.0);
292292
_previousReceived = _received;
293293
_previousReportTime = now;
294-
System.err.println((now - _startTime) + " ms: Received " + _received + " - " + countOverInterval + " since last report (" + (int) intervalRate
294+
System.out.println((now - _startTime) + " ms: Received " + _received + " - " + countOverInterval + " since last report (" + (int) intervalRate
295295
+ " Hz)");
296296
}
297297
}

test/src/com/rabbitmq/examples/ProducerMain.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,6 @@ public void report(long totalDelta) {
239239
public void summariseProgress(long startTime, long now, int sent, long previousReportTime, int previousSent) {
240240
int countOverInterval = sent - previousSent;
241241
double intervalRate = countOverInterval / ((now - previousReportTime) / 1000.0);
242-
System.err.println((now - startTime) + " ms: Sent " + sent + " - " + countOverInterval + " since last report (" + (int) intervalRate + " Hz)");
242+
System.out.println((now - startTime) + " ms: Sent " + sent + " - " + countOverInterval + " since last report (" + (int) intervalRate + " Hz)");
243243
}
244244
}

0 commit comments

Comments
 (0)