org.unitils.mock.report.impl
Class ObservedInvocationsReport
java.lang.Object
org.unitils.mock.report.impl.ProxyInvocationsReport
org.unitils.mock.report.impl.ObservedInvocationsReport
- Direct Known Subclasses:
- DetailedObservedInvocationsReport
public class ObservedInvocationsReport
- extends ProxyInvocationsReport
A view that displays the observed invocations and the location where they were invoked.
The arguments are shown inline when the length is small enough, else the argument is named using the
type (eg Person => person1).
Example:
1. mock.method1()) -> string1 ..... at MyTest.testMethod(MyTest.java:60)
2. mock.method1("bla", 4) -> null ..... at MyTest.testMethod(MyTest.java:62)
3. mock.anotherMethod(myClass1) ..... at MyTest.testMethod(MyTest.java:64)
- Author:
- Kenny Claes, Filip Neven, Tim Ducheyne
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ObservedInvocationsReport
public ObservedInvocationsReport(Object testedObject)
createReport
public String createReport(List<ObservedInvocation> observedInvocations)
- Creates a string representation of the given invocations as described in the class javadoc.
- Parameters:
observedInvocations
- The invocations for which to create a report, not null
- Returns:
- The string representation, not null
formatObservedInvocation
protected String formatObservedInvocation(ObservedInvocation observedInvocation,
List<ProxyInvocationsReport.FormattedObject> currentLargeObjects,
Map<Object,ProxyInvocationsReport.FormattedObject> allLargeObjects,
Map<Class<?>,Integer> largeObjectNameIndexes)
- Creates a string representation of the given invocation.
If arguments and result values are small enough, they are displayed inline, else the value is replaced by
a name generated by the
ProxyInvocationsReport.createLargeValueName(java.lang.Class>, java.util.Map, java.lang.Integer>)
method.
- Parameters:
observedInvocation
- The invocation to format, not nullcurrentLargeObjects
- The current the large values, not nullallLargeObjects
- All large values per value, not nulllargeObjectNameIndexes
- The current indexes to use for the large value names (per value type), not null
- Returns:
- The string representation, not null
formatMockName
protected String formatMockName(ObservedInvocation observedInvocation)
Copyright © 2011. All Rights Reserved.