|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.unitils.mock.argumentmatcher.ArgumentMatcherRepository
public class ArgumentMatcherRepository
A repository for holding the current set of argument matchers.
Argument matchers are placed inline in method invocations. Java will evaluate them before the method is performed. E.g. method1(notNull()) => not null will be called before method1. For this we need to store the current argument matchers so that they can be linked to the method invocation that will follow.
Constructor Summary | |
---|---|
ArgumentMatcherRepository()
|
Method Summary | |
---|---|
List<ArgumentMatcher> |
getArgumentMatchers()
|
static ArgumentMatcherRepository |
getInstance()
|
int |
getMatchInvocationEndLineNr()
|
int |
getMatchInvocationIndex()
|
int |
getMatchInvocationStartLineNr()
|
void |
registerArgumentMatcher(ArgumentMatcher argumentMatcher,
int lineNr)
Registers an argument matcher at the given line nr. |
void |
registerEndOfMatchingInvocation(int lineNr,
String methodName)
Stops the registering of argument matchers. |
void |
registerStartOfMatchingInvocation(int lineNr)
From the moment that this method is called until registerEndOfMatchingInvocation(int, java.lang.String) has been called,
argument matchers can be registered. |
void |
reset()
Clears the current argument matchers. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ArgumentMatcherRepository()
Method Detail |
---|
public static ArgumentMatcherRepository getInstance()
public void registerArgumentMatcher(ArgumentMatcher argumentMatcher, int lineNr)
argumentMatcher
- The matcher, not nulllineNr
- The line number on which the argument matcher was registered.public List<ArgumentMatcher> getArgumentMatchers()
public int getMatchInvocationStartLineNr()
public int getMatchInvocationEndLineNr()
public int getMatchInvocationIndex()
public void registerStartOfMatchingInvocation(int lineNr)
registerEndOfMatchingInvocation(int, java.lang.String)
has been called,
argument matchers can be registered.
lineNr
- The line number at which the matching invocation starts, i.e. the line number at which the performs, assertInvoked, etc.
statement occurs.public void registerEndOfMatchingInvocation(int lineNr, String methodName)
getArgumentMatchers()
.
lineNr
- The current line nrmethodName
- The current method, not nullpublic void reset()
registerStartOfMatchingInvocation(int)
must
be called again to be able to register argument matchers.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |