Examples of numberOfTimeouts()


Examples of com.arjuna.ats.arjuna.coordinator.TransactionReaper.numberOfTimeouts()

        assertEquals(sortedSet.last(), reaperElement);

        // test insertion of timeout=0 is a nullop
        reaper.insert(reapable, 0);
        assertEquals(0, reaper.numberOfTransactions());
        assertEquals(0, reaper.numberOfTimeouts());
        reaper.remove(reapable);

        // test that duplicate insertion fails
        reaper.insert(reapable, 10);
        assertEquals(1, reaper.numberOfTransactions());
View Full Code Here

Examples of com.arjuna.ats.arjuna.coordinator.TransactionReaper.numberOfTimeouts()

        reaper.remove(reapable);

        // test that duplicate insertion fails
        reaper.insert(reapable, 10);
        assertEquals(1, reaper.numberOfTransactions());
        assertEquals(1, reaper.numberOfTimeouts());
        try {
            reaper.insert(reapable, 10);
            fail("duplicate insert failed to blow up");
        } catch(Exception e) {
        }
View Full Code Here

Examples of com.arjuna.ats.arjuna.coordinator.TransactionReaper.numberOfTimeouts()

            fail("duplicate insert failed to blow up");
        } catch(Exception e) {
        }
        reaper.remove(reapable);
        assertEquals(0, reaper.numberOfTransactions());
        assertEquals(0, reaper.numberOfTimeouts());

        // test that timeout change fails
        reaper.insert(reapable, 10);
        try {
            reaper.insert(reapable, 20);
View Full Code Here

Examples of com.arjuna.ats.arjuna.coordinator.TransactionReaper.numberOfTimeouts()

            reaper.insert(reapable, 20);
            fail("timeout change insert failed to blow up");
        } catch(Exception e) {
        }
        assertEquals(1, reaper.numberOfTransactions());
        assertEquals(1, reaper.numberOfTimeouts());
        assertEquals(10, reaper.getTimeout(reapable));
        reaper.remove(reapable);
        assertEquals(0, reaper.numberOfTransactions());
        assertEquals(0, reaper.numberOfTimeouts());
View Full Code Here

Examples of com.arjuna.ats.arjuna.coordinator.TransactionReaper.numberOfTimeouts()

        assertEquals(1, reaper.numberOfTransactions());
        assertEquals(1, reaper.numberOfTimeouts());
        assertEquals(10, reaper.getTimeout(reapable));
        reaper.remove(reapable);
        assertEquals(0, reaper.numberOfTransactions());
        assertEquals(0, reaper.numberOfTimeouts());

        // enable a repeatable rendezvous before checking the reapable queue
        enableRendezvous("reaper1", true);
        // enable a repeatable rendezvous before scheduling a reapable in the worker queue for cancellation
        enableRendezvous("reaper2", true);
View Full Code Here

Examples of com.arjuna.ats.arjuna.coordinator.TransactionReaper.numberOfTimeouts()

        reaper.insert(reapable2, 2);

        // the reaper will be latched before it processes any of the reapables
        triggerRendezvous("reaper1");
        assertEquals(2, reaper.numberOfTransactions());
        assertEquals(2, reaper.numberOfTimeouts());
        // ensure we have waited at lest 1 second so the first reapable is timed out
        triggerWait(1000);
        // let the reaper proceed with the dequeue and add the entry to the work queue
        triggerRendezvous("reaper1");
        triggerRendezvous("reaper2");
View Full Code Here

Examples of com.arjuna.ats.arjuna.coordinator.TransactionReaper.numberOfTimeouts()

        triggerRendezvous("reaper2");
        // now latch the reaper worker at the dequeue
        triggerRendezvous("reaperworker1");
        // we shoudl still have two reapables in the reaper queue
        assertEquals(2, reaper.numberOfTransactions());
        assertEquals(2, reaper.numberOfTimeouts());
        // now let the worker process the work queue element -- it should not call cancel since the
        // mock reapable will not claim to be running
        triggerRendezvous("reaperworker1");
        // latch the reaper and reaper worker before they check their respective queues
        // latch the reaper before it dequeues the next reapable
View Full Code Here

Examples of com.arjuna.ats.arjuna.coordinator.TransactionReaper.numberOfTimeouts()

        // latch the reaper before it dequeues the next reapable
        triggerRendezvous("reaper1");
        triggerRendezvous("reaperworker1");
        // we should now have only 1 element in the reaper queue
        assertEquals(1, reaper.numberOfTransactions());
        assertEquals(1, reaper.numberOfTimeouts());
        // ensure we have waited at lest 1 second so the second reapable is timed out
        triggerWait(1000);
        // now let the reaper proceed with the next dequeue and enqueue the reapable for the worker to process
        triggerRendezvous("reaper1");
        triggerRendezvous("reaper2");
View Full Code Here

Examples of com.arjuna.ats.arjuna.coordinator.TransactionReaper.numberOfTimeouts()

        // relatch the reaper next time round the loop so we can be sure it is not monkeying around
        // with the transactions queue
        triggerRendezvous("reaper1");
        // the worker is still latched so we should still have one entry in the work queue
        assertEquals(1, reaper.numberOfTransactions());
        assertEquals(1, reaper.numberOfTimeouts());
        // now let the worker process the work queue element -- it should not call cancel since the
        // mock reapable wil not claim to be running
        triggerRendezvous("reaperworker1");
        // latch reaper worker again so we know it has finished processing the element
        triggerRendezvous("reaperworker1");
View Full Code Here

Examples of com.arjuna.ats.arjuna.coordinator.TransactionReaper.numberOfTimeouts()

        // mock reapable wil not claim to be running
        triggerRendezvous("reaperworker1");
        // latch reaper worker again so we know it has finished processing the element
        triggerRendezvous("reaperworker1");
        assertEquals(0, reaper.numberOfTransactions());
        assertEquals(0, reaper.numberOfTimeouts());
    }

    public class MockReapable implements Reapable
    {
        public MockReapable(Uid uid)
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.