27522753275427552756275727582759276027612762
assertTrue(rm.isReliable()); assertEquals(0, rm.getMessageID()); Transaction tx = tr.createTransaction(); r.acknowledge(rm, tx); deliveringCount = queue.getDeliveringCount(); assertEquals(1, deliveringCount); tx.commit();
28512852285328542855285628572858285928602861
for(Iterator i = r.getMessages().iterator(); i.hasNext();) { Message ackm = (Message)i.next(); // non-transacted acknowledgment r.acknowledge(ackm, null); } assertTrue(queue.browse().isEmpty()); }
29102911291229132914291529162917291829192920
Transaction tx = tr.createTransaction(); for(Iterator i = r.getMessages().iterator(); i.hasNext();) { Message ackm = (Message)i.next(); r.acknowledge(ackm, tx); } tx.commit(); assertTrue(queue.browse().isEmpty());
29682969297029712972297329742975297629772978
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()); } //////////
30173018301930203021302230233024302530263027
48614862486348644865486648674868486948704871
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()); } /**
49034904490549064907490849094910491149124913
assertEquals(1, messages.size()); Message ackm = (Message)messages.get(0); assertEquals(0, ackm.getMessageID()); // an extra acknowledgment should be discarded r.acknowledge(ackm, null); assertTrue(queue.browse().isEmpty()); }
49444945494649474948494949504951495249534954
assertEquals(0, ackm.getMessageID()); Transaction tx = tr.createTransaction(); // transacted acknowledgment r.acknowledge(ackm, tx); deliveringCount = queue.getDeliveringCount(); assertEquals(1, deliveringCount); tx.commit();
49904991499249934994499549964997499849995000
assertEquals(0, ackm.getMessageID()); Transaction tx = tr.createTransaction(); // transacted acknowledgment r.acknowledge(ackm, tx); deliveringCount = queue.getDeliveringCount(); assertEquals(1, deliveringCount); tx.rollback();
50015002500350045005500650075008500950105011
deliveringCount = queue.getDeliveringCount(); assertEquals(1, deliveringCount); // acknowledge non-transactionally r.acknowledge(ackm, null); assertTrue(queue.browse().isEmpty()); }