summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Ritchie <ritchiem@apache.org>2006-09-26 07:16:45 +0000
committerMartin Ritchie <ritchiem@apache.org>2006-09-26 07:16:45 +0000
commit78ea0dff2fd4876e130ccc351700b4e95ce330a5 (patch)
tree94a7517a2a0e1828f588794486598f0a56465b0b
parent3a19f6360a810cdc165438a71e0eb87a5c476e2b (diff)
downloadqpid-python-78ea0dff2fd4876e130ccc351700b4e95ce330a5.tar.gz
Fixed class cast problem and ensured that the correct application registry was being retrieved in each of the tests. The getInstance() needs to know which instance is being used. In these tests (vm://:1) that instance 1.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@449934 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--java/client/test/src/org/apache/qpid/ack/DisconnectAndRedeliverTest.java21
1 files changed, 14 insertions, 7 deletions
diff --git a/java/client/test/src/org/apache/qpid/ack/DisconnectAndRedeliverTest.java b/java/client/test/src/org/apache/qpid/ack/DisconnectAndRedeliverTest.java
index 1dccf2f336..be8cc3c8e4 100644
--- a/java/client/test/src/org/apache/qpid/ack/DisconnectAndRedeliverTest.java
+++ b/java/client/test/src/org/apache/qpid/ack/DisconnectAndRedeliverTest.java
@@ -18,18 +18,18 @@
package org.apache.qpid.ack;
import junit.framework.JUnit4TestAdapter;
+import org.apache.log4j.Logger;
+import org.apache.log4j.xml.DOMConfigurator;
import org.apache.qpid.client.AMQConnection;
import org.apache.qpid.client.AMQQueue;
import org.apache.qpid.client.transport.TransportConnection;
import org.apache.qpid.server.registry.ApplicationRegistry;
+import org.apache.qpid.server.util.TestApplicationRegistry;
import org.apache.qpid.server.store.TestableMemoryMessageStore;
-import org.apache.qpid.vmbroker.AMQVMBrokerCreationException;
-import org.apache.log4j.Logger;
-import org.apache.log4j.xml.DOMConfigurator;
-import org.junit.Assert;
-import org.junit.Test;
import org.junit.After;
+import org.junit.Assert;
import org.junit.Before;
+import org.junit.Test;
import javax.jms.*;
@@ -49,6 +49,13 @@ public class DisconnectAndRedeliverTest
TransportConnection.killVMBroker(1);
}
+ @Before
+ public void configureApplicationRegistry() throws Exception
+ {
+ ApplicationRegistry.initialise(new TestApplicationRegistry(), 1);
+ }
+
+
/**
* This tests that when there are unacknowledged messages on a channel they are requeued for delivery when
* the channel is closed.
@@ -60,7 +67,7 @@ public class DisconnectAndRedeliverTest
{
Connection con = new AMQConnection("vm://:1", "guest", "guest", "consumer1", "/test");
- TestableMemoryMessageStore store = (TestableMemoryMessageStore) ApplicationRegistry.getInstance().getMessageStore();
+ TestableMemoryMessageStore store = (TestableMemoryMessageStore) ApplicationRegistry.getInstance(1).getMessageStore();
Session consumerSession = con.createSession(false, Session.CLIENT_ACKNOWLEDGE);
AMQQueue queue = new AMQQueue("someQ", "someQ", false, false);
@@ -147,7 +154,7 @@ public class DisconnectAndRedeliverTest
{
Connection con = new AMQConnection("vm://:1", "guest", "guest", "consumer1", "/test");
- TestableMemoryMessageStore store = (TestableMemoryMessageStore) ApplicationRegistry.getInstance().getMessageStore();
+ TestableMemoryMessageStore store = (TestableMemoryMessageStore) ApplicationRegistry.getInstance(1).getMessageStore();
Session consumerSession = con.createSession(false, Session.CLIENT_ACKNOWLEDGE);
Queue queue = new AMQQueue("someQ", "someQ", false, true);
MessageConsumer consumer = consumerSession.createConsumer(queue);