Unit and integration tests for ActiveMQ CMS libraries are failing.

Solution In Progress - Updated -

Environment

  • Fuse Message Broker, CMS libraries

Issue

Running the unit and integration tests for the ActiveMQ CMS libraries pretty much all of the tests are failing.
Here is an extract of the test output:

N3cms14ConnectionTestE::testCreateSessionFromConnection. : assertionF
N3cms14ConnectionTestE::testGetErrorString. : assertionF
N3cms11SessionTestE::testCreateDestination. : assertionF
N3cms11SessionTestE::testCreateProducer. : assertionF
N3cms11SessionTestE::testCreateConsumer. : assertionF
...

Resolution

When running these tests you need to have an external broker running at the default address tcp://localhost:61616. Otherwise most of the test will fail.

An external broker is needed for both the unit and integration tests.

If you decide to use JBoss Fuse 6.x as the external broker, please keep in mind that this broker has authentication enabled by default due to this configuration in etc/activemq.xml:

 <plugins>
     <jaasAuthenticationPlugin configuration="karaf" />
 </plugins>

You will need to supply a valid username and password in the CMS tests (which may require changing multiple test classes) or to disable the authentication plugin in the broker configuration.

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.