RabbitMQ includes a suite of functional tests, as well as unit tests for each of its components. It’s not immediately obvious how to run the functional test suite, but fortunately, it’s straightforward.
You will need:
- a Java JDK
- and I guess a Unix machine of some description; I don’t imagine running these tests on Windows will work well
Running the complete test suite takes about six minutes on my eight-core, 32GB i7 Linux box. Most of this time is spent sleeping, to ensure particular interleavings required by particular test cases.
Clone the repositories
$ git clone git://github.com/rabbitmq/rabbitmq-public-umbrella $ cd rabbitmq-public-umbrella $ git clone git://github.com/rabbitmq/rabbitmq-codegen $ git clone git://github.com/rabbitmq/rabbitmq-java-client $ git clone git://github.com/rabbitmq/rabbitmq-server $ git clone git://github.com/rabbitmq/rabbitmq-test
Build and start the server in one window
$ cd rabbitmq-server $ make run
Run the tests in another window
The tests are written in Java and come along with the RabbitMQ Java client source code.
Be sure to wait until the server has fully initialised itself before
$ cd rabbitmq-java-client $ ant test-suite
Things should tick along nicely for a few minutes at this point. From time to time, you’ll see the server print a new banner to its console: the tests restart the server occasionally as part of their normal operation.
Check the results
The tests leave their output in
files. Each test suite (
HATests) produces both a plain-text and an XML file
summarising the results of the run.