diff options
Diffstat (limited to 'java')
2 files changed, 8 insertions, 2 deletions
diff --git a/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBean.java b/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBean.java index 08045e1c41..df494915a3 100644 --- a/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBean.java +++ b/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBean.java @@ -178,7 +178,7 @@ public class AMQProtocolSessionMBean extends AMQManagedObject implements Managed for (AMQChannel channel : list) { Object[] itemValues = {channel.getChannelId(), channel.isTransactional(), - (channel.getDefaultQueue() != null) ? channel.getDefaultQueue().getName() : null, + (channel.getDefaultQueue() != null) ? channel.getDefaultQueue().getName().asString() : null, channel.getUnacknowledgedMessageMap().size()}; CompositeData channelData = new CompositeDataSupport(_channelType, _channelAtttibuteNames, itemValues); 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 c2ac099855..594330b945 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 @@ -26,9 +26,11 @@ import org.apache.qpid.server.exchange.DefaultExchangeRegistry; import org.apache.qpid.server.exchange.ExchangeRegistry; import org.apache.qpid.server.queue.DefaultQueueRegistry; import org.apache.qpid.server.queue.QueueRegistry; +import org.apache.qpid.server.queue.AMQQueue; import org.apache.qpid.server.store.MessageStore; import org.apache.qpid.server.store.SkeletonMessageStore; import org.apache.qpid.AMQException; +import org.apache.qpid.framing.AMQShortString; import javax.management.JMException; @@ -50,7 +52,11 @@ public class AMQProtocolSessionMBeanTest extends TestCase // check the channel count is correct int channelCount = _mbean.channels().size(); assertTrue(channelCount == 1); - _protocolSession.addChannel(new AMQChannel(2, _messageStore, null)); + AMQQueue queue = new org.apache.qpid.server.queue.AMQQueue(new AMQShortString("testQueue_" + System.currentTimeMillis()), + false, new AMQShortString("test"), true, _queueRegistry); + AMQChannel channel = new AMQChannel(2, _messageStore, null); + channel.setDefaultQueue(queue); + _protocolSession.addChannel(channel); channelCount = _mbean.channels().size(); assertTrue(channelCount == 2); |