Package org.easymock.internal

Examples of org.easymock.internal.MocksControl


     * Creates a control, order checking is enabled by default.
     *
     * @return the control.
     */
    public static IMocksControl createStrictControl() {
        return new MocksControl(MocksControl.MockType.STRICT);
    }
View Full Code Here


     * Creates a control, order checking is disabled by default.
     *
     * @return the control.
     */
    public static IMocksControl createControl() {
        return new MocksControl(MocksControl.MockType.DEFAULT);
    }
View Full Code Here

     * <code>null</code> or <code>false</code> for unexpected invocations.
     *
     * @return the control.
     */
    public static IMocksControl createNiceControl() {
        return new MocksControl(MocksControl.MockType.NICE);
    }
View Full Code Here

    public static IExpectationSetters<Object> expectLastCall() {
        return getControlForLastCall();
    }

    private static IExpectationSetters getControlForLastCall() {
        MocksControl lastControl = LastControl.lastControl();
        if (lastControl == null) {
            throw new IllegalStateException("no last call on a mock available");
        }
        return lastControl;
    }
View Full Code Here

     * Creates a control, order checking is enabled by default.
     *
     * @return the control.
     */
    public static IMocksControl createStrictControl() {
        return new MocksControl(MocksControl.MockType.STRICT);
    }
View Full Code Here

     * Creates a control, order checking is disabled by default.
     *
     * @return the control.
     */
    public static IMocksControl createControl() {
        return new MocksControl(MocksControl.MockType.DEFAULT);
    }
View Full Code Here

     * <code>null</code> or <code>false</code> for unexpected invocations.
     *
     * @return the control.
     */
    public static IMocksControl createNiceControl() {
        return new MocksControl(MocksControl.MockType.NICE);
    }
View Full Code Here

    public static IExpectationSetters<Object> expectLastCall() {
        return getControlForLastCall();
    }

    private static IExpectationSetters getControlForLastCall() {
        MocksControl lastControl = LastControl.lastControl();
        if (lastControl == null) {
            throw new IllegalStateException("no last call on a mock available");
        }
        return lastControl;
    }
View Full Code Here

    private void checkBehavior(final Object mock, final MockType behavior) {
        assertEquals(behavior, extractBehavior(mock));
    }

    private MockType extractBehavior(final Object mock) {
        final MocksControl ctrl = ClassExtensionHelper.getControl(mock);
        return ctrl.getType();
    }
View Full Code Here

    }

    private static <T> T doCreateMock(Class<T> type, ConstructorArgs constructorArgs, final IMocksControl control,
                                      Method... methods) {
        T mock;
        MocksControl mocksControl = ((MocksControl) control);
        if (constructorArgs == null) {
            if (methods == null) {
                mock = mocksControl.createMock(type);
            } else {
                mock = mocksControl.createMock(type, methods);
            }
        } else {
            if (methods == null) {
                mock = mocksControl.createMock(type, constructorArgs);
            } else {
                mock = mocksControl.createMock(type, constructorArgs, methods);
            }
        }
        return mock;
    }
View Full Code Here

TOP

Related Classes of org.easymock.internal.MocksControl

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.