Examples of nbUpdated()


Examples of barsuift.simLife.message.PublisherTestHelper.nbUpdated()

        // this time, the split task should have stopped
        assertEquals(7, splitTask.getNbExecuted());
        assertEquals(51, splitTask.getNbIncrementExecuted());
        assertEquals(0, splitTask.getState().getConditionalTask().getExecutionCondition().getCount());
        assertEquals(60, splitTask.getState().getConditionalTask().getEndingCondition().getCount());
        assertEquals(0, publisherHelper.nbUpdated());
        assertEquals(0, publisherHelper.getUpdateObjects().size());

        // release the barrier
        (new Thread(barrierReleaser)).start();
        // make sure the thread has time to execute
View Full Code Here

Examples of barsuift.simLife.message.PublisherTestHelper.nbUpdated()

        assertFalse(splitTask.isRunning());
        assertEquals(7, splitTask.getNbExecuted());
        assertEquals(51, splitTask.getNbIncrementExecuted());
        assertEquals(0, splitTask.getState().getConditionalTask().getExecutionCondition().getCount());
        assertEquals(60, splitTask.getState().getConditionalTask().getEndingCondition().getCount());
        assertEquals(0, publisherHelper.nbUpdated());
        assertEquals(0, publisherHelper.getUpdateObjects().size());
    }

    public void testGetState() throws InterruptedException {
        assertEquals(state, splitTask.getState());
View Full Code Here

Examples of barsuift.simLife.message.PublisherTestHelper.nbUpdated()

        assertTrue(conditionalRun.isRunning());
        // run 1
        assertEquals(0, conditionalRun.getNbExecuted());
        assertEquals(1, conditionalRun.getState().getExecutionCondition().getCount());
        assertEquals(1, conditionalRun.getState().getEndingCondition().getCount());
        assertEquals(0, publisherHelper.nbUpdated());
        assertEquals(0, publisherHelper.getUpdateObjects().size());

        // test we can not run the same task again
        try {
            conditionalRun.run();
View Full Code Here

Examples of barsuift.simLife.message.PublisherTestHelper.nbUpdated()

        assertTrue(conditionalRun.isRunning());
        // run 2
        assertEquals(0, conditionalRun.getNbExecuted());
        assertEquals(2, conditionalRun.getState().getExecutionCondition().getCount());
        assertEquals(2, conditionalRun.getState().getEndingCondition().getCount());
        assertEquals(0, publisherHelper.nbUpdated());
        assertEquals(0, publisherHelper.getUpdateObjects().size());

        // release the barrier
        (new Thread(barrierReleaser)).start();
        // make sure the thread has time to execute
View Full Code Here

Examples of barsuift.simLife.message.PublisherTestHelper.nbUpdated()

        assertTrue(conditionalRun.isRunning());
        // run 3
        assertEquals(1, conditionalRun.getNbExecuted());
        assertEquals(0, conditionalRun.getState().getExecutionCondition().getCount());
        assertEquals(3, conditionalRun.getState().getEndingCondition().getCount());
        assertEquals(0, publisherHelper.nbUpdated());
        assertEquals(0, publisherHelper.getUpdateObjects().size());


        // release the barrier
        (new Thread(barrierReleaser)).start();
View Full Code Here

Examples of barsuift.simLife.message.PublisherTestHelper.nbUpdated()

        assertTrue(conditionalRun.isRunning());
        // run 4
        assertEquals(1, conditionalRun.getNbExecuted());
        assertEquals(1, conditionalRun.getState().getExecutionCondition().getCount());
        assertEquals(4, conditionalRun.getState().getEndingCondition().getCount());
        assertEquals(0, publisherHelper.nbUpdated());
        assertEquals(0, publisherHelper.getUpdateObjects().size());

        // release the barrier
        (new Thread(barrierReleaser)).start();
        // make sure the thread has time to execute
View Full Code Here

Examples of barsuift.simLife.message.PublisherTestHelper.nbUpdated()

        assertTrue(conditionalRun.isRunning());
        // run 5
        assertEquals(1, conditionalRun.getNbExecuted());
        assertEquals(2, conditionalRun.getState().getExecutionCondition().getCount());
        assertEquals(5, conditionalRun.getState().getEndingCondition().getCount());
        assertEquals(1, publisherHelper.nbUpdated());
        assertEquals(null, publisherHelper.getUpdateObjects().get(0));

        publisherHelper.reset();
        // release the barrier
        (new Thread(barrierReleaser)).start();
View Full Code Here

Examples of barsuift.simLife.message.PublisherTestHelper.nbUpdated()

        assertFalse(conditionalRun.isRunning());
        // run 6
        assertEquals(1, conditionalRun.getNbExecuted());
        assertEquals(2, conditionalRun.getState().getExecutionCondition().getCount());
        assertEquals(5, conditionalRun.getState().getEndingCondition().getCount());
        assertEquals(0, publisherHelper.nbUpdated());
        assertEquals(0, publisherHelper.getUpdateObjects().size());
    }

    public void testGetState() throws InterruptedException {
        assertEquals(state, conditionalRun.getState());
View Full Code Here

Examples of barsuift.simLife.message.PublisherTestHelper.nbUpdated()

    public void testPublisher() throws Exception {
        PublisherTestHelper publisherHelper = new PublisherTestHelper();
        publisherHelper.addSubscriberTo(synchro);

        synchro.start();
        assertEquals(1, publisherHelper.nbUpdated());
        assertNull(publisherHelper.getUpdateObjects().get(0));

        publisherHelper.reset();
        Thread.sleep(Synchronizer.CYCLE_LENGTH_CORE_MS / synchro.getSpeed().getSpeed() + 100);
        synchro.stop();
View Full Code Here

Examples of barsuift.simLife.message.PublisherTestHelper.nbUpdated()

        publisherHelper.reset();
        Thread.sleep(Synchronizer.CYCLE_LENGTH_CORE_MS / synchro.getSpeed().getSpeed() + 100);
        synchro.stop();
        barrierReleaser.run();
        Thread.sleep(Synchronizer.CYCLE_LENGTH_CORE_MS / synchro.getSpeed().getSpeed() + 100);
        assertEquals(1, publisherHelper.nbUpdated());
        assertNull(publisherHelper.getUpdateObjects().get(0));
    }


    public void testIllegalStateException() throws InterruptedException {
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.