summaryrefslogtreecommitdiff
path: root/qpid/java/client
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
commit39112baa4d7fb28c1833bcc663f532841e120080 (patch)
tree4af0337ec72a1e214775657d2a523ae03f8432a0 /qpid/java/client
parent0b9afe21f8632ab0621da6f6dfd8563a06e4e203 (diff)
downloadqpid-python-39112baa4d7fb28c1833bcc663f532841e120080.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@449934 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java/client')
-rw-r--r--qpid/java/client/test/src/org/apache/qpid/ack/DisconnectAndRedeliverTest.java21
1 files changed, 14 insertions, 7 deletions
diff --git a/qpid/java/client/test/src/org/apache/qpid/ack/DisconnectAndRedeliverTest.java b/qpid/java/client/test/src/org/apache/qpid/ack/DisconnectAndRedeliverTest.java
index 1dccf2f336..be8cc3c8e4 100644
--- a/qpid/java/client/test/src/org/apache/qpid/ack/DisconnectAndRedeliverTest.java
+++ b/qpid/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);