summaryrefslogtreecommitdiff
path: root/java/systests/src
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
commit2c418b019c8f3a9cc720c588e0268c00b86c8576 (patch)
treec750425a5e0f37ef16971a7f24dd9fbead528a36 /java/systests/src
parentc190f7dcc2c0d6cc84956fc8443f60a12d8645e1 (diff)
downloadqpid-python-2c418b019c8f3a9cc720c588e0268c00b86c8576.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/qpid@489330 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/systests/src')
-rw-r--r--java/systests/src/test/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBeanTest.java22
1 files changed, 7 insertions, 15 deletions
diff --git a/java/systests/src/test/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBeanTest.java b/java/systests/src/test/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBeanTest.java
index 0a41d4166b..356c887996 100644
--- a/java/systests/src/test/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBeanTest.java
+++ b/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());
}