Class EasyMockNewInvocationControl<T>
- java.lang.Object
-
- org.powermock.api.easymock.internal.invocationcontrol.EasyMockNewInvocationControl<T>
-
- All Implemented Interfaces:
DefaultBehavior
,NewInvocationControl<org.easymock.IExpectationSetters<T>>
public class EasyMockNewInvocationControl<T> extends java.lang.Object implements NewInvocationControl<org.easymock.IExpectationSetters<T>>
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
hasReplayed
private boolean
hasVerified
private java.lang.Class<T>
subsitutionType
private InvocationSubstitute<T>
substitute
-
Constructor Summary
Constructors Constructor Description EasyMockNewInvocationControl(InvocationSubstitute<T> substitute, java.lang.Class<T> type)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.easymock.IExpectationSetters<T>
expectSubstitutionLogic(java.lang.Object... arguments)
Expect a call to the new instance substitution logic.java.lang.Object
invoke(java.lang.Class<?> type, java.lang.Object[] args, java.lang.Class<?>[] sig)
Invoke the constructor invocation controljava.lang.Object
replay(java.lang.Object... mocks)
Replay the given objects or classes.java.lang.Object
reset(java.lang.Object... mocks)
Reset the given objects or classes.java.lang.Object
verify(java.lang.Object... mocks)
-
-
-
Field Detail
-
substitute
private final InvocationSubstitute<T> substitute
-
subsitutionType
private final java.lang.Class<T> subsitutionType
-
hasReplayed
private boolean hasReplayed
-
hasVerified
private boolean hasVerified
-
-
Constructor Detail
-
EasyMockNewInvocationControl
public EasyMockNewInvocationControl(InvocationSubstitute<T> substitute, java.lang.Class<T> type)
-
-
Method Detail
-
invoke
public java.lang.Object invoke(java.lang.Class<?> type, java.lang.Object[] args, java.lang.Class<?>[] sig) throws java.lang.Exception
Description copied from interface:NewInvocationControl
Invoke the constructor invocation control- Specified by:
invoke
in interfaceNewInvocationControl<T>
- Parameters:
type
- invocation target typeargs
- arguments of constructor invocationsig
- parameters of a constructor- Returns:
- result of invocation
- Throws:
java.lang.Exception
-
expectSubstitutionLogic
public org.easymock.IExpectationSetters<T> expectSubstitutionLogic(java.lang.Object... arguments) throws java.lang.Exception
Description copied from interface:NewInvocationControl
Expect a call to the new instance substitution logic.- Specified by:
expectSubstitutionLogic
in interfaceNewInvocationControl<T>
- Parameters:
arguments
- constructor arguments- Returns:
- result of stubbing a constructor. Result depends on mocking framework.
- Throws:
java.lang.Exception
-
replay
public java.lang.Object replay(java.lang.Object... mocks)
Description copied from interface:DefaultBehavior
Replay the given objects or classes. May throw exception if replay is not needed or not supported.- Specified by:
replay
in interfaceDefaultBehavior
- Parameters:
mocks
- The object(s) to replay. May benull
.- Returns:
- the result of the replay (may be
null
).
-
verify
public java.lang.Object verify(java.lang.Object... mocks)
-
reset
public java.lang.Object reset(java.lang.Object... mocks)
Description copied from interface:DefaultBehavior
Reset the given objects or classes. May throw exception if reset is not needed or not supported.- Specified by:
reset
in interfaceDefaultBehavior
- Parameters:
mocks
- The object(s) to replay. May benull
.- Returns:
- the result of the replay (may be
null
).
-
-