Skip to content

Commit 8cfa235

Browse files
author
Tim Clark
committed
Added a README_TESTS, modified the build.xml to only run server tests if umbrella present, added some more descriptions to ant targets
1 parent 1191221 commit 8cfa235

File tree

2 files changed

+92
-5
lines changed

2 files changed

+92
-5
lines changed

README-TESTS

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
There are multiple test suites in the RabbitMQ Java client library; the source
2+
for all of the suites can be found in the test/src directory.
3+
4+
The suites are:
5+
6+
Client tests
7+
Funtional tests
8+
9+
To run any of these test suites you need to first satisfy the following
10+
preconditions:
11+
12+
1. Ensure that you are running a RabbitMQ server locally on the standard
13+
port.
14+
2. Ensure that you have successfully built the javas client using ANT.
15+
16+
All the test suites can be run with the command ant test-suite. To run
17+
specific test suites see the instructions below.
18+
19+
20+
RUNNING CLIENT TESTS
21+
22+
To run these tests, from the command line in the project directory execute
23+
the command ant test-client. For example:
24+
25+
----------------- Example shell session -------------------------------------
26+
rabbitmq-java-client$ ant test-client
27+
Buildfile: build.xml
28+
29+
test-prepare:
30+
31+
test-build:
32+
33+
amqp-generate-check:
34+
35+
amqp-generate:
36+
37+
build:
38+
39+
test-build-param:
40+
41+
test-client:
42+
[junit] Running com.rabbitmq.client.test.ClientTests
43+
[junit] Tests run: 31, Failures: 0, Errors: 0, Time elapsed: 2.388 sec
44+
45+
BUILD SUCCESSFUL
46+
-----------------------------------------------------------------------------
47+
48+
If any tests are broken details can be found by viewing this file:
49+
build/TEST-com.rabbitmq.client.test.ClientTests.txt
50+
51+
52+
RUNNING FUNCTIONAL TESTS
53+
54+
To run these tests, from the command line in the project directory execute
55+
the command ant test-functional.
56+
57+
----------------- Example shell session -------------------------------------
58+
rabbitmq-java-client$ ant test-functional
59+
Buildfile: build.xml
60+
61+
test-prepare:
62+
63+
test-build:
64+
65+
amqp-generate-check:
66+
67+
amqp-generate:
68+
69+
build:
70+
71+
test-build-param:
72+
73+
test-functional:
74+
[junit] Running com.rabbitmq.client.test.functional.FunctionalTests
75+
[junit] Tests run: 69, Failures: 0, Errors: 0, Time elapsed: 10.621 sec
76+
77+
BUILD SUCCESSFUL
78+
Total time: 11 seconds
79+
-----------------------------------------------------------------------------
80+
81+
If any tests are broken details can be found by viewing this file:
82+
build/TEST-com.rabbitmq.client.test.functional.FunctionalTests.txt
83+

build.xml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
</fail>
7878
</target>
7979

80-
<target name="build" depends="amqp-generate">
80+
<target name="build" depends="amqp-generate" description="Build the client library.">
8181
<mkdir dir="${javac.out}"/>
8282
<copy file="src/com/rabbitmq/client/impl/ClientVersion.java.in"
8383
tofile="${src.generated}/com/rabbitmq/client/impl/ClientVersion.java">
@@ -116,6 +116,10 @@
116116
<property name="SSL_P12_PASSWORD" value="${env.PASSWORD}"/>
117117
</target>
118118

119+
<target name="detect-umbrella">
120+
<available property="UMBRELLA_AVAIALBLE" file="../rabbitmq-test"/>
121+
</target>
122+
119123
<target name="detect-tmpdir">
120124
<property environment="env"/>
121125
<condition property="TMPDIR" value="${env.TMPDIR}" else="/tmp">
@@ -317,7 +321,7 @@
317321
<property name="haltOnFailureJava" value="false" />
318322
</target>
319323

320-
<target name="test-suite" depends="test-suite-prepare, test-suite-run">
324+
<target name="test-suite" depends="test-suite-prepare, test-suite-run" description="Run all test suites.">
321325
<fail message="Errors occured in tests">
322326
<condition>
323327
<not>
@@ -329,7 +333,7 @@
329333

330334
<target name="test-suite-run" depends="test-client, test-ssl, test-server, test-functional, test-main-silent"/>
331335

332-
<target name="test-client" depends="test-build">
336+
<target name="test-client" depends="test-build" description="Run the client test suites.">
333337
<junit printSummary="withOutAndErr"
334338
haltOnFailure="${haltOnFailureJunit}"
335339
failureproperty="test.failure"
@@ -362,7 +366,7 @@
362366
<antcall target="remove-client-keystore"/>
363367
</target>
364368

365-
<target name="test-functional" depends="test-build">
369+
<target name="test-functional" depends="test-build" description="Run the functional test suite.">
366370
<junit printSummary="withOutAndErr"
367371
haltOnFailure="${haltOnFailureJunit}"
368372
failureproperty="test.failure"
@@ -375,7 +379,7 @@
375379
</junit>
376380
</target>
377381

378-
<target name="test-server" depends="test-build">
382+
<target name="test-server" depends="test-build" if="UMBRELLA_AVAILABLE">
379383
<junit printSummary="withOutAndErr"
380384
haltOnFailure="${haltOnFailureJunit}"
381385
failureproperty="test.failure"

0 commit comments

Comments
 (0)