public class ErrorCollector
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
private static class |
ErrorCollector.LastResult |
Modifier and Type | Field and Description |
---|---|
private static java.lang.String |
CLASS_NAME |
private java.util.List<java.lang.Throwable> |
errors |
static java.lang.String |
FIELD_NAME |
private static java.lang.String |
INTERCEPT_METHOD_NAME |
private ErrorCollector.LastResult |
lastResult |
Constructor and Description |
---|
ErrorCollector() |
Modifier and Type | Method and Description |
---|---|
void |
addError(java.lang.Throwable error) |
protected static void |
collectAssertionError(java.lang.AssertionError error,
ErrorCollector errorCollector) |
private static long |
countErrorCollectorProxyCalls() |
java.util.List<java.lang.Throwable> |
errors() |
static java.lang.Object |
intercept(ErrorCollector errorCollector,
java.lang.Object assertion,
java.util.concurrent.Callable<?> proxy,
java.lang.reflect.Method method,
java.lang.Object stub) |
private boolean |
isNestedErrorCollectorProxyCall() |
boolean |
wasSuccess() |
public static final java.lang.String FIELD_NAME
private static final java.lang.String INTERCEPT_METHOD_NAME
private static final java.lang.String CLASS_NAME
private final java.util.List<java.lang.Throwable> errors
private final ErrorCollector.LastResult lastResult
@RuntimeType public static java.lang.Object intercept(@FieldValue(value="errorCollector") ErrorCollector errorCollector, @This java.lang.Object assertion, @SuperCall java.util.concurrent.Callable<?> proxy, @SuperMethod(nullIfImpossible=true) java.lang.reflect.Method method, @StubValue java.lang.Object stub) throws java.lang.Exception
errorCollector
- the ErrorCollector
to gather assertions error for the assertion instanceassertion
- The instance of the method, the this reference.proxy
- A proxy to invoke the original method.method
- A reference to the original method.stub
- A default value for the return type. null for reference type and 0 for the corresponding primitive types.java.lang.Exception
- may be thrown from the assertion proxy callprotected static void collectAssertionError(java.lang.AssertionError error, ErrorCollector errorCollector)
public void addError(java.lang.Throwable error)
public java.util.List<java.lang.Throwable> errors()
public boolean wasSuccess()
private boolean isNestedErrorCollectorProxyCall()
private static long countErrorCollectorProxyCalls()