protected boolean topic = false;
private String destinationName;
protected TransactionTemplate transactionTemplate;
public void testWriteLoop() throws Exception {
transactionTemplate.run(new Callback() {
public void execute() throws Throwable {
writeMessage(0);
// lets delete using a String which should cause a warning
MessageIdentity messageIdentity = new MessageIdentity(messageIds[0]);
container.delete(messageIdentity, createMessageAck(messageIdentity));
}
});
System.out.println("About to write: " + messageCount + " messages to the container: " + container);
transactionTemplate.run(new Callback() {
public void execute() throws Throwable {
for (int i = 0; i < messageCount; i++) {
writeMessage(i + 1);
}
}
});
System.out.println("About to read: " + messageCount + " messages");
transactionTemplate.run(new Callback() {
public void execute() throws Throwable {
for (int i = 0; i < messageCount; i++) {
readMessage(i + 1);
}
}
});
System.out.println("About to delete: " + messageCount + " messages");
transactionTemplate.run(new Callback() {
public void execute() throws Throwable {
for (int i = 0; i < messageCount; i++) {
deleteMessage(i + 1);
}
}
});
if (!topic) {
System.out.println("About to check that all the messages are consumed");
transactionTemplate.run(new Callback() {
public void execute() throws Throwable {
for (int i = 0; i < messageCount; i++) {
assertNoMessage(i + 1);
}
}