Author: clebert.suconic(a)jboss.com
Date: 2010-11-16 16:23:07 -0500 (Tue, 16 Nov 2010)
New Revision: 9896
Modified:
branches/Branch_New_Paging_preMerge/tests/src/org/hornetq/tests/integration/jms/server/management/JMSServerControl2Test.java
Log:
fixing test
Modified:
branches/Branch_New_Paging_preMerge/tests/src/org/hornetq/tests/integration/jms/server/management/JMSServerControl2Test.java
===================================================================
---
branches/Branch_New_Paging_preMerge/tests/src/org/hornetq/tests/integration/jms/server/management/JMSServerControl2Test.java 2010-11-16
20:11:51 UTC (rev 9895)
+++
branches/Branch_New_Paging_preMerge/tests/src/org/hornetq/tests/integration/jms/server/management/JMSServerControl2Test.java 2010-11-16
21:23:07 UTC (rev 9896)
@@ -47,6 +47,7 @@
import org.hornetq.core.remoting.impl.netty.NettyConnectorFactory;
import org.hornetq.core.server.HornetQServer;
import org.hornetq.core.server.HornetQServers;
+import org.hornetq.jms.client.HornetQMessage;
import org.hornetq.jms.client.HornetQQueue;
import org.hornetq.jms.server.impl.JMSServerManagerImpl;
import org.hornetq.tests.integration.management.ManagementControlHelper;
@@ -379,11 +380,15 @@
MessageProducer producer = session.createProducer(queue);
+ TextMessage msgSent = null;
for (int i = 0; i < 10; i++)
{
- TextMessage msg = session.createTextMessage("mymessage-" + i);
- producer.send(msg);
+ msgSent = session.createTextMessage("mymessage-" + i);
+ producer.send(msgSent);
+ System.out.println("sending msgID " + msgSent.getJMSMessageID());
}
+
+
connection.start();
@@ -394,12 +399,15 @@
for (int i = 0; i < 10; i++)
{
receivedMsg = (TextMessage)consumer.receive(3000);
+ assertNotNull(receivedMsg);
System.out.println("receiveMsg: " + receivedMsg);
}
- String lastMsgID = receivedMsg.getJMSMessageID();
- System.out.println("Last mid: " + lastMsgID);
+ assertEquals(msgSent.getJMSMessageID(), receivedMsg.getJMSMessageID());
+ HornetQMessage jmsMessage = (HornetQMessage)receivedMsg;
+ String lastMsgID = jmsMessage.getCoreMessage().getUserID().toString();
+
String jsonStr = control.listConnectionsAsJSON();
JMSConnectionInfo[] infos = JMSConnectionInfo.from(jsonStr);
@@ -410,7 +418,6 @@
assertTrue(sessInfos.length > 0);
boolean lastMsgFound = false;
- Thread.sleep(1000);
for (JMSSessionInfo sInfo : sessInfos)
{
System.out.println("Session name: " + sInfo.getSessionID());
Show replies by date