// we test only non-recoverable channels now
return;
}
// add an NACKING receiver to the channel
SimpleReceiver r = new SimpleReceiver("NackingReceiver", SimpleReceiver.ACCEPTING);
assertTrue(queue.add(r));
MessageReference ref = createReference(0, false, "payload");
SimpleDeliveryObserver observer = new SimpleDeliveryObserver();
Transaction tx = tr.createTransaction();
// transacted send, non-reliable message, one message
// for a transactional send, handle() return value is unspecified
queue.handle(observer, ref, tx);
// no messages in the channel
assertEquals(0, queue.browse().size());
// no message at the receiver
assertTrue(r.getMessages().isEmpty());
tx.commit();
int deliveringCount = queue.getDeliveringCount();
assertEquals(1, deliveringCount);
List acknowledging = r.getMessages();
assertEquals(1, acknowledging.size());
Message ackm = (Message)acknowledging.get(0);
assertEquals(0, ackm.getMessageID());
// non-transacted acknowledgment
r.acknowledge(ackm, null);
assertTrue(queue.browse().isEmpty());
}