InitialContext ic = new InitialContext();
StatelessSessionExampleHome home =
(StatelessSessionExampleHome)ic.lookup("ejb/StatelessSessionExample");
StatelessSessionExample bean = home.create();
String queueName = getDestinationJNDIName();
String text = "Hello!";
bean.drain(queueName);
bean.send("Hello!", queueName);
log("The " + text + " message was successfully sent to the " + queueName + " queue");
int num = bean.browse(queueName);
assertEquals(1, num);
log("Queue browse result: " + num);
String result = bean.receive(queueName);
log("Received " + result);
assertEquals("Hello!", result);
bean.remove();
}