org.easymock.internal

Class MocksControl

public class MocksControl extends Object implements IMocksControl, IExpectationSetters<Object>, Serializable

Nested Class Summary
static classMocksControl.MockType
Field Summary
static RangeAT_LEAST_ONCE
One or more calls.
static RangeONCE
Exactly one call.
static RangeZERO_OR_MORE
Zero or more calls.
Constructor Summary
MocksControl(MocksControl.MockType type)
Method Summary
IExpectationSetters<Object>andAnswer(IAnswer<? extends Object> answer)
IExpectationSetters<Object>andDelegateTo(Object answer)
IExpectationSetters<Object>andReturn(Object value)
voidandStubAnswer(IAnswer<? extends Object> answer)
voidandStubDelegateTo(Object delegateTo)
voidandStubReturn(Object value)
voidandStubThrow(Throwable throwable)
IExpectationSetters<Object>andThrow(Throwable throwable)
IExpectationSetters<Object>anyTimes()
voidasStub()
IExpectationSetters<Object>atLeastOnce()
voidcheckIsUsedInOneThread(boolean shouldBeUsedInOneThread)
voidcheckOrder(boolean value)
<T> TcreateMock(Class<T> toMock)
<T> TcreateMock(String name, Class<T> toMock)
protected <T> IProxyFactory<T>createProxyFactory(Class<T> toMock)
IMocksControlStategetState()
voidmakeThreadSafe(boolean threadSafe)
IExpectationSetters<Object>once()
voidreplay()
voidreset()
voidresetToDefault()
voidresetToNice()
voidresetToStrict()
voidsetLegacyDefaultReturnValue(Object value)
voidsetLegacyDefaultThrowable(Throwable throwable)
voidsetLegacyDefaultVoidCallable()
IExpectationSetters<Object>times(int times)
IExpectationSetters<Object>times(int min, int max)
voidverify()

Field Detail

AT_LEAST_ONCE

public static final Range AT_LEAST_ONCE
One or more calls.

ONCE

public static final Range ONCE
Exactly one call.

ZERO_OR_MORE

public static final Range ZERO_OR_MORE
Zero or more calls.

Constructor Detail

MocksControl

public MocksControl(MocksControl.MockType type)

Method Detail

andAnswer

public IExpectationSetters<Object> andAnswer(IAnswer<? extends Object> answer)

andDelegateTo

public IExpectationSetters<Object> andDelegateTo(Object answer)

andReturn

public IExpectationSetters<Object> andReturn(Object value)

andStubAnswer

public void andStubAnswer(IAnswer<? extends Object> answer)

andStubDelegateTo

public void andStubDelegateTo(Object delegateTo)

andStubReturn

public void andStubReturn(Object value)

andStubThrow

public void andStubThrow(Throwable throwable)

andThrow

public IExpectationSetters<Object> andThrow(Throwable throwable)

anyTimes

public IExpectationSetters<Object> anyTimes()

asStub

public void asStub()

atLeastOnce

public IExpectationSetters<Object> atLeastOnce()

checkIsUsedInOneThread

public void checkIsUsedInOneThread(boolean shouldBeUsedInOneThread)

checkOrder

public void checkOrder(boolean value)

createMock

public <T> T createMock(Class<T> toMock)

createMock

public <T> T createMock(String name, Class<T> toMock)

createProxyFactory

protected <T> IProxyFactory<T> createProxyFactory(Class<T> toMock)

getState

public IMocksControlState getState()

makeThreadSafe

public void makeThreadSafe(boolean threadSafe)

once

public IExpectationSetters<Object> once()

replay

public void replay()

reset

public final void reset()

resetToDefault

public void resetToDefault()

resetToNice

public void resetToNice()

resetToStrict

public void resetToStrict()

setLegacyDefaultReturnValue

public void setLegacyDefaultReturnValue(Object value)

setLegacyDefaultThrowable

public void setLegacyDefaultThrowable(Throwable throwable)

setLegacyDefaultVoidCallable

public void setLegacyDefaultVoidCallable()

times

public IExpectationSetters<Object> times(int times)

times

public IExpectationSetters<Object> times(int min, int max)

verify

public void verify()
Copyright © 2001-2009 OFFIS, Tammo Freese, Henri Tremblay. This documentation is provided under the terms of the MIT licence.]]>