Package org.assertj.core.api
Class ErrorCollector
- java.lang.Object
-
- org.assertj.core.api.ErrorCollector
-
public class ErrorCollector extends java.lang.Object
Collects error messages of all AssertionErrors thrown by the proxied method.
-
-
Field Summary
Fields Modifier and Type Field Description private AssertionErrorCollector
assertionErrorCollector
private static java.lang.String
CLASS_NAME
static java.lang.String
FIELD_NAME
private static java.lang.String
INTERCEPT_METHOD_NAME
-
Constructor Summary
Constructors Constructor Description ErrorCollector(AssertionErrorCollector collector)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
addError(java.lang.AssertionError error)
private static long
countErrorCollectorProxyCalls()
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 static boolean
isNestedErrorCollectorProxyCall()
private void
succeeded()
-
-
-
Field Detail
-
FIELD_NAME
public static final java.lang.String FIELD_NAME
- See Also:
- Constant Field Values
-
INTERCEPT_METHOD_NAME
private static final java.lang.String INTERCEPT_METHOD_NAME
- See Also:
- Constant Field Values
-
CLASS_NAME
private static final java.lang.String CLASS_NAME
-
assertionErrorCollector
private AssertionErrorCollector assertionErrorCollector
-
-
Constructor Detail
-
ErrorCollector
ErrorCollector(AssertionErrorCollector collector)
-
-
Method Detail
-
intercept
@RuntimeType public static java.lang.Object intercept(@FieldValue("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
- Parameters:
errorCollector
- theErrorCollector
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.- Returns:
- the assertion result
- Throws:
java.lang.Exception
- may be thrown from the assertion proxy call
-
addError
private void addError(java.lang.AssertionError error)
-
succeeded
private void succeeded()
-
isNestedErrorCollectorProxyCall
private static boolean isNestedErrorCollectorProxyCall()
-
countErrorCollectorProxyCalls
private static long countErrorCollectorProxyCalls()
-
-