Author: clebert.suconic(a)jboss.com
Date: 2011-09-01 09:36:39 -0400 (Thu, 01 Sep 2011)
New Revision: 11270
Modified:
branches/Branch_2_2_EAP_cluster_clean3/tests/src/org/hornetq/tests/integration/client/JMSMessageCounterTest.java
branches/Branch_2_2_EAP_cluster_clean3/tests/src/org/hornetq/tests/util/JMSTestBase.java
branches/Branch_2_2_EAP_cluster_clean3/tests/src/org/hornetq/tests/util/UnitTestCase.java
Log:
tweaks
Modified:
branches/Branch_2_2_EAP_cluster_clean3/tests/src/org/hornetq/tests/integration/client/JMSMessageCounterTest.java
===================================================================
---
branches/Branch_2_2_EAP_cluster_clean3/tests/src/org/hornetq/tests/integration/client/JMSMessageCounterTest.java 2011-09-01
13:31:34 UTC (rev 11269)
+++
branches/Branch_2_2_EAP_cluster_clean3/tests/src/org/hornetq/tests/integration/client/JMSMessageCounterTest.java 2011-09-01
13:36:39 UTC (rev 11270)
@@ -40,37 +40,49 @@
public void testMessageCounter() throws Exception
{
- Connection conn = cf.createConnection();
- Session sess = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
- Queue queue = createQueue(true, "Test");
-
- MessageProducer producer = sess.createProducer(queue);
- producer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
-
- final int numMessages = 100;
-
- for (int i = 0; i < numMessages; i++)
+ try
{
- TextMessage mess = sess.createTextMessage("msg" + i);
- producer.send(mess);
+ Connection conn = cf.createConnection();
+ Session sess = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+ Queue queue = createQueue(true, "Test");
+
+ MessageProducer producer = sess.createProducer(queue);
+ producer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
+
+ final int numMessages = 100;
+
+ for (int i = 0; i < numMessages; i++)
+ {
+ TextMessage mess = sess.createTextMessage("msg" + i);
+ producer.send(mess);
+ }
+
+ conn.close();
+
+ JMSQueueControl control =
(JMSQueueControl)server.getManagementService().getResource(ResourceNames.JMS_QUEUE +
queue.getQueueName());
+ assertNotNull(control);
+
+ System.out.println(control.listMessageCounterAsHTML());
+
+ jmsServer.stop();
+
+ restartServer();
+
+ control =
(JMSQueueControl)server.getManagementService().getResource(ResourceNames.JMS_QUEUE +
queue.getQueueName());
+ assertNotNull(control);
+
+ System.out.println(control.listMessageCounterAsHTML());
}
-
- conn.close();
-
- JMSQueueControl control =
(JMSQueueControl)server.getManagementService().getResource(ResourceNames.JMS_QUEUE +
queue.getQueueName());
- assertNotNull(control);
-
- System.out.println(control.listMessageCounterAsHTML());
-
- jmsServer.stop();
-
- restartServer();
-
- control =
(JMSQueueControl)server.getManagementService().getResource(ResourceNames.JMS_QUEUE +
queue.getQueueName());
- assertNotNull(control);
-
- System.out.println(control.listMessageCounterAsHTML());
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ throw e;
+ }
+ finally
+ {
+ jmsServer.stop();
+ }
}
Modified:
branches/Branch_2_2_EAP_cluster_clean3/tests/src/org/hornetq/tests/util/JMSTestBase.java
===================================================================
---
branches/Branch_2_2_EAP_cluster_clean3/tests/src/org/hornetq/tests/util/JMSTestBase.java 2011-09-01
13:31:34 UTC (rev 11269)
+++
branches/Branch_2_2_EAP_cluster_clean3/tests/src/org/hornetq/tests/util/JMSTestBase.java 2011-09-01
13:36:39 UTC (rev 11270)
@@ -182,9 +182,6 @@
mbeanServer = null;
super.tearDown();
-
-
- super.tearDown();
}
// Private -------------------------------------------------------
Modified:
branches/Branch_2_2_EAP_cluster_clean3/tests/src/org/hornetq/tests/util/UnitTestCase.java
===================================================================
---
branches/Branch_2_2_EAP_cluster_clean3/tests/src/org/hornetq/tests/util/UnitTestCase.java 2011-09-01
13:31:34 UTC (rev 11269)
+++
branches/Branch_2_2_EAP_cluster_clean3/tests/src/org/hornetq/tests/util/UnitTestCase.java 2011-09-01
13:36:39 UTC (rev 11270)
@@ -571,7 +571,7 @@
}
catch (Exception e)
{
- throw new IllegalStateException("port " + port + " is already
bound");
+ throw new IllegalStateException("port " + port + " is
bound");
}
finally
{
Show replies by date