Examples of TestEvent


Examples of com.foreach.across.test.modules.TestEvent

    assertTrue( scannedBeanModule2.getEventsReceived().isEmpty() );
    assertTrue( constructedBeanModule1.getEventsReceived().isEmpty() );
    assertTrue( constructedBeanModule2.getEventsReceived().isEmpty() );
    assertTrue( testListener.getEventsReceived().isEmpty() );

    TestEvent testEvent = new TestEvent();
    context.publishEvent( testEvent );

    assertEquals( 1, scannedBeanModule1.getEventsReceived().size() );
    assertEquals( 1, scannedBeanModule2.getEventsReceived().size() );
    assertEquals( 1, constructedBeanModule1.getEventsReceived().size() );
View Full Code Here

Examples of com.lmax.disruptor.support.TestEvent

    @Test
    public void shouldHandleAndIgnoreException()
    {
        final Exception ex = new Exception();
        final TestEvent event = new TestEvent();

        final Logger logger = context.mock(Logger.class);

        context.checking(new Expectations()
        {
View Full Code Here

Examples of com.volantis.testtools.mock.TestEvent

        // It should be partially satisfied without any events.
        repeating.verify();

        // It should be able to process the single event.
        repeating.checkExpectations(ExpectationState.CURRENT, new TestEvent("A"), report);

        // It should be completely satisfied now.
        assertTrue("Not completely satisfied",
                   repeating.isCompletelySatisfied(ExpectationState.CURRENT));
    }
View Full Code Here

Examples of com.volantis.testtools.mock.TestEvent

        // It should be partially satisfied without any events.
        repeating.verify();

        // See what effect processing the event will have.
        EventEffect effect = repeating.checkExpectations(
                ExpectationState.CURRENT, new TestEvent("B"), report);
        assertSame("Event does not satisfy expectation",
                   EventEffect.WOULD_SATISFY, effect);
    }
View Full Code Here

Examples of com.volantis.testtools.mock.TestEvent

        }

        // Try and process a number of events.
        for (int i = 0; i < 5; i += 1) {
            // It should be able to process the single event.
            repeating.checkExpectations(ExpectationState.CURRENT, new TestEvent("A"), report);

            // Now it should be partially satisfied.
            repeating.verify();
        }
View Full Code Here

Examples of com.volantis.testtools.mock.TestEvent

        }

        // Try and process the correct number of events.
        for (int i = 0; i < 3; i += 1) {
            // It should be able to process the single event.
            repeating.checkExpectations(ExpectationState.CURRENT, new TestEvent("A"), report);
        }

        // It should be completely satisfied now.
        assertTrue("Not completely satisfied",
                   repeating.isCompletelySatisfied(ExpectationState.CURRENT));
View Full Code Here

Examples of com.volantis.testtools.mock.TestEvent

        Expectation nested = new TestSimpleExpectation("A");
        RepeatingExpectation repeating
                = new RepeatingExpectation(1, 2, nested);

        // Process and event to move it into a partially satisfied state.
        repeating.checkExpectations(ExpectationState.CURRENT, new TestEvent("A"), report);

        // Make sure that it is only partially satisfied.
        repeating.verify();
        assertFalse("Completely satisfied", repeating.isCompletelySatisfied(ExpectationState.CURRENT));

        // The unhandled event should cause the repeating expectation to be
        // satisfied but not consume the event.
        EventEffect effect = repeating.checkExpectations(
                ExpectationState.CURRENT, new TestEvent("B"), report);
        assertSame("Event does not satisfy expectation",
                   EventEffect.WOULD_SATISFY, effect);
    }
View Full Code Here

Examples of com.volantis.testtools.mock.TestEvent

        Expectation nested = new TestSimpleExpectation("A");
        RepeatingExpectation repeating
                = new RepeatingExpectation(2, 3, nested);

        // Process and event to move it towards a partially satisfied state.
        repeating.checkExpectations(ExpectationState.CURRENT, new TestEvent("A"), report);

        // Make sure that it is not partially satisfied.
        assertFalse("Partially satisfied", repeating.isSatisfied(report));

        // The unhandled event should cause the repeating expectation to fail.
        EventEffect effect = repeating.checkExpectations(
                ExpectationState.CURRENT, new TestEvent("B"), report);

        assertSame("Event does not fail expectation",
                   EventEffect.WOULD_FAIL, effect);
    }
View Full Code Here

Examples of com.volantis.testtools.mock.TestEvent

                0, 1, new TestSimpleExpectation("A"));
        RepeatingExpectation repeating
                = new RepeatingExpectation(1, 2, nested);

        // Process and event to move it into a partially satisfied state.
        repeating.checkExpectations(ExpectationState.CURRENT, new TestEvent("A"), report);

        // Make sure that it is only partially satisfied.
        repeating.verify();
        assertFalse("Completely satisfied", repeating.isCompletelySatisfied(ExpectationState.CURRENT));

        // The unhandled event should cause the repeating expectation to be
        // satisfied but not consume the event.
        EventEffect effect = repeating.checkExpectations(
                ExpectationState.CURRENT, new TestEvent("B"), report);
        assertSame("Event does not satisfy expectation",
                   EventEffect.WOULD_SATISFY, effect);
    }
View Full Code Here

Examples of com.volantis.testtools.mock.TestEvent

                0, 1, new TestSimpleExpectation("A"));
        RepeatingExpectation repeating
                = new RepeatingExpectation(20, 300, nested);

        // Process and event to move it towards a partially satisfied state.
        repeating.checkExpectations(ExpectationState.CURRENT, new TestEvent("A"), report);

        // Make sure that it is not partially satisfied.
        try {
            repeating.verify();
            fail("Partially satisfied");
        } catch (AssertionFailedError e) {
            // Worked.
        }

        // The unhandled event should cause the repeating expectation to be
        // satisfied but not consume the event.
        EventEffect effect = repeating.checkExpectations(
                ExpectationState.CURRENT, new TestEvent("B"), report);
        assertSame("Event does not satisfy expectation",
                   EventEffect.WOULD_SATISFY, effect);
    }
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.