summaryrefslogtreecommitdiff
path: root/qpid/java/systests
diff options
context:
space:
mode:
authorBhupendra Bhusman Bhardwaj <bhupendrab@apache.org>2006-12-21 11:32:58 +0000
committerBhupendra Bhusman Bhardwaj <bhupendrab@apache.org>2006-12-21 11:32:58 +0000
commit63c42a711f8882b79b979507ed152cfba76bdeb1 (patch)
tree3dd5eeeb1d2ae67ef55ff722b9082c13c68465d5 /qpid/java/systests
parent9dac34ffd73cdc1428eeb382d4d69c8fc9bc0255 (diff)
downloadqpid-python-63c42a711f8882b79b979507ed152cfba76bdeb1.tar.gz
QPID-188
Unit test for AMQProtocolSession mbean updated and closeChannel() method removed from mbean because it didn't seem to be a required feature for management console. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@489330 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java/systests')
-rw-r--r--qpid/java/systests/src/test/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBeanTest.java22
1 files changed, 7 insertions, 15 deletions
diff --git a/qpid/java/systests/src/test/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBeanTest.java b/qpid/java/systests/src/test/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBeanTest.java
index 0a41d4166b..356c887996 100644
--- a/qpid/java/systests/src/test/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBeanTest.java
+++ b/qpid/java/systests/src/test/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBeanTest.java
@@ -28,11 +28,9 @@ import org.apache.qpid.server.queue.DefaultQueueRegistry;
import org.apache.qpid.server.queue.QueueRegistry;
import org.apache.qpid.server.store.MessageStore;
import org.apache.qpid.server.store.SkeletonMessageStore;
+import org.apache.qpid.AMQException;
-import javax.management.openmbean.CompositeData;
-import javax.management.openmbean.TabularData;
import javax.management.JMException;
-import java.util.ArrayList;
/**
* Test class to test MBean operations for AMQMinaProtocolSession.
@@ -56,20 +54,11 @@ public class AMQProtocolSessionMBeanTest extends TestCase
channelCount = _mbean.channels().size();
assertTrue(channelCount == 2);
- // check the channel closing
- _mbean.closeChannel(1);
- TabularData channels = _mbean.channels();
- ArrayList<CompositeData> list = new ArrayList<CompositeData>(channels.values());
- channelCount = list.size();
- assertTrue(channelCount == 1);
- CompositeData channelData = list.get(0);
- assertEquals(channelData.get("Channel Id"), new Integer(2));
-
// general properties test
_mbean.setMaximumNumberOfChannels(1000L);
assertTrue(_mbean.getMaximumNumberOfChannels() == 1000L);
- // check if the rollback and commit APIs
+ // check APIs
AMQChannel channel3 = new AMQChannel(3, _messageStore, null);
channel3.setTransactional(true);
_protocolSession.addChannel(channel3);
@@ -94,10 +83,13 @@ public class AMQProtocolSessionMBeanTest extends TestCase
_mbean.closeConnection();
try
{
- _mbean.closeChannel(5);
+ 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));
fail();
}
- catch(JMException ex)
+ catch(AMQException ex)
{
System.out.println("expected exception is thrown :" + ex.getMessage());
}