Skip to content

Commit 97ae9d0

Browse files
author
Matthew Sackman
committed
Merging bug23637 to default
2 parents 900364d + a72b0f3 commit 97ae9d0

27 files changed

+155
-65
lines changed

README-TESTS

Lines changed: 45 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,32 +12,26 @@ The suites are:
1212
Server tests
1313
SSL tests
1414

15-
All the tests require a conforming server listening on localhost:5672
16-
(the default settings). For details on running specific tests, see
17-
below.
15+
The Server test suite cannot be launched from the public umbrella
16+
( http://hg.rabbitmq.com/rabbitmq-public-umbrella ). Attempting to launch
17+
this suite by executing the "test-server" ant target will fail, because
18+
test necessary prerequisites are not present in the public umbrella.
1819

19-
All the test suites can be run with the command ant test-suite. To run
20-
specific test suites see the instructions below.
20+
All other tests require a conforming server listening on localhost:5672
21+
(the default settings). SSL tests require a broker listening on the default
22+
SSL port. For details on running specific tests, see below.
2123

2224

2325
Running a Specific Test Suite
2426
=============================
2527

26-
To run a specific test suite, but not the others, you should execute
27-
one of the following in the top-level directory of the source tree:
28+
To run a specific test suite you should execute one of the following in the
29+
top-level directory of the source tree:
2830

2931
ant test-client
3032
ant test-functional
31-
ant test-server
3233
ant test-ssl
3334

34-
Note that to run the SSL tests, the RabbitMQ server should be
35-
configured to use SSL as per the SSL with RabbitMQ guide.
36-
37-
The server tests are meant to test a RabbitMQ broker. Broadly, they
38-
require a running RabbitMQ broker on the default host/port, the source
39-
code for rabbitmq-server in ../rabbitmq-server, and a test directory
40-
../rabbitmq-test. Running them manually is a tricky business.
4135

4236
For example, to run the client tests:
4337

@@ -66,3 +60,39 @@ BUILD SUCCESSFUL
6660

6761
If any tests are broken details can be found by viewing this file:
6862
build/TEST-com.rabbitmq.client.test.ClientTests.txt
63+
64+
65+
SSL Test Setup
66+
--------------
67+
68+
To run the SSL tests, the RabbitMQ server and Java client should be configured
69+
as per the SSL instructions on the RabbitMQ website. The SSL_CERTS_DIR
70+
environment variable must point to a certificate folder with the following
71+
minimal structure:
72+
73+
$SSL_CERTS_DIR
74+
|-- client
75+
| |-- keycert.p12
76+
| |-- cert.pem
77+
| \-- key.pem
78+
|-- server
79+
| |-- cert.pem
80+
| \-- key.pem
81+
\-- testca
82+
\-- cacert.pem
83+
84+
The PASSWORD environment variable must be set to the password of the keycert.p12
85+
PKCS12 keystore. The broker must be configured to validate client certificates.
86+
This will become minimal broker configuration file if $SSL_CERTS_DIR is replaced
87+
with the certificate folder:
88+
89+
%%%%% begin sample test broker configuration
90+
[{rabbit, [{ssl_listeners, [5671]},
91+
{ssl_options, [{cacertfile,"$SSL_CERTS_DIR/testca/cacert.pem"},
92+
{certfile,"$SSL_CERTS_DIR/server/cert.pem"},
93+
{keyfile,"$SSL_CERTS_DIR/server/key.pem"},
94+
{verify,verify_peer},
95+
{fail_if_no_peer_cert, false}]}]}].
96+
%%%%% end sample test broker configuration
97+
98+

build.properties

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
1+
alt.javac.source=1.6
2+
alt.javac.target=1.6
13
build.out=build
2-
lib.out=${build.out}/lib
4+
bundle.name=RabbitMQ Java AMQP client library
5+
bundle.out=${build.out}/bundle
6+
bundle.symbolicName=com.rabbitmq.client
7+
bundlor.home=bundlor
38
dist.out=${build.out}/dist
4-
src.generated=${build.out}/gensrc
9+
impl.version=0.0.0
510
javac.debug=true
11+
javac.out=${build.out}/classes
12+
javadoc.out=build/doc/api
13+
lib.out=${build.out}/lib
14+
python.bin=python
15+
sibling.codegen.dir=../rabbitmq-codegen/
16+
spec.version=0.9.1
17+
src.generated=${build.out}/gensrc
618
standard.javac.source=1.5
719
standard.javac.target=1.5
8-
alt.javac.source=1.6
9-
alt.javac.target=1.6
10-
javac.out=${build.out}/classes
1120
test.javac.out=${build.out}/test/classes
1221
test.src.home=test/src
13-
sibling.codegen.dir=../rabbitmq-codegen/
14-
spec.version=0.9.1
15-
bundle.out=${build.out}/bundle
16-
javadoc.out=build/doc/api
17-
python.bin=python

build.xml

Lines changed: 38 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?xml version="1.0"?>
2-
<project name="RabbitMQ Java client" default="build">
2+
<project name="RabbitMQ Java client" default="build"
3+
xmlns:bundlor="antlib:com.springsource.bundlor.ant">
34

45
<property file="build.properties"/>
56
<property file="config.properties"/>
@@ -386,7 +387,7 @@
386387
</junit>
387388
</target>
388389

389-
<target name="jar" depends="build">
390+
<target name="jar" depends="build, bundlor.do">
390391
<mkdir dir="${lib.out}"/>
391392
<antcall target="doJarWithTags">
392393
<param name="jar.name" value="rabbitmq-client"/>
@@ -410,7 +411,7 @@
410411
token="VERSION" value="${impl.version}"/>
411412
</target>
412413

413-
<target name="test-jar" depends="test-build">
414+
<target name="test-jar" depends="test-build, test-bundlor.do">
414415
<mkdir dir="${lib.out}"/>
415416
<antcall target="doJarWithTags">
416417
<param name="jar.name" value="rabbitmq-client-tests"/>
@@ -420,7 +421,8 @@
420421

421422
<target name="doJarWithTags">
422423
<jar destfile="${lib.out}/${jar.name}.jar"
423-
basedir="${base}">
424+
basedir="${base}"
425+
filesetmanifest="merge">
424426
<manifest>
425427
<section name="${jar.name}">
426428
<attribute name="Specification-Title" value="AMQP"/>
@@ -461,4 +463,36 @@
461463
<target name="clean-tests">
462464
<delete dir="build/test"/>
463465
</target>
466+
467+
<target name="bundlor.init">
468+
<taskdef resource="com/springsource/bundlor/ant/antlib.xml"
469+
uri="antlib:com.springsource.bundlor.ant">
470+
<classpath id="bundlor.classpath">
471+
<fileset dir="${bundlor.home}/dist"/>
472+
<fileset dir="${bundlor.home}/lib"/>
473+
</classpath>
474+
</taskdef>
475+
</target>
476+
477+
<target name="bundlor.do" depends="bundlor.init">
478+
<bundlor:bundlor
479+
inputPath="${javac.out}"
480+
outputPath="${javac.out}"
481+
manifestTemplatePath="bundlorTemplate.mf">
482+
<propertyset>
483+
<propertyref builtin="all"/>
484+
</propertyset>
485+
</bundlor:bundlor>
486+
</target>
487+
488+
<target name="test-bundlor.do" depends="bundlor.init">
489+
<bundlor:bundlor
490+
inputPath="${test.javac.out}"
491+
outputPath="${test.javac.out}"
492+
manifestTemplatePath="bundlorTestTemplate.mf">
493+
<propertyset>
494+
<propertyref builtin="all"/>
495+
</propertyset>
496+
</bundlor:bundlor>
497+
</target>
464498
</project>
131 KB
Binary file not shown.
16.6 KB
Binary file not shown.
13.3 KB
Binary file not shown.
Binary file not shown.
40.6 KB
Binary file not shown.
42.5 KB
Binary file not shown.
32.5 KB
Binary file not shown.

0 commit comments

Comments
 (0)