[jboss-cvs] JBoss Messaging SVN: r5560 - in trunk/tests/src/org/jboss/messaging/tests/integration: jms/cluster/management and 2 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Mon Dec 22 04:34:26 EST 2008
Author: jmesnil
Date: 2008-12-22 04:34:25 -0500 (Mon, 22 Dec 2008)
New Revision: 5560
Added:
trunk/tests/src/org/jboss/messaging/tests/integration/management/ManagementControlHelper.java
Modified:
trunk/tests/src/org/jboss/messaging/tests/integration/cluster/management/ReplicationAwareAddressControlWrapperTest.java
trunk/tests/src/org/jboss/messaging/tests/integration/cluster/management/ReplicationAwareMessagingServerControlWrapperTest.java
trunk/tests/src/org/jboss/messaging/tests/integration/cluster/management/ReplicationAwareQueueControlWrapperTest.java
trunk/tests/src/org/jboss/messaging/tests/integration/jms/cluster/management/ReplicationAwareJMSQueueControlWrapperTest.java
trunk/tests/src/org/jboss/messaging/tests/integration/jms/management/JMSQueueControlTest.java
trunk/tests/src/org/jboss/messaging/tests/integration/jms/management/JMSServerControlTest.java
trunk/tests/src/org/jboss/messaging/tests/integration/jms/management/JMSUtil.java
trunk/tests/src/org/jboss/messaging/tests/integration/jms/management/TopicControlTest.java
trunk/tests/src/org/jboss/messaging/tests/integration/management/AcceptorControlTest.java
trunk/tests/src/org/jboss/messaging/tests/integration/management/BroadcastGroupControlTest.java
trunk/tests/src/org/jboss/messaging/tests/integration/management/DiscoveryGroupControlTest.java
trunk/tests/src/org/jboss/messaging/tests/integration/management/MessageFlowControlTest.java
trunk/tests/src/org/jboss/messaging/tests/integration/management/MessagingServerControlTest.java
trunk/tests/src/org/jboss/messaging/tests/integration/management/QueueControlTest.java
Log:
refactoring of management tests
* grouped all methods to create MBean proxies in ManagementControlHelper
Modified: trunk/tests/src/org/jboss/messaging/tests/integration/cluster/management/ReplicationAwareAddressControlWrapperTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/cluster/management/ReplicationAwareAddressControlWrapperTest.java 2008-12-22 08:58:16 UTC (rev 5559)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/cluster/management/ReplicationAwareAddressControlWrapperTest.java 2008-12-22 09:34:25 UTC (rev 5560)
@@ -22,20 +22,17 @@
package org.jboss.messaging.tests.integration.cluster.management;
+import static org.jboss.messaging.tests.integration.management.ManagementControlHelper.createAddressControl;
import static org.jboss.messaging.tests.util.RandomUtil.randomBoolean;
import static org.jboss.messaging.tests.util.RandomUtil.randomSimpleString;
import static org.jboss.messaging.tests.util.RandomUtil.randomString;
-import javax.management.MBeanServer;
-import javax.management.MBeanServerInvocationHandler;
-
import org.jboss.messaging.core.client.ClientSession;
import org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl;
import org.jboss.messaging.core.client.impl.ClientSessionFactoryInternal;
import org.jboss.messaging.core.config.TransportConfiguration;
import org.jboss.messaging.core.management.AddressControlMBean;
import org.jboss.messaging.core.management.RoleInfo;
-import org.jboss.messaging.core.management.impl.ManagementServiceImpl;
import org.jboss.messaging.core.remoting.impl.invm.InVMConnectorFactory;
import org.jboss.messaging.util.SimpleString;
@@ -56,15 +53,6 @@
// Static --------------------------------------------------------
- private static AddressControlMBean createAddressControl(SimpleString address, MBeanServer mbeanServer) throws Exception
- {
- AddressControlMBean control = (AddressControlMBean)MBeanServerInvocationHandler.newProxyInstance(mbeanServer,
- ManagementServiceImpl.getAddressObjectName(address),
- AddressControlMBean.class,
- false);
- return control;
- }
-
// Constructors --------------------------------------------------
// Public --------------------------------------------------------
Modified: trunk/tests/src/org/jboss/messaging/tests/integration/cluster/management/ReplicationAwareMessagingServerControlWrapperTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/cluster/management/ReplicationAwareMessagingServerControlWrapperTest.java 2008-12-22 08:58:16 UTC (rev 5559)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/cluster/management/ReplicationAwareMessagingServerControlWrapperTest.java 2008-12-22 09:34:25 UTC (rev 5560)
@@ -22,12 +22,12 @@
package org.jboss.messaging.tests.integration.cluster.management;
+import static org.jboss.messaging.tests.integration.management.ManagementControlHelper.createMessagingServerControl;
+import static org.jboss.messaging.tests.integration.management.ManagementControlHelper.createQueueControl;
import static org.jboss.messaging.tests.util.RandomUtil.randomLong;
import static org.jboss.messaging.tests.util.RandomUtil.randomPositiveLong;
import static org.jboss.messaging.tests.util.RandomUtil.randomSimpleString;
-import javax.management.MBeanServer;
-import javax.management.MBeanServerInvocationHandler;
import javax.management.ObjectName;
import javax.management.openmbean.CompositeData;
@@ -57,25 +57,6 @@
// Static --------------------------------------------------------
- private static MessagingServerControlMBean createMessagingServerControl(MBeanServer mbeanServer) throws Exception
- {
- MessagingServerControlMBean serverControl = (MessagingServerControlMBean)MBeanServerInvocationHandler.newProxyInstance(mbeanServer,
- ManagementServiceImpl.getMessagingServerObjectName(),
- MessagingServerControlMBean.class,
- false);
- return serverControl;
- }
-
- private static QueueControlMBean createQueueControl(SimpleString address, SimpleString name, MBeanServer mbeanServer) throws Exception
- {
- QueueControlMBean queueControl = (QueueControlMBean)MBeanServerInvocationHandler.newProxyInstance(mbeanServer,
- ManagementServiceImpl.getQueueObjectName(address,
- name),
- QueueControlMBean.class,
- false);
- return queueControl;
- }
-
private SimpleString address;
private ClientSession session;
Modified: trunk/tests/src/org/jboss/messaging/tests/integration/cluster/management/ReplicationAwareQueueControlWrapperTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/cluster/management/ReplicationAwareQueueControlWrapperTest.java 2008-12-22 08:58:16 UTC (rev 5559)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/cluster/management/ReplicationAwareQueueControlWrapperTest.java 2008-12-22 09:34:25 UTC (rev 5560)
@@ -25,8 +25,6 @@
import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_ACK_BATCH_SIZE;
import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_AUTO_GROUP;
import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_BLOCK_ON_ACKNOWLEDGE;
-import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_BLOCK_ON_NON_PERSISTENT_SEND;
-import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_BLOCK_ON_PERSISTENT_SEND;
import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_CALL_TIMEOUT;
import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_CONNECTION_LOAD_BALANCING_POLICY_CLASS_NAME;
import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_CONNECTION_TTL;
@@ -42,12 +40,11 @@
import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_RETRY_INTERVAL;
import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_RETRY_INTERVAL_MULTIPLIER;
import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_SEND_WINDOW_SIZE;
+import static org.jboss.messaging.tests.integration.management.ManagementControlHelper.createQueueControl;
import static org.jboss.messaging.tests.util.RandomUtil.randomLong;
import static org.jboss.messaging.tests.util.RandomUtil.randomSimpleString;
import static org.jboss.messaging.tests.util.RandomUtil.randomString;
-import javax.management.MBeanServer;
-import javax.management.MBeanServerInvocationHandler;
import javax.management.openmbean.TabularData;
import org.jboss.messaging.core.client.ClientMessage;
@@ -58,7 +55,6 @@
import org.jboss.messaging.core.config.TransportConfiguration;
import org.jboss.messaging.core.management.MessageInfo;
import org.jboss.messaging.core.management.QueueControlMBean;
-import org.jboss.messaging.core.management.impl.ManagementServiceImpl;
import org.jboss.messaging.core.remoting.impl.invm.InVMConnectorFactory;
import org.jboss.messaging.tests.util.RandomUtil;
import org.jboss.messaging.util.SimpleString;
@@ -80,16 +76,6 @@
// Static --------------------------------------------------------
- private static QueueControlMBean createQueueControl(SimpleString address, SimpleString name, MBeanServer mbeanServer) throws Exception
- {
- QueueControlMBean queueControl = (QueueControlMBean)MBeanServerInvocationHandler.newProxyInstance(mbeanServer,
- ManagementServiceImpl.getQueueObjectName(address,
- name),
- QueueControlMBean.class,
- false);
- return queueControl;
- }
-
// Constructors --------------------------------------------------
// Public --------------------------------------------------------
Modified: trunk/tests/src/org/jboss/messaging/tests/integration/jms/cluster/management/ReplicationAwareJMSQueueControlWrapperTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/jms/cluster/management/ReplicationAwareJMSQueueControlWrapperTest.java 2008-12-22 08:58:16 UTC (rev 5559)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/jms/cluster/management/ReplicationAwareJMSQueueControlWrapperTest.java 2008-12-22 09:34:25 UTC (rev 5560)
@@ -22,6 +22,7 @@
package org.jboss.messaging.tests.integration.jms.cluster.management;
+import static org.jboss.messaging.tests.integration.management.ManagementControlHelper.createJMSQueueControl;
import static org.jboss.messaging.tests.util.RandomUtil.randomLong;
import static org.jboss.messaging.tests.util.RandomUtil.randomString;
@@ -30,14 +31,11 @@
import javax.jms.MessageProducer;
import javax.jms.Session;
import javax.jms.TextMessage;
-import javax.management.MBeanServer;
-import javax.management.MBeanServerInvocationHandler;
import org.jboss.messaging.core.remoting.impl.invm.InVMConnectorFactory;
import org.jboss.messaging.jms.JBossQueue;
import org.jboss.messaging.jms.server.impl.JMSServerManagerImpl;
import org.jboss.messaging.jms.server.management.JMSQueueControlMBean;
-import org.jboss.messaging.jms.server.management.impl.JMSManagementServiceImpl;
import org.jboss.messaging.tests.integration.cluster.management.ReplicationAwareTestBase;
import org.jboss.messaging.tests.integration.jms.management.JMSUtil;
import org.jboss.messaging.tests.integration.jms.management.NullInitialContext;
@@ -74,15 +72,6 @@
// Static --------------------------------------------------------
- private static JMSQueueControlMBean createQueueControl(String name, MBeanServer mbeanServer) throws Exception
- {
- JMSQueueControlMBean queueControl = (JMSQueueControlMBean)MBeanServerInvocationHandler.newProxyInstance(mbeanServer,
- JMSManagementServiceImpl.getJMSQueueObjectName(name),
- JMSQueueControlMBean.class,
- false);
- return queueControl;
- }
-
// Public --------------------------------------------------------
public void testChangeMessagePriority() throws Exception
@@ -342,10 +331,10 @@
Connection connection = JMSUtil.createConnection(InVMConnectorFactory.class.getName());
session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
- liveQueueControl = createQueueControl(queue.getQueueName(), liveMBeanServer);
- backupQueueControl = createQueueControl(queue.getQueueName(), backupMBeanServer);
- liveOtherQueueControl = createQueueControl(otherQueue.getQueueName(), liveMBeanServer);
- backupOtherQueueControl = createQueueControl(otherQueue.getQueueName(), backupMBeanServer);
+ liveQueueControl = createJMSQueueControl(queue.getQueueName(), liveMBeanServer);
+ backupQueueControl = createJMSQueueControl(queue.getQueueName(), backupMBeanServer);
+ liveOtherQueueControl = createJMSQueueControl(otherQueue.getQueueName(), liveMBeanServer);
+ backupOtherQueueControl = createJMSQueueControl(otherQueue.getQueueName(), backupMBeanServer);
}
@Override
Modified: trunk/tests/src/org/jboss/messaging/tests/integration/jms/management/JMSQueueControlTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/jms/management/JMSQueueControlTest.java 2008-12-22 08:58:16 UTC (rev 5559)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/jms/management/JMSQueueControlTest.java 2008-12-22 09:34:25 UTC (rev 5560)
@@ -41,6 +41,7 @@
import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_RETRY_INTERVAL;
import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_RETRY_INTERVAL_MULTIPLIER;
import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_SEND_WINDOW_SIZE;
+import static org.jboss.messaging.tests.integration.management.ManagementControlHelper.createJMSQueueControl;
import static org.jboss.messaging.tests.util.RandomUtil.randomLong;
import static org.jboss.messaging.tests.util.RandomUtil.randomString;
@@ -52,7 +53,6 @@
import javax.jms.Session;
import javax.management.MBeanServer;
import javax.management.MBeanServerFactory;
-import javax.management.MBeanServerInvocationHandler;
import javax.management.openmbean.CompositeData;
import javax.management.openmbean.TabularData;
@@ -69,7 +69,6 @@
import org.jboss.messaging.jms.client.JBossConnectionFactory;
import org.jboss.messaging.jms.server.impl.JMSServerManagerImpl;
import org.jboss.messaging.jms.server.management.JMSQueueControlMBean;
-import org.jboss.messaging.jms.server.management.impl.JMSManagementServiceImpl;
/**
* A QueueControlTest
@@ -96,22 +95,13 @@
// Static --------------------------------------------------------
- private static JMSQueueControlMBean createQueueControl(Queue queue, MBeanServer mbeanServer) throws Exception
- {
- JMSQueueControlMBean queueControl = (JMSQueueControlMBean)MBeanServerInvocationHandler.newProxyInstance(mbeanServer,
- JMSManagementServiceImpl.getJMSQueueObjectName(queue.getQueueName()),
- JMSQueueControlMBean.class,
- false);
- return queueControl;
- }
-
// Constructors --------------------------------------------------
// Public --------------------------------------------------------
public void testGetXXXCount() throws Exception
{
- JMSQueueControlMBean queueControl = createQueueControl(queue, mbeanServer);
+ JMSQueueControlMBean queueControl = createJMSQueueControl(queue, mbeanServer);
assertEquals(0, queueControl.getMessageCount());
assertEquals(0, queueControl.getConsumerCount());
@@ -138,7 +128,8 @@
public void testRemoveMessage() throws Exception
{
- JMSQueueControlMBean queueControl = createQueueControl(queue, mbeanServer);
+ JMSQueueControlMBean queueControl = createJMSQueueControl(queue, mbeanServer);
+
assertEquals(0, queueControl.getMessageCount());
JMSUtil.sendMessages(queue, 2);
@@ -159,7 +150,8 @@
public void testRemoveAllMessages() throws Exception
{
- JMSQueueControlMBean queueControl = createQueueControl(queue, mbeanServer);
+ JMSQueueControlMBean queueControl = createJMSQueueControl(queue, mbeanServer);
+
assertEquals(0, queueControl.getMessageCount());
JMSUtil.sendMessages(queue, 2);
@@ -176,10 +168,11 @@
public void testRemoveMatchingMessages() throws Exception
{
- JMSQueueControlMBean queueControl = createQueueControl(queue, mbeanServer);
+ JMSQueueControlMBean queueControl = createJMSQueueControl(queue, mbeanServer);
+
assertEquals(0, queueControl.getMessageCount());
- JBossConnectionFactory cf = new JBossConnectionFactory(new TransportConfiguration("org.jboss.messaging.core.remoting.impl.invm.InVMConnectorFactory"),
+ JBossConnectionFactory cf = new JBossConnectionFactory(new TransportConfiguration(InVMConnectorFactory.class.getName()),
null,
DEFAULT_CONNECTION_LOAD_BALANCING_POLICY_CLASS_NAME,
DEFAULT_PING_PERIOD,
@@ -232,7 +225,7 @@
public void testChangeMessagePriority() throws Exception
{
- JMSQueueControlMBean queueControl = createQueueControl(queue, mbeanServer);
+ JMSQueueControlMBean queueControl = createJMSQueueControl(queue, mbeanServer);
JMSUtil.sendMessages(queue, 1);
@@ -257,13 +250,14 @@
public void testExpireMessage() throws Exception
{
- JMSQueueControlMBean queueControl = createQueueControl(queue, mbeanServer);
+ JMSQueueControlMBean queueControl = createJMSQueueControl(queue, mbeanServer);
String expiryQueueName = randomString();
JBossQueue expiryQueue = new JBossQueue(expiryQueueName);
serverManager.createQueue(expiryQueueName, expiryQueueName);
queueControl.setExpiryAddress(expiryQueue.getAddress());
- JMSQueueControlMBean expiryQueueControl = createQueueControl(expiryQueue, mbeanServer);
+ JMSQueueControlMBean expiryQueueControl = createJMSQueueControl(expiryQueue, mbeanServer);
+
JMSUtil.sendMessages(queue, 1);
assertEquals(1, queueControl.getMessageCount());
@@ -291,7 +285,7 @@
long matchingValue = randomLong();
long unmatchingValue = matchingValue + 1;
- JMSQueueControlMBean queueControl = createQueueControl(queue, mbeanServer);
+ JMSQueueControlMBean queueControl = createJMSQueueControl(queue, mbeanServer);
Connection connection = JMSUtil.createConnection(InVMConnectorFactory.class.getName());
Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
Modified: trunk/tests/src/org/jboss/messaging/tests/integration/jms/management/JMSServerControlTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/jms/management/JMSServerControlTest.java 2008-12-22 08:58:16 UTC (rev 5559)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/jms/management/JMSServerControlTest.java 2008-12-22 09:34:25 UTC (rev 5560)
@@ -22,6 +22,8 @@
package org.jboss.messaging.tests.integration.jms.management;
+import static org.jboss.messaging.tests.integration.management.ManagementControlHelper.createConnectionFactoryControl;
+import static org.jboss.messaging.tests.integration.management.ManagementControlHelper.createJMSServerControl;
import static org.jboss.messaging.tests.util.RandomUtil.randomString;
import java.util.concurrent.CountDownLatch;
@@ -33,7 +35,6 @@
import javax.jms.Session;
import javax.management.MBeanServer;
import javax.management.MBeanServerFactory;
-import javax.management.MBeanServerInvocationHandler;
import junit.framework.TestCase;
@@ -52,7 +53,6 @@
import org.jboss.messaging.jms.server.impl.JMSServerManagerImpl;
import org.jboss.messaging.jms.server.management.ConnectionFactoryControlMBean;
import org.jboss.messaging.jms.server.management.JMSServerControlMBean;
-import org.jboss.messaging.jms.server.management.impl.JMSManagementServiceImpl;
/**
* A QueueControlTest
@@ -73,24 +73,6 @@
// Static --------------------------------------------------------
- private static JMSServerControlMBean createJMSServerControl(MBeanServer mbeanServer) throws Exception
- {
- JMSServerControlMBean control = (JMSServerControlMBean)MBeanServerInvocationHandler.newProxyInstance(mbeanServer,
- JMSManagementServiceImpl.getJMSServerObjectName(),
- JMSServerControlMBean.class,
- false);
- return control;
- }
-
- private static ConnectionFactoryControlMBean createConnectionFactoryControl(String name, MBeanServer mbeanServer) throws Exception
- {
- ConnectionFactoryControlMBean control = (ConnectionFactoryControlMBean)MBeanServerInvocationHandler.newProxyInstance(mbeanServer,
- JMSManagementServiceImpl.getConnectionFactoryObjectName(name),
- ConnectionFactoryControlMBean.class,
- false);
- return control;
- }
-
private MessagingService startMessagingService(String acceptorFactory) throws Exception
{
mbeanServer = MBeanServerFactory.createMBeanServer();
Modified: trunk/tests/src/org/jboss/messaging/tests/integration/jms/management/JMSUtil.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/jms/management/JMSUtil.java 2008-12-22 08:58:16 UTC (rev 5559)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/jms/management/JMSUtil.java 2008-12-22 09:34:25 UTC (rev 5560)
@@ -44,6 +44,7 @@
import static org.jboss.messaging.tests.util.RandomUtil.randomString;
import javax.jms.Connection;
+import javax.jms.ConnectionFactory;
import javax.jms.Destination;
import javax.jms.JMSException;
import javax.jms.Message;
@@ -54,6 +55,8 @@
import javax.jms.TopicSubscriber;
import org.jboss.messaging.core.config.TransportConfiguration;
+import org.jboss.messaging.core.remoting.impl.invm.InVMConnectorFactory;
+import org.jboss.messaging.integration.transports.netty.NettyConnectorFactory;
import org.jboss.messaging.jms.client.JBossConnectionFactory;
/**
@@ -187,31 +190,22 @@
public static void sendMessages(Destination destination, int messagesToSend) throws Exception
{
- JBossConnectionFactory cf = new JBossConnectionFactory(new TransportConfiguration("org.jboss.messaging.core.remoting.impl.invm.InVMConnectorFactory"),
- null,
- DEFAULT_CONNECTION_LOAD_BALANCING_POLICY_CLASS_NAME,
- DEFAULT_PING_PERIOD,
- DEFAULT_CONNECTION_TTL,
- DEFAULT_CALL_TIMEOUT,
- null,
- DEFAULT_ACK_BATCH_SIZE,
- DEFAULT_ACK_BATCH_SIZE,
- DEFAULT_CONSUMER_WINDOW_SIZE,
- DEFAULT_CONSUMER_MAX_RATE,
- DEFAULT_SEND_WINDOW_SIZE,
- DEFAULT_PRODUCER_MAX_RATE,
- DEFAULT_MIN_LARGE_MESSAGE_SIZE,
- DEFAULT_BLOCK_ON_ACKNOWLEDGE,
- DEFAULT_BLOCK_ON_NON_PERSISTENT_SEND,
- true,
- DEFAULT_AUTO_GROUP,
- DEFAULT_MAX_CONNECTIONS,
- DEFAULT_PRE_ACKNOWLEDGE,
- DEFAULT_RETRY_INTERVAL,
- DEFAULT_RETRY_INTERVAL_MULTIPLIER,
- DEFAULT_MAX_RETRIES_BEFORE_FAILOVER,
- DEFAULT_MAX_RETRIES_AFTER_FAILOVER);
+ JBossConnectionFactory cf = new JBossConnectionFactory(new TransportConfiguration(InVMConnectorFactory.class.getName()));
+ Connection conn = cf.createConnection();
+ Session s = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
+ MessageProducer producer = s.createProducer(destination);
+
+ for (int i = 0; i < messagesToSend; i++)
+ {
+ producer.send(s.createTextMessage(randomString()));
+ }
+
+ conn.close();
+ }
+
+ public static void sendMessages(ConnectionFactory cf, Destination destination, int messagesToSend) throws Exception
+ {
Connection conn = cf.createConnection();
Session s = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
@@ -221,6 +215,8 @@
{
producer.send(s.createTextMessage(randomString()));
}
+
+ conn.close();
}
public static Message sendMessageWithProperty(Session session, Destination destination, String key, long value) throws JMSException
Modified: trunk/tests/src/org/jboss/messaging/tests/integration/jms/management/TopicControlTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/jms/management/TopicControlTest.java 2008-12-22 08:58:16 UTC (rev 5559)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/jms/management/TopicControlTest.java 2008-12-22 09:34:25 UTC (rev 5560)
@@ -22,6 +22,7 @@
package org.jboss.messaging.tests.integration.jms.management;
+import static org.jboss.messaging.tests.integration.management.ManagementControlHelper.createTopicControl;
import static org.jboss.messaging.tests.util.RandomUtil.randomLong;
import static org.jboss.messaging.tests.util.RandomUtil.randomString;
@@ -30,7 +31,6 @@
import javax.jms.Topic;
import javax.management.MBeanServer;
import javax.management.MBeanServerFactory;
-import javax.management.MBeanServerInvocationHandler;
import junit.framework.TestCase;
@@ -43,7 +43,6 @@
import org.jboss.messaging.jms.JBossTopic;
import org.jboss.messaging.jms.server.impl.JMSServerManagerImpl;
import org.jboss.messaging.jms.server.management.TopicControlMBean;
-import org.jboss.messaging.jms.server.management.impl.JMSManagementServiceImpl;
/**
* A TopicControlTest
@@ -75,15 +74,6 @@
// Static --------------------------------------------------------
- private static TopicControlMBean createTopicControl(Topic topic, MBeanServer mbeanServer) throws Exception
- {
- TopicControlMBean topicControl = (TopicControlMBean)MBeanServerInvocationHandler.newProxyInstance(mbeanServer,
- JMSManagementServiceImpl.getJMSTopicObjectName(topic.getTopicName()),
- TopicControlMBean.class,
- false);
- return topicControl;
- }
-
// Constructors --------------------------------------------------
public TopicControlTest(String name)
Modified: trunk/tests/src/org/jboss/messaging/tests/integration/management/AcceptorControlTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/management/AcceptorControlTest.java 2008-12-22 08:58:16 UTC (rev 5559)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/management/AcceptorControlTest.java 2008-12-22 09:34:25 UTC (rev 5560)
@@ -22,13 +22,13 @@
package org.jboss.messaging.tests.integration.management;
+import static org.jboss.messaging.tests.integration.management.ManagementControlHelper.createAcceptorControl;
import static org.jboss.messaging.tests.util.RandomUtil.randomString;
import java.util.HashMap;
import javax.management.MBeanServer;
import javax.management.MBeanServerFactory;
-import javax.management.MBeanServerInvocationHandler;
import junit.framework.TestCase;
@@ -39,7 +39,6 @@
import org.jboss.messaging.core.config.TransportConfiguration;
import org.jboss.messaging.core.config.impl.ConfigurationImpl;
import org.jboss.messaging.core.management.AcceptorControlMBean;
-import org.jboss.messaging.core.management.impl.ManagementServiceImpl;
import org.jboss.messaging.core.remoting.impl.invm.InVMAcceptorFactory;
import org.jboss.messaging.core.server.MessagingService;
import org.jboss.messaging.core.server.impl.MessagingServiceImpl;
@@ -66,15 +65,6 @@
// Static --------------------------------------------------------
- private static AcceptorControlMBean createControl(String name, MBeanServer mbeanServer) throws Exception
- {
- AcceptorControlMBean control = (AcceptorControlMBean)MBeanServerInvocationHandler.newProxyInstance(mbeanServer,
- ManagementServiceImpl.getAcceptorObjectName(name),
- AcceptorControlMBean.class,
- false);
- return control;
- }
-
// Constructors --------------------------------------------------
// Public --------------------------------------------------------
@@ -93,7 +83,8 @@
service = MessagingServiceImpl.newNullStorageMessagingService(conf, mbeanServer);
service.start();
- AcceptorControlMBean acceptorControl = createControl(acceptorConfig.getName(), mbeanServer);
+ AcceptorControlMBean acceptorControl = createAcceptorControl(acceptorConfig.getName(), mbeanServer);
+
assertEquals(acceptorConfig.getName(), acceptorControl.getName());
assertEquals(acceptorConfig.getFactoryClassName(), acceptorControl.getFactoryClassName());
}
@@ -111,7 +102,8 @@
service = MessagingServiceImpl.newNullStorageMessagingService(conf, mbeanServer);
service.start();
- AcceptorControlMBean acceptorControl = createControl(acceptorConfig.getName(), mbeanServer);
+ AcceptorControlMBean acceptorControl = createAcceptorControl(acceptorConfig.getName(), mbeanServer);
+
// started by the service
assertTrue(acceptorControl.isStarted());
Modified: trunk/tests/src/org/jboss/messaging/tests/integration/management/BroadcastGroupControlTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/management/BroadcastGroupControlTest.java 2008-12-22 08:58:16 UTC (rev 5559)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/management/BroadcastGroupControlTest.java 2008-12-22 09:34:25 UTC (rev 5560)
@@ -22,6 +22,7 @@
package org.jboss.messaging.tests.integration.management;
+import static org.jboss.messaging.tests.integration.management.ManagementControlHelper.createBroadcastGroupControl;
import static org.jboss.messaging.tests.util.RandomUtil.randomPositiveInt;
import static org.jboss.messaging.tests.util.RandomUtil.randomPositiveLong;
import static org.jboss.messaging.tests.util.RandomUtil.randomString;
@@ -31,7 +32,6 @@
import javax.management.MBeanServer;
import javax.management.MBeanServerFactory;
-import javax.management.MBeanServerInvocationHandler;
import junit.framework.TestCase;
@@ -40,7 +40,6 @@
import org.jboss.messaging.core.config.cluster.BroadcastGroupConfiguration;
import org.jboss.messaging.core.config.impl.ConfigurationImpl;
import org.jboss.messaging.core.management.BroadcastGroupControlMBean;
-import org.jboss.messaging.core.management.impl.ManagementServiceImpl;
import org.jboss.messaging.core.server.MessagingService;
import org.jboss.messaging.core.server.impl.MessagingServiceImpl;
import org.jboss.messaging.integration.transports.netty.NettyConnectorFactory;
@@ -66,15 +65,6 @@
// Static --------------------------------------------------------
- private static BroadcastGroupControlMBean createControl(String name, MBeanServer mbeanServer) throws Exception
- {
- BroadcastGroupControlMBean control = (BroadcastGroupControlMBean)MBeanServerInvocationHandler.newProxyInstance(mbeanServer,
- ManagementServiceImpl.getBroadcastGroupObjectName(name),
- BroadcastGroupControlMBean.class,
- false);
- return control;
- }
-
public static BroadcastGroupConfiguration randomBroadcastGroupConfiguration(List<Pair<String, String>> connectorInfos)
{
return new BroadcastGroupConfiguration(randomString(),
@@ -112,7 +102,7 @@
service = MessagingServiceImpl.newNullStorageMessagingService(conf, mbeanServer);
service.start();
- BroadcastGroupControlMBean broadcastGroupControl = createControl(broadcastGroupConfig.getName(), mbeanServer);
+ BroadcastGroupControlMBean broadcastGroupControl = createBroadcastGroupControl(broadcastGroupConfig.getName(), mbeanServer);
assertEquals(broadcastGroupConfig.getName(), broadcastGroupControl.getName());
assertEquals(broadcastGroupConfig.getGroupAddress(), broadcastGroupControl.getGroupAddress());
@@ -138,7 +128,7 @@
service = MessagingServiceImpl.newNullStorageMessagingService(conf, mbeanServer);
service.start();
- BroadcastGroupControlMBean broadcastGroupControl = createControl(broadcastGroupConfig.getName(), mbeanServer);
+ BroadcastGroupControlMBean broadcastGroupControl = createBroadcastGroupControl(broadcastGroupConfig.getName(), mbeanServer);
// started by the service
assertTrue(broadcastGroupControl.isStarted());
Modified: trunk/tests/src/org/jboss/messaging/tests/integration/management/DiscoveryGroupControlTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/management/DiscoveryGroupControlTest.java 2008-12-22 08:58:16 UTC (rev 5559)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/management/DiscoveryGroupControlTest.java 2008-12-22 09:34:25 UTC (rev 5560)
@@ -22,12 +22,12 @@
package org.jboss.messaging.tests.integration.management;
+import static org.jboss.messaging.tests.integration.management.ManagementControlHelper.createDiscoveryGroupControl;
import static org.jboss.messaging.tests.util.RandomUtil.randomPositiveLong;
import static org.jboss.messaging.tests.util.RandomUtil.randomString;
import javax.management.MBeanServer;
import javax.management.MBeanServerFactory;
-import javax.management.MBeanServerInvocationHandler;
import junit.framework.TestCase;
@@ -35,7 +35,6 @@
import org.jboss.messaging.core.config.cluster.DiscoveryGroupConfiguration;
import org.jboss.messaging.core.config.impl.ConfigurationImpl;
import org.jboss.messaging.core.management.DiscoveryGroupControlMBean;
-import org.jboss.messaging.core.management.impl.ManagementServiceImpl;
import org.jboss.messaging.core.server.MessagingService;
import org.jboss.messaging.core.server.impl.MessagingServiceImpl;
@@ -59,15 +58,6 @@
// Static --------------------------------------------------------
- private static DiscoveryGroupControlMBean createControl(String name, MBeanServer mbeanServer) throws Exception
- {
- DiscoveryGroupControlMBean control = (DiscoveryGroupControlMBean)MBeanServerInvocationHandler.newProxyInstance(mbeanServer,
- ManagementServiceImpl.getDiscoveryGroupObjectName(name),
- DiscoveryGroupControlMBean.class,
- false);
- return control;
- }
-
// Constructors --------------------------------------------------
// Public --------------------------------------------------------
@@ -85,7 +75,7 @@
service = MessagingServiceImpl.newNullStorageMessagingService(conf, mbeanServer);
service.start();
- DiscoveryGroupControlMBean discoveryGroupControl = createControl(discoveryGroupConfig.getName(), mbeanServer);
+ DiscoveryGroupControlMBean discoveryGroupControl = createDiscoveryGroupControl(discoveryGroupConfig.getName(), mbeanServer);
assertEquals(discoveryGroupConfig.getName(), discoveryGroupControl.getName());
assertEquals(discoveryGroupConfig.getGroupAddress(), discoveryGroupControl.getGroupAddress());
@@ -106,7 +96,8 @@
service = MessagingServiceImpl.newNullStorageMessagingService(conf, mbeanServer);
service.start();
- DiscoveryGroupControlMBean discoveryGroupControl = createControl(discoveryGroupConfig.getName(), mbeanServer);
+ DiscoveryGroupControlMBean discoveryGroupControl = createDiscoveryGroupControl(discoveryGroupConfig.getName(), mbeanServer);
+
// started by the service
assertTrue(discoveryGroupControl.isStarted());
@@ -127,7 +118,8 @@
service = MessagingServiceImpl.newNullStorageMessagingService(conf, mbeanServer);
service.start();
- DiscoveryGroupControlMBean discoveryGroupControl = createControl(discoveryGroupConfig.getName(), mbeanServer);
+ DiscoveryGroupControlMBean discoveryGroupControl = createDiscoveryGroupControl(discoveryGroupConfig.getName(), mbeanServer);
+
// started by the service
assertTrue(discoveryGroupControl.isStarted());
Added: trunk/tests/src/org/jboss/messaging/tests/integration/management/ManagementControlHelper.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/management/ManagementControlHelper.java (rev 0)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/management/ManagementControlHelper.java 2008-12-22 09:34:25 UTC (rev 5560)
@@ -0,0 +1,160 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005-2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.messaging.tests.integration.management;
+
+import javax.jms.Queue;
+import javax.jms.Topic;
+import javax.management.MBeanServer;
+import javax.management.MBeanServerInvocationHandler;
+import javax.management.ObjectName;
+
+import org.jboss.messaging.core.management.AcceptorControlMBean;
+import org.jboss.messaging.core.management.AddressControlMBean;
+import org.jboss.messaging.core.management.BroadcastGroupControlMBean;
+import org.jboss.messaging.core.management.DiscoveryGroupControlMBean;
+import org.jboss.messaging.core.management.MessageFlowControlMBean;
+import org.jboss.messaging.core.management.MessagingServerControlMBean;
+import org.jboss.messaging.core.management.QueueControlMBean;
+import org.jboss.messaging.core.management.impl.ManagementServiceImpl;
+import org.jboss.messaging.jms.server.management.ConnectionFactoryControlMBean;
+import org.jboss.messaging.jms.server.management.JMSQueueControlMBean;
+import org.jboss.messaging.jms.server.management.JMSServerControlMBean;
+import org.jboss.messaging.jms.server.management.TopicControlMBean;
+import org.jboss.messaging.jms.server.management.impl.JMSManagementServiceImpl;
+import org.jboss.messaging.util.SimpleString;
+
+/**
+ * A ManagementControlHelper
+ *
+ * @author jmesnil
+ *
+ */
+public class ManagementControlHelper
+{
+
+ // Constants -----------------------------------------------------
+
+ // Attributes ----------------------------------------------------
+
+ // Static --------------------------------------------------------
+
+ public static AcceptorControlMBean createAcceptorControl(String name, MBeanServer mbeanServer) throws Exception
+ {
+ return (AcceptorControlMBean)createProxy(ManagementServiceImpl.getAcceptorObjectName(name),
+ AcceptorControlMBean.class,
+ mbeanServer);
+ }
+
+ public static BroadcastGroupControlMBean createBroadcastGroupControl(String name, MBeanServer mbeanServer) throws Exception
+ {
+ return (BroadcastGroupControlMBean)createProxy(ManagementServiceImpl.getBroadcastGroupObjectName(name),
+ BroadcastGroupControlMBean.class,
+ mbeanServer);
+ }
+
+ public static DiscoveryGroupControlMBean createDiscoveryGroupControl(String name, MBeanServer mbeanServer) throws Exception
+ {
+ return (DiscoveryGroupControlMBean)createProxy(ManagementServiceImpl.getDiscoveryGroupObjectName(name),
+ DiscoveryGroupControlMBean.class,
+ mbeanServer);
+ }
+
+ public static MessageFlowControlMBean createMessageFlowControl(String name, MBeanServer mbeanServer) throws Exception
+ {
+ return (MessageFlowControlMBean)createProxy(ManagementServiceImpl.getMessageFlowObjectName(name),
+ MessageFlowControlMBean.class,
+ mbeanServer);
+ }
+
+ public static MessagingServerControlMBean createMessagingServerControl(MBeanServer mbeanServer) throws Exception
+ {
+ return (MessagingServerControlMBean)createProxy(ManagementServiceImpl.getMessagingServerObjectName(),
+ MessagingServerControlMBean.class,
+ mbeanServer);
+ }
+
+ public static QueueControlMBean createQueueControl(SimpleString address, SimpleString name, MBeanServer mbeanServer) throws Exception
+ {
+ return (QueueControlMBean)createProxy(ManagementServiceImpl.getQueueObjectName(address, name),
+ QueueControlMBean.class,
+ mbeanServer);
+ }
+
+ public static AddressControlMBean createAddressControl(SimpleString address, MBeanServer mbeanServer) throws Exception
+ {
+ return (AddressControlMBean)createProxy(ManagementServiceImpl.getAddressObjectName(address),
+ AddressControlMBean.class,
+ mbeanServer);
+ }
+
+ public static JMSQueueControlMBean createJMSQueueControl(Queue queue, MBeanServer mbeanServer) throws Exception
+ {
+ return createJMSQueueControl(queue.getQueueName(), mbeanServer);
+ }
+
+ public static JMSQueueControlMBean createJMSQueueControl(String name, MBeanServer mbeanServer) throws Exception
+ {
+ return (JMSQueueControlMBean)createProxy(JMSManagementServiceImpl.getJMSQueueObjectName(name),
+ JMSQueueControlMBean.class,
+ mbeanServer);
+ }
+
+ public static JMSServerControlMBean createJMSServerControl(MBeanServer mbeanServer) throws Exception
+ {
+ return (JMSServerControlMBean)createProxy(JMSManagementServiceImpl.getJMSServerObjectName(),
+ JMSServerControlMBean.class,
+ mbeanServer);
+ }
+
+ public static ConnectionFactoryControlMBean createConnectionFactoryControl(String name, MBeanServer mbeanServer) throws Exception
+ {
+ return (ConnectionFactoryControlMBean)createProxy(JMSManagementServiceImpl.getConnectionFactoryObjectName(name),
+ ConnectionFactoryControlMBean.class,
+ mbeanServer);
+ }
+
+ public static TopicControlMBean createTopicControl(Topic topic, MBeanServer mbeanServer) throws Exception
+ {
+ return (TopicControlMBean)createProxy(JMSManagementServiceImpl.getJMSTopicObjectName(topic.getTopicName()),
+ TopicControlMBean.class,
+ mbeanServer);
+ }
+
+ // Constructors --------------------------------------------------
+
+ // Public --------------------------------------------------------
+
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+ // Private -------------------------------------------------------
+
+ private static Object createProxy(ObjectName objectName, Class mbeanInterface, MBeanServer mbeanServer)
+ {
+ return MBeanServerInvocationHandler.newProxyInstance(mbeanServer, objectName, mbeanInterface, false);
+ }
+
+ // Inner classes -------------------------------------------------
+
+}
Modified: trunk/tests/src/org/jboss/messaging/tests/integration/management/MessageFlowControlTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/management/MessageFlowControlTest.java 2008-12-22 08:58:16 UTC (rev 5559)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/management/MessageFlowControlTest.java 2008-12-22 09:34:25 UTC (rev 5560)
@@ -22,6 +22,7 @@
package org.jboss.messaging.tests.integration.management;
+import static org.jboss.messaging.tests.integration.management.ManagementControlHelper.createMessageFlowControl;
import static org.jboss.messaging.tests.util.RandomUtil.randomBoolean;
import static org.jboss.messaging.tests.util.RandomUtil.randomDouble;
import static org.jboss.messaging.tests.util.RandomUtil.randomPositiveInt;
@@ -30,7 +31,6 @@
import javax.management.MBeanServer;
import javax.management.MBeanServerFactory;
-import javax.management.MBeanServerInvocationHandler;
import junit.framework.TestCase;
@@ -39,7 +39,6 @@
import org.jboss.messaging.core.config.cluster.MessageFlowConfiguration;
import org.jboss.messaging.core.config.impl.ConfigurationImpl;
import org.jboss.messaging.core.management.MessageFlowControlMBean;
-import org.jboss.messaging.core.management.impl.ManagementServiceImpl;
import org.jboss.messaging.core.server.MessagingService;
import org.jboss.messaging.core.server.impl.MessagingServiceImpl;
@@ -63,15 +62,6 @@
// Static --------------------------------------------------------
- private static MessageFlowControlMBean createControl(String name, MBeanServer mbeanServer) throws Exception
- {
- MessageFlowControlMBean control = (MessageFlowControlMBean)MBeanServerInvocationHandler.newProxyInstance(mbeanServer,
- ManagementServiceImpl.getMessageFlowObjectName(name),
- MessageFlowControlMBean.class,
- false);
- return control;
- }
-
public static MessageFlowConfiguration randomMessageFlowConfigurationWithDiscoveryGroup(String discoveryGroupName)
{
return new MessageFlowConfiguration(randomString(),
@@ -108,7 +98,8 @@
service = MessagingServiceImpl.newNullStorageMessagingService(conf, mbeanServer);
service.start();
- MessageFlowControlMBean messageFlowControl = createControl(messageFlowConfig.getName(), mbeanServer);
+ MessageFlowControlMBean messageFlowControl = createMessageFlowControl(messageFlowConfig.getName(), mbeanServer);
+
assertEquals(messageFlowConfig.getName(), messageFlowControl.getName());
assertEquals(messageFlowConfig.getDiscoveryGroupName(), messageFlowControl.getDiscoveryGroupName());
}
@@ -128,7 +119,8 @@
service = MessagingServiceImpl.newNullStorageMessagingService(conf, mbeanServer);
service.start();
- MessageFlowControlMBean messageFlowControl = createControl(messageFlowConfig.getName(), mbeanServer);
+ MessageFlowControlMBean messageFlowControl = createMessageFlowControl(messageFlowConfig.getName(), mbeanServer);
+
// started by the service
assertTrue(messageFlowControl.isStarted());
Modified: trunk/tests/src/org/jboss/messaging/tests/integration/management/MessagingServerControlTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/management/MessagingServerControlTest.java 2008-12-22 08:58:16 UTC (rev 5559)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/management/MessagingServerControlTest.java 2008-12-22 09:34:25 UTC (rev 5560)
@@ -28,7 +28,6 @@
import javax.management.MBeanServer;
import javax.management.MBeanServerFactory;
-import javax.management.MBeanServerInvocationHandler;
import javax.management.openmbean.TabularData;
import junit.framework.TestCase;
@@ -38,7 +37,6 @@
import org.jboss.messaging.core.config.impl.ConfigurationImpl;
import org.jboss.messaging.core.management.MessagingServerControlMBean;
import org.jboss.messaging.core.management.TransportConfigurationInfo;
-import org.jboss.messaging.core.management.impl.ManagementServiceImpl;
import org.jboss.messaging.core.remoting.impl.invm.InVMConnectorFactory;
import org.jboss.messaging.core.server.MessagingService;
import org.jboss.messaging.core.server.impl.MessagingServiceImpl;
@@ -63,15 +61,6 @@
// Static --------------------------------------------------------
- private static MessagingServerControlMBean createServerControl(MBeanServer mbeanServer) throws Exception
- {
- MessagingServerControlMBean control = (MessagingServerControlMBean)MBeanServerInvocationHandler.newProxyInstance(mbeanServer,
- ManagementServiceImpl.getMessagingServerObjectName(),
- MessagingServerControlMBean.class,
- false);
- return control;
- }
-
// Constructors --------------------------------------------------
// Public --------------------------------------------------------
@@ -91,7 +80,8 @@
service = MessagingServiceImpl.newNullStorageMessagingService(conf, mbeanServer);
service.start();
- MessagingServerControlMBean serverControl = createServerControl(mbeanServer);
+ MessagingServerControlMBean serverControl = ManagementControlHelper.createMessagingServerControl(mbeanServer);
+
TabularData acceptorData = serverControl.getConnectors();
assertNotNull(acceptorData);
assertEquals(1, acceptorData.size());
Modified: trunk/tests/src/org/jboss/messaging/tests/integration/management/QueueControlTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/management/QueueControlTest.java 2008-12-22 08:58:16 UTC (rev 5559)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/management/QueueControlTest.java 2008-12-22 09:34:25 UTC (rev 5560)
@@ -22,12 +22,12 @@
package org.jboss.messaging.tests.integration.management;
+import static org.jboss.messaging.tests.integration.management.ManagementControlHelper.createQueueControl;
import static org.jboss.messaging.tests.util.RandomUtil.randomLong;
import static org.jboss.messaging.tests.util.RandomUtil.randomSimpleString;
import javax.management.MBeanServer;
import javax.management.MBeanServerFactory;
-import javax.management.MBeanServerInvocationHandler;
import junit.framework.TestCase;
@@ -41,7 +41,6 @@
import org.jboss.messaging.core.config.TransportConfiguration;
import org.jboss.messaging.core.config.impl.ConfigurationImpl;
import org.jboss.messaging.core.management.QueueControlMBean;
-import org.jboss.messaging.core.management.impl.ManagementServiceImpl;
import org.jboss.messaging.core.remoting.impl.invm.InVMAcceptorFactory;
import org.jboss.messaging.core.remoting.impl.invm.InVMConnectorFactory;
import org.jboss.messaging.core.server.MessagingService;
@@ -70,16 +69,6 @@
// Static --------------------------------------------------------
- private static QueueControlMBean createQueueControl(SimpleString address, SimpleString name, MBeanServer mbeanServer) throws Exception
- {
- QueueControlMBean queueControl = (QueueControlMBean)MBeanServerInvocationHandler.newProxyInstance(mbeanServer,
- ManagementServiceImpl.getQueueObjectName(address,
- name),
- QueueControlMBean.class,
- false);
- return queueControl;
- }
-
// Constructors --------------------------------------------------
// Public --------------------------------------------------------
@@ -95,6 +84,9 @@
public void testMoveAllMessages() throws Exception
{
ClientSessionFactory sf = new ClientSessionFactoryImpl(new TransportConfiguration(InVMConnectorFactory.class.getName()));
+ sf.setBlockOnNonPersistentSend(true);
+ sf.setBlockOnNonPersistentSend(true);
+
ClientSession session = sf.createSession(false, true, true);
SimpleString address = randomSimpleString();
@@ -219,6 +211,8 @@
public void testRemoveAllMessages() throws Exception
{
ClientSessionFactory sf = new ClientSessionFactoryImpl(new TransportConfiguration(InVMConnectorFactory.class.getName()));
+ sf.setBlockOnNonPersistentSend(true);
+ sf.setBlockOnNonPersistentSend(true);
ClientSession session = sf.createSession(false, true, true);
SimpleString address = randomSimpleString();
@@ -265,6 +259,8 @@
long unmatchingValue = matchingValue + 1;
ClientSessionFactory sf = new ClientSessionFactoryImpl(new TransportConfiguration(InVMConnectorFactory.class.getName()));
+ sf.setBlockOnNonPersistentSend(true);
+ sf.setBlockOnNonPersistentSend(true);
ClientSession session = sf.createSession(false, true, true);
SimpleString address = randomSimpleString();
@@ -315,6 +311,8 @@
long unmatchingValue = matchingValue + 1;
ClientSessionFactory sf = new ClientSessionFactoryImpl(new TransportConfiguration(InVMConnectorFactory.class.getName()));
+ sf.setBlockOnNonPersistentSend(true);
+ sf.setBlockOnNonPersistentSend(true);
ClientSession session = sf.createSession(false, true, true);
SimpleString address = randomSimpleString();
@@ -350,6 +348,8 @@
long unmatchingValue = matchingValue + 1;
ClientSessionFactory sf = new ClientSessionFactoryImpl(new TransportConfiguration(InVMConnectorFactory.class.getName()));
+ sf.setBlockOnNonPersistentSend(true);
+ sf.setBlockOnNonPersistentSend(true);
ClientSession session = sf.createSession(false, true, true);
SimpleString address = randomSimpleString();
More information about the jboss-cvs-commits
mailing list