Package com.volantis.testtools.mock

Examples of com.volantis.testtools.mock.EventEffect


        // Assess the effect of the event.
        StringWriter out = new StringWriter();
        Report report = new ReportImpl(out);

        EventEffect effect = checkExpectations(ExpectationState.CURRENT, event, report);
        if (effect == EventEffect.WOULD_FAIL
                || effect == EventEffect.WOULD_SATISFY) {

            String reason = out.getBuffer().toString();
            StringBuffer message = new StringBuffer();
View Full Code Here


    public SatisfactionLevel checkSatisfactionLevel(Report report) {
        if (isCompletelySatisfied(ExpectationState.CURRENT)) {
            return SatisfactionLevel.COMPLETE;
        }

        EventEffect eventEffect = checkExpectations(
                ExpectationState.CURRENT, VerifyEvent.INSTANCE, report);
        return (eventEffect == EventEffect.WOULD_SATISFY)
                ? SatisfactionLevel.PARTIAL : SatisfactionLevel.UNSATISFIED;
    }
View Full Code Here

        // 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

        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

        // 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

        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

            // 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

            // 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

    public void testAssessInitialState() {
        set.checkExpectations(ExpectationState.CURRENT, new TestEvent("B"), report);
        set.checkExpectations(ExpectationState.CURRENT, new TestEvent("A"), report);
        set.checkExpectations(ExpectationState.CURRENT, new TestEvent("C"), report);

        EventEffect effect
                = set.checkExpectations(ExpectationState.INITIAL,
                                   new TestEvent("A"), report);
        assertSame("Unexpected event effect assessment",
                   EventEffect.MATCHED_EXPECTATION, effect);
    }
View Full Code Here

        //   Test Expectations
        // =====================================================================

        RepeatingExpectation expectation = new RepeatingExpectation(
                1, Integer.MAX_VALUE, expectationMock);
        EventEffect effect;

        // Try one, this should cause the repeating expectation to be partially
        // satisfied.
        effect = expectation.checkExpectations(ExpectationState.CURRENT,
                                               eventMock, report);
View Full Code Here

TOP

Related Classes of com.volantis.testtools.mock.EventEffect

Copyright © 2018 www.massapicom. 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.