SimpleReceiver r = new SimpleReceiver("NackingReceiver", SimpleReceiver.ACCEPTING);
assertTrue(queue.add(r));
SimpleDeliveryObserver observer = new SimpleDeliveryObserver();
Transaction tx = tr.createTransaction();
MessageReference[] refs = new MessageReference[NUMBER_OF_MESSAGES];
for(int i = 0; i < NUMBER_OF_MESSAGES; i++)
{
refs[i] = createReference(i, false, "payload" + i);
// transacted send, non-reliable message, multiple messages
// for a transactional send, handle() return value is unspecified
queue.handle(observer, refs[i], tx);
}
// no messages in the channel
assertEquals(0, queue.browse().size());
// no message at the receiver
assertTrue(r.getMessages().isEmpty());
tx.commit();
assertEquals(NUMBER_OF_MESSAGES, queue.getDeliveringCount());
assertEqualSets(refs, r.getMessages());
for(Iterator i = r.getMessages().iterator(); i.hasNext();)