diff options
| author | Martin Ritchie <ritchiem@apache.org> | 2007-04-27 12:48:51 +0000 |
|---|---|---|
| committer | Martin Ritchie <ritchiem@apache.org> | 2007-04-27 12:48:51 +0000 |
| commit | 1728d25e47815a3d12320d77f03b98909f55b715 (patch) | |
| tree | 49279d223c510b02398e5b4e24f19ff63054bb63 /java/client/src/test | |
| parent | 90b39f5665f0159767d94c4fc3b466586ddec147 (diff) | |
| download | qpid-python-1728d25e47815a3d12320d77f03b98909f55b715.tar.gz | |
Merged revisions 533075-533079 via svnmerge from
https://svn.apache.org/repos/asf/incubator/qpid/branches/M2
........
r533075 | ritchiem | 2007-04-27 13:27:19 +0100 (Fri, 27 Apr 2007) | 2 lines
QPID-473 Base64MD5PrincipalDatabase doesn't check password changes were applied to disk before storing in memory
Reversed the effects of the requested change if the changes cannot be persisted to disk
........
r533077 | ritchiem | 2007-04-27 13:29:52 +0100 (Fri, 27 Apr 2007) | 3 lines
Bin Updates: Qpid-Run removed new bash 3.x feature += replaced with option="${value1} ${value2}" constructs to support older bash 2.x
renamed passwd qpid-passwd and fixed classpath loading errors.
Moved bdbbackup script to live with the bdb module.
........
r533078 | ritchiem | 2007-04-27 13:30:07 +0100 (Fri, 27 Apr 2007) | 1 line
Updated PrincipalDatabase implementations to return empty strings rather than null. As this causes NPE on MC.
........
r533079 | ritchiem | 2007-04-27 13:31:03 +0100 (Fri, 27 Apr 2007) | 1 line
Updated MLT to have variables that define the BROKER and VHOST used and White space
........
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@533083 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/client/src/test')
| -rw-r--r-- | java/client/src/test/java/org/apache/qpid/client/MessageListenerTest.java | 53 |
1 files changed, 30 insertions, 23 deletions
diff --git a/java/client/src/test/java/org/apache/qpid/client/MessageListenerTest.java b/java/client/src/test/java/org/apache/qpid/client/MessageListenerTest.java index 7b5957ac8c..b15742f3aa 100644 --- a/java/client/src/test/java/org/apache/qpid/client/MessageListenerTest.java +++ b/java/client/src/test/java/org/apache/qpid/client/MessageListenerTest.java @@ -63,17 +63,21 @@ public class MessageListenerTest extends TestCase implements MessageListener private MessageConsumer _consumer; private Connection _clientConnection; private CountDownLatch _awaitMessages = new CountDownLatch(MSG_COUNT); + private static final String BROKER = "vm://:1"; + private static final String VHOST = "test"; protected void setUp() throws Exception { super.setUp(); - TransportConnection.createVMBroker(1); - + if (BROKER.contains("vm://")) + { + TransportConnection.createVMBroker(1); + } InitialContextFactory factory = new PropertiesFileInitialContextFactory(); Hashtable<String, String> env = new Hashtable<String, String>(); - env.put("connectionfactory.connection", "amqp://guest:guest@MLT_ID/test?brokerlist='vm://:1'"); + env.put("connectionfactory.connection", "amqp://guest:guest@MLT_ID/" + VHOST + "?brokerlist='" + BROKER + "'"); env.put("queue.queue", "MessageListenerTest"); _context = factory.getInitialContext(env); @@ -113,7 +117,10 @@ public class MessageListenerTest extends TestCase implements MessageListener _clientConnection.close(); super.tearDown(); - TransportConnection.killAllVMBrokers(); + if (BROKER.contains("vm://")) + { + TransportConnection.killAllVMBrokers(); + } } @@ -145,34 +152,34 @@ public class MessageListenerTest extends TestCase implements MessageListener } public void testRecieveTheUseMessageListener() throws Exception - { + { - _logger.error("Test disabled as initial receive is not called first"); - // Perform initial receive to start connection + _logger.error("Test disabled as initial receive is not called first"); + // Perform initial receive to start connection // assertTrue(_consumer.receive(2000) != null); // receivedCount++; - // Sleep to ensure remaining 4 msgs end up on _synchronousQueue + // Sleep to ensure remaining 4 msgs end up on _synchronousQueue // Thread.sleep(1000); - // Set the message listener and wait for the messages to come in. - _consumer.setMessageListener(this); + // Set the message listener and wait for the messages to come in. + _consumer.setMessageListener(this); - _logger.info("Waiting 3 seconds for messages"); + _logger.info("Waiting 3 seconds for messages"); + + try + { + _awaitMessages.await(3000, TimeUnit.MILLISECONDS); + } + catch (InterruptedException e) + { + //do nothing + } + //Should have recieved all async messages + assertEquals(MSG_COUNT, receivedCount); - try - { - _awaitMessages.await(3000, TimeUnit.MILLISECONDS); - } - catch (InterruptedException e) - { - //do nothing - } - //Should have recieved all async messages - assertEquals(MSG_COUNT, receivedCount); + } - } - public void onMessage(Message message) { |
