diff options
| author | Robert Godfrey <rgodfrey@apache.org> | 2007-02-15 23:23:48 +0000 |
|---|---|---|
| committer | Robert Godfrey <rgodfrey@apache.org> | 2007-02-15 23:23:48 +0000 |
| commit | 7a48e7adf5d8db51c58878888f8a7ca62da16cf5 (patch) | |
| tree | 34d8c5587f2a7f9a4d050ed1db28ddfe1fdb75cd /java/systests/src | |
| parent | 9dbfac1edb6fd5b4d65c8e8f537eecb769c15f0a (diff) | |
| download | qpid-python-7a48e7adf5d8db51c58878888f8a7ca62da16cf5.tar.gz | |
QPID-366 : Reference counting not being decremented correctly and other persistence issues
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@508235 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/systests/src')
4 files changed, 12 insertions, 9 deletions
diff --git a/java/systests/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBeanTest.java b/java/systests/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBeanTest.java index dac0f06744..da1455294a 100644 --- a/java/systests/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBeanTest.java +++ b/java/systests/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBeanTest.java @@ -58,7 +58,7 @@ public class AMQProtocolSessionMBeanTest extends TestCase assertTrue(channelCount == 1); AMQQueue queue = new org.apache.qpid.server.queue.AMQQueue(new AMQShortString("testQueue_" + System.currentTimeMillis()), false, new AMQShortString("test"), true, _virtualHost); - AMQChannel channel = new AMQChannel(2, _messageStore, null); + AMQChannel channel = new AMQChannel(_protocolSession,2, _messageStore, null); channel.setDefaultQueue(queue); _protocolSession.addChannel(channel); channelCount = _mbean.channels().size(); @@ -69,7 +69,7 @@ public class AMQProtocolSessionMBeanTest extends TestCase assertTrue(_mbean.getMaximumNumberOfChannels() == 1000L); // check APIs - AMQChannel channel3 = new AMQChannel(3, _messageStore, null); + AMQChannel channel3 = new AMQChannel(_protocolSession,3, _messageStore, null); channel3.setLocalTransactional(); _protocolSession.addChannel(channel3); _mbean.rollbackTransactions(2); @@ -89,14 +89,14 @@ public class AMQProtocolSessionMBeanTest extends TestCase } // check if closing of session works - _protocolSession.addChannel(new AMQChannel(5, _messageStore, null)); + _protocolSession.addChannel(new AMQChannel(_protocolSession,5, _messageStore, null)); _mbean.closeConnection(); try { channelCount = _mbean.channels().size(); assertTrue(channelCount == 0); // session is now closed so adding another channel should throw an exception - _protocolSession.addChannel(new AMQChannel(6, _messageStore, null)); + _protocolSession.addChannel(new AMQChannel(_protocolSession,6, _messageStore, null)); fail(); } catch(AMQException ex) @@ -109,13 +109,14 @@ public class AMQProtocolSessionMBeanTest extends TestCase protected void setUp() throws Exception { super.setUp(); - _channel = new AMQChannel(1, _messageStore, null); + IApplicationRegistry appRegistry = ApplicationRegistry.getInstance(); _virtualHost = appRegistry.getVirtualHostRegistry().getVirtualHost("test"); _queueRegistry = _virtualHost.getQueueRegistry(); _exchangeRegistry = _virtualHost.getExchangeRegistry(); _mockIOSession = new MockIoSession(); _protocolSession = new AMQMinaProtocolSession(_mockIOSession, appRegistry.getVirtualHostRegistry(), new AMQCodecFactory(true)); + _channel = new AMQChannel(_protocolSession,1, _messageStore, null); _protocolSession.addChannel(_channel); _mbean = (AMQProtocolSessionMBean)_protocolSession.getManagedObject(); } diff --git a/java/systests/src/main/java/org/apache/qpid/server/queue/AMQQueueMBeanTest.java b/java/systests/src/main/java/org/apache/qpid/server/queue/AMQQueueMBeanTest.java index 84dde9dd6f..c35d38e4ab 100644 --- a/java/systests/src/main/java/org/apache/qpid/server/queue/AMQQueueMBeanTest.java +++ b/java/systests/src/main/java/org/apache/qpid/server/queue/AMQQueueMBeanTest.java @@ -78,8 +78,9 @@ public class AMQQueueMBeanTest extends TestCase assertFalse(mgr.hasActiveSubscribers()); assertTrue(_queueMBean.getActiveConsumerCount() == 0); - _channel = new AMQChannel(1, _messageStore, null); + _protocolSession = new MockProtocolSession(_messageStore); + _channel = new AMQChannel(_protocolSession, 1, _messageStore, null); _protocolSession.addChannel(_channel); _queue.registerProtocolSession(_protocolSession, 1, new AMQShortString("test"), false, null,false,false); diff --git a/java/systests/src/main/java/org/apache/qpid/server/queue/AckTest.java b/java/systests/src/main/java/org/apache/qpid/server/queue/AckTest.java index ccc7752fd3..93050af2b7 100644 --- a/java/systests/src/main/java/org/apache/qpid/server/queue/AckTest.java +++ b/java/systests/src/main/java/org/apache/qpid/server/queue/AckTest.java @@ -75,8 +75,9 @@ public class AckTest extends TestCase { super.setUp(); _messageStore = new TestableMemoryMessageStore(); - _channel = new AMQChannel(5, _messageStore, null/*dont need exchange registry*/); _protocolSession = new MockProtocolSession(_messageStore); + _channel = new AMQChannel(_protocolSession,5, _messageStore, null/*dont need exchange registry*/); + _protocolSession.addChannel(_channel); _subscriptionManager = new SubscriptionSet(); _queue = new AMQQueue(new AMQShortString("myQ"), false, new AMQShortString("guest"), true, ApplicationRegistry.getInstance().getVirtualHostRegistry().getVirtualHost("test"), _subscriptionManager); diff --git a/java/systests/src/main/java/org/apache/qpid/server/store/SkeletonMessageStore.java b/java/systests/src/main/java/org/apache/qpid/server/store/SkeletonMessageStore.java index 42dd1a4b74..89889ca017 100644 --- a/java/systests/src/main/java/org/apache/qpid/server/store/SkeletonMessageStore.java +++ b/java/systests/src/main/java/org/apache/qpid/server/store/SkeletonMessageStore.java @@ -97,12 +97,12 @@ public class SkeletonMessageStore implements MessageStore } - public MessageMetaData getMessageMetaData(Long messageId) throws AMQException + public MessageMetaData getMessageMetaData(StoreContext s,Long messageId) throws AMQException { return null; } - public ContentBody getContentBodyChunk(Long messageId, int index) throws AMQException + public ContentBody getContentBodyChunk(StoreContext s,Long messageId, int index) throws AMQException { return null; } |
