Java 类org.mockito.internal.invocation.ArgumentsProcessor 实例源码
项目:powermock
文件:ToStringGenerator.java
public String generate(Object mock, Method method, Object[] arguments) {
final List<Matcher> matcherList = ArgumentsProcessor.argumentsToMatchers(arguments);
final PrintSettings printSettings = new PrintSettings();
MatchersPrinter matchersPrinter = new MatchersPrinter();
String methodName = Whitebox.getType(mock).getName() + "." + method.getName();
String invocation = methodName + matchersPrinter.getArgumentsLine(matcherList, printSettings);
if (printSettings.isMultiline()
|| (!matcherList.isEmpty() && invocation.length() > Whitebox.<Integer> getInternalState(
PrintSettings.class, "MAX_LINE_LENGTH"))) {
return methodName + matchersPrinter.getArgumentsBlock(matcherList, printSettings);
} else {
return invocation;
}
}
项目:dexmaker
文件:InvocationHandlerAdapter.java
private ProxyInvocation(Object proxy, Method method, Object[] rawArgs, DelegatingMethod
mockitoMethod, int sequenceNumber, Location location) {
this.rawArgs = rawArgs;
this.proxy = proxy;
this.method = method;
this.sequenceNumber = sequenceNumber;
this.location = location;
args = ArgumentsProcessor.expandArgs(mockitoMethod, rawArgs);
}
项目:dexmaker
文件:InterceptedInvocation.java
/**
* Create a new invocation.
*
* @param mock mocked instance
* @param method method invoked
* @param arguments arguments to the method
* @param superMethod super method
* @param sequenceNumber sequence number of the invocation
*/
InterceptedInvocation(Object mock, MockitoMethod method, Object[] arguments,
SuperMethod superMethod, int sequenceNumber) {
this.mock = mock;
this.method = method;
this.arguments = ArgumentsProcessor.expandArgs(method, arguments);
this.rawArguments = arguments;
this.superMethod = superMethod;
this.sequenceNumber = sequenceNumber;
location = new LocationImpl();
}
项目:dexmaker
文件:InvocationHandlerAdapter.java
private ProxyInvocation(Object proxy, Method method, Object[] rawArgs, DelegatingMethod
mockitoMethod, int sequenceNumber, Location location) {
this.rawArgs = rawArgs;
this.proxy = proxy;
this.method = method;
this.sequenceNumber = sequenceNumber;
this.location = location;
args = ArgumentsProcessor.expandArgs(mockitoMethod, rawArgs);
}
项目:dexmaker
文件:InterceptedInvocation.java
/**
* Create a new invocation.
*
* @param mock mocked instance
* @param method method invoked
* @param arguments arguments to the method
* @param superMethod super method
* @param sequenceNumber sequence number of the invocation
*/
InterceptedInvocation(Object mock, MockitoMethod method, Object[] arguments,
SuperMethod superMethod, int sequenceNumber) {
this.mock = mock;
this.method = method;
this.arguments = ArgumentsProcessor.expandArgs(method, arguments);
this.rawArguments = arguments;
this.superMethod = superMethod;
this.sequenceNumber = sequenceNumber;
location = new LocationImpl();
}
项目:astor
文件:PrintSettings.java
public String print(Invocation invocation) {
return print(ArgumentsProcessor.argumentsToMatchers(invocation.getArguments()), invocation);
}
项目:dexmaker
文件:InterceptedInvocation.java
@Override
public String toString() {
return new PrintSettings().print(ArgumentsProcessor.argumentsToMatchers(getArguments()),
this);
}
项目:dexmaker
文件:InterceptedInvocation.java
@Override
public String toString() {
return new PrintSettings().print(ArgumentsProcessor.argumentsToMatchers(getArguments()),
this);
}