"with HTTP transport enabled, skipping test ...");
return;
}
// send a bunch of messages and let them accumulate in the queue
Connection conn = cf.createConnection();
Session session = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
MessageProducer prod = session.createProducer(queue);
int messageCount = 20;
for(int i = 0; i < messageCount; i++)
{
Message m = session.createTextMessage("krakatau" + i);
prod.send(m);
}
conn.close();
// make sure messages made it to the queue
Integer count = (Integer)ServerManagement.getAttribute(queueObjectName, "MessageCount");
assertEquals(messageCount, count.intValue());
conn = cf.createConnection();
session = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
MessageConsumer cons = session.createConsumer(queue);
conn.start();
// messages will be sent in bulk from server side, on the next HTTP client listner poll
for(int i = 0; i < messageCount; i++)
{
TextMessage t = (TextMessage)cons.receive(2000);
assertNotNull(t);
assertEquals("krakatau" + i, t.getText());
}
conn.close();
}