TextMessage msg;
MessageProducer producer;
MessageConsumer consumer;
session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
TemporaryTopic tempTopic = session.createTemporaryTopic();
consumer = session.createConsumer(tempTopic);
connection.start();
msg = session.createTextMessage("foobar");
producer = session.createProducer(tempTopic);
producer.send(msg,DeliveryMode.NON_PERSISTENT,0,0);
producer.close();
msg = (TextMessage)consumer.receive(100);
assertNotNull(msg);
assertEquals("foobar", msg.getText());
tempTopic.delete();
session.close();
if (lastConnectionFailure != null)
fail(lastConnectionFailure.toString());
}