Skip to content

Commit 6220f38

Browse files
author
Steve Powell
committed
LocalTempBranch for me
2 parents d87941d + 0e0779c commit 6220f38

File tree

3 files changed

+100
-69
lines changed

3 files changed

+100
-69
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.xml

Lines changed: 53 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,14 @@
4646
unless="amqp.generate.notRequired" description="generate AMQP.java and AMQImpl.java from AMQP spec">
4747
<mkdir dir="${src.generated}/com/rabbitmq/client/"/>
4848
<exec dir="." executable="${python.bin}"
49-
errorproperty="amqp.generate.error1"
49+
errorproperty="amqp.generate.error1"
5050
resultproperty="amqp.generate.result1">
5151
<arg line="codegen.py"/>
5252
<arg line="header"/>
5353
<arg line="${AMQP_SPEC_JSON_PATH}"/>
5454
<arg line="${src.generated}/com/rabbitmq/client/AMQP.java"/>
5555
</exec>
56-
<fail message="Generation of AMQP.java failed with message:${line.separator}${amqp.generate.error1}">
56+
<fail message="Generation of AMQP.java failed with message:${line.separator}${amqp.generate.error1}">
5757
<condition>
5858
<not>
5959
<equals arg1="${amqp.generate.result1}" arg2="0" />
@@ -69,28 +69,28 @@
6969
<arg line="${AMQP_SPEC_JSON_PATH}"/>
7070
<arg line="${src.generated}/com/rabbitmq/client/impl/AMQImpl.java"/>
7171
</exec>
72-
<fail message="Generation of AMQPImpl.java failed with message:${line.separator}${amqp.generate.error2}">
73-
<condition>
74-
<not>
75-
<equals arg1="${amqp.generate.result2}" arg2="0" />
76-
</not>
77-
</condition>
78-
</fail>
72+
<fail message="Generation of AMQPImpl.java failed with message:${line.separator}${amqp.generate.error2}">
73+
<condition>
74+
<not>
75+
<equals arg1="${amqp.generate.result2}" arg2="0" />
76+
</not>
77+
</condition>
78+
</fail>
7979
</target>
8080

8181
<target name="build" depends="amqp-generate" description="Build the client library.">
8282
<mkdir dir="${javac.out}"/>
8383
<copy file="src/com/rabbitmq/client/impl/ClientVersion.java.in"
84-
tofile="${src.generated}/com/rabbitmq/client/impl/ClientVersion.java">
84+
tofile="${src.generated}/com/rabbitmq/client/impl/ClientVersion.java">
8585
<filterset>
86-
<filter token="VERSION" value="${impl.version}"/>
86+
<filter token="VERSION" value="${impl.version}"/>
8787
</filterset>
8888
</copy>
8989
<javac destdir="${javac.out}"
90-
classpathref="javac.classpath"
91-
source="${standard.javac.source}"
92-
target="${standard.javac.target}"
93-
debug="${javac.debug}">
90+
classpathref="javac.classpath"
91+
source="${standard.javac.source}"
92+
target="${standard.javac.target}"
93+
debug="${javac.debug}">
9494
<src path="src"/>
9595
<src path="${src.generated}"/>
9696
</javac>
@@ -179,22 +179,22 @@
179179
</target>
180180

181181
<target name="test-prepare">
182-
<property name="haltOnFailureJunit" value="yes" />
183-
<property name="haltOnFailureJava" value="true" />
182+
<property name="haltOnFailureJunit" value="yes" />
183+
<property name="haltOnFailureJava" value="true" />
184184
</target>
185185

186186
<target name="test-build" depends="test-prepare">
187-
<antcall target="test-build-param">
188-
<param name="javac.source" value="${standard.javac.source}"/>
189-
<param name="javac.target" value="${standard.javac.target}"/>
190-
</antcall>
187+
<antcall target="test-build-param">
188+
<param name="javac.source" value="${standard.javac.source}"/>
189+
<param name="javac.target" value="${standard.javac.target}"/>
190+
</antcall>
191191
</target>
192192

193193
<target name="test-build-alt" depends="test-prepare">
194-
<antcall target="test-build-param">
195-
<param name="javac.source" value="${alt.javac.source}"/>
196-
<param name="javac.target" value="${alt.javac.target}"/>
197-
</antcall>
194+
<antcall target="test-build-param">
195+
<param name="javac.source" value="${alt.javac.source}"/>
196+
<param name="javac.target" value="${alt.javac.target}"/>
197+
</antcall>
198198
</target>
199199

200200
<!-- Used to rebuild the tests every time, ( dependency on clean-tests )
@@ -299,18 +299,18 @@
299299
</target>
300300

301301
<target name="test-suite-prepare">
302-
<property name="haltOnFailureJunit" value="no" />
303-
<property name="haltOnFailureJava" value="false" />
302+
<property name="haltOnFailureJunit" value="no" />
303+
<property name="haltOnFailureJava" value="false" />
304304
</target>
305305

306306
<target name="test-suite" depends="test-suite-prepare, test-suite-run" description="Run all test suites.">
307-
<fail message="Errors occured in tests">
308-
<condition>
309-
<not>
310-
<equals arg1="${test.failure}" arg2="" />
311-
</not>
312-
</condition>
313-
</fail>
307+
<fail message="Errors occured in tests">
308+
<condition>
309+
<not>
310+
<equals arg1="${test.failure}" arg2="" />
311+
</not>
312+
</condition>
313+
</fail>
314314
</target>
315315

316316
<target name="test-suite-run" depends="test-client, test-ssl, test-server, test-functional, test-main-silent"/>
@@ -418,35 +418,35 @@
418418
<param name="base" value="${test.javac.out}"/>
419419
</antcall>
420420
</target>
421-
422-
<target name="doJarWithTags">
423-
<jar destfile="${lib.out}/${jar.name}.jar"
424-
basedir="${base}"
425-
filesetmanifest="merge">
426-
<manifest>
427-
<section name="${jar.name}">
428-
<attribute name="Specification-Title" value="AMQP"/>
429-
<attribute name="Specification-Version" value="${spec.version}"/>
430-
<attribute name="Specification-Vendor" value="AMQP Working Group (www.amqp.org)"/>
431-
<attribute name="Implementation-Title" value="RabbitMQ"/>
432-
<attribute name="Implementation-Version" value="${impl.version}"/>
433-
<attribute name="Implementation-Vendor" value="Rabbit Technologies Ltd. (www.rabbitmq.com)"/>
434-
</section>
435-
</manifest>
436-
</jar>
437-
</target>
421+
422+
<target name="doJarWithTags">
423+
<jar destfile="${lib.out}/${jar.name}.jar"
424+
basedir="${base}"
425+
filesetmanifest="merge">
426+
<manifest>
427+
<section name="${jar.name}">
428+
<attribute name="Specification-Title" value="AMQP"/>
429+
<attribute name="Specification-Version" value="${spec.version}"/>
430+
<attribute name="Specification-Vendor" value="AMQP Working Group (www.amqp.org)"/>
431+
<attribute name="Implementation-Title" value="RabbitMQ"/>
432+
<attribute name="Implementation-Version" value="${impl.version}"/>
433+
<attribute name="Implementation-Vendor" value="Rabbit Technologies Ltd. (www.rabbitmq.com)"/>
434+
</section>
435+
</manifest>
436+
</jar>
437+
</target>
438438

439439
<target name="dist" depends="jar, test-jar">
440440
<mkdir dir="${dist.out}"/>
441441
<copy todir="${dist.out}">
442442
<!-- ant doesn't seem to provide any form of usable abstraction over sets of file names -->
443443
<!-- consequently we repeat ourselves here. see definition of javac.classpath, supra -->
444444
<fileset dir="lib">
445-
<include name="**/*.jar"/>
445+
<include name="**/*.jar"/>
446446
</fileset>
447447

448448
<fileset dir="${lib.out}">
449-
<include name="**/*.jar"/>
449+
<include name="**/*.jar"/>
450450
</fileset>
451451

452452
<fileset dir="scripts">

bundlorTestTemplate.mf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ Bundle-Name: ${bundle.name}
44
Bundle-Vendor: SpringSource
55
Bundle-Version: ${impl.version}
66
Import-Template:
7-
org.apache.commons.*;version="[1.4,2)",
7+
org.apache.commons.io.*;version="[1.4,2)",
8+
org.apache.commons.cli.*;version="[1.2,2)",
89
com.rabbitmq.*;version="${impl.version:[=.=.=,=.+1)}",
910
junit.*;version="[4,5)",
1011
javax.*;version=0

0 commit comments

Comments
 (0)