Package com.volantis.testtools.mock.value

Examples of com.volantis.testtools.mock.value.ExpectedValue


        }

        // Assume that all the actual value matched.
        boolean matched = true;
        for (int i = 0; i < expectedValues.length; i++) {
            ExpectedValue expectedValue = expectedValues[i];
            Object actualValue = actualValues[i];
            if (!expectedValue.matches(actualValue)) {
                matched = false;
            }
        }

        if (!matched) {
View Full Code Here


    public String toString() {
        StringBuffer buffer = new StringBuffer(40);
        buffer.append("Invoked Method: ").append(method.getName()).append("(");
        ExpectedValue[] expectedValues = arguments.getExpectedValues();
        for (int i = 0; i < expectedValues.length; i++) {
            ExpectedValue expectedValue = expectedValues[i];
            if (i > 0) {
                buffer.append(", ");
            }
            buffer.append(expectedValue);
        }
View Full Code Here

        // =====================================================================

        // Create a sequence of shared expectations.
        ExpectationBuilder expects = mockFactory.createOrderedBuilder();

        final ExpectedValue EXPECTS_INSTANCE_OF_REPORT =
                mockFactory.expectsInstanceOf(Report.class);

        final InternalExpectationMock expectationMock =
                new InternalExpectationMock("expectationMock", expects);
View Full Code Here

        // =====================================================================

        // Create a sequence of shared expectations.
        ExpectationBuilder expectations = mockFactory.createOrderedBuilder();

        final ExpectedValue EXPECTS_INSTANCE_OF_REPORT =
                mockFactory.expectsInstanceOf(Report.class);

        final InternalExpectationMock expectation1Mock =
                new InternalExpectationMock("expectation1Mock", expectations);
View Full Code Here

        // Iterate over the values testing each in turn. If any of the values
        // fail to match then this method fails immediately, otherwise this
        // method will succeed.
        if (values != null) {
            for (Iterator i = values.iterator(); i.hasNext();) {
                ExpectedValue value = (ExpectedValue) i.next();
                if (value.matches(object)) {
                    return true;
                }
            }
        }
View Full Code Here

        // Iterate over the values testing each in turn. If any of the values
        // fail to match then this method fails immediately, otherwise this
        // method will succeed.
        if (values != null) {
            for (Iterator i = values.iterator(); i.hasNext();) {
                ExpectedValue value = (ExpectedValue) i.next();
                if (!value.matches(object)) {
                    return false;
                }
            }
        }
View Full Code Here

    public ExpectedValue expectsArrayOf(Class componentClass) {
        return new ExpectedArrayOf(componentClass);
    }

    public ExpectedValue expectsToStringOf(final String toString) {
        return new ExpectedValue() {
            public boolean matches(Object object) {
                return String.valueOf(object).equals(toString);
            }
        };
    }
View Full Code Here

        final RemovalListenerMock listener4Mock =
                new RemovalListenerMock("listener4Mock", expectations);

        ExpectCacheEntry removeGroup2Key1 = new ExpectCacheEntry(
                "group2.key1", "value for (group2.key1)");
        ExpectedValue expectsCacheEntry =
                mockFactory.expectsInstanceOf(CacheEntry.class);
        listener2Mock.fuzzy
                .entryRemoved(expectsCacheEntry)
                .does(removeGroup2Key1);
        listenerRootMock.fuzzy
View Full Code Here

                                SeparatorRenderer triggeringSeparator,
                                MethodAction action) {

        CompositeExpectedValue expectedDecisionValue =
            MockFactory.getDefaultInstance().expectsAll();
        ExpectedValue value;

        // All that we can tell about the decision object itself is that it is
        // a decison object, as the compiler should detect an invalid object
        // being passed we do not have anything to do.
View Full Code Here

        // Create test objects.
        StylesMock styles = new StylesMock("styles", expectations);
        StylesMock stylesCopy = new StylesMock("stylesCopy", expectations);
        MutablePropertyValuesMock propertyValues =
                new MutablePropertyValuesMock("propertyValues", expectations);
        final ExpectedValue attributes =
                mockFactory.expectsInstanceOf(SpanAttributes.class);

        // Set expectations.
        item.expects.getMenu().returns(menu);
        item.expects.getShortcut().returns(shortcutValue);
View Full Code Here

TOP

Related Classes of com.volantis.testtools.mock.value.ExpectedValue

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.