Class ErrorCollector


  • public class ErrorCollector
    extends Object
    Collects error messages of all AssertionErrors thrown by the proxied method.
    • Constructor Detail

      • ErrorCollector

        public ErrorCollector()
    • Method Detail

      • intercept

        @RuntimeType
        public static Object intercept​(@FieldValue("errorCollector")
                                       ErrorCollector errorCollector,
                                       @This
                                       Object assertion,
                                       @SuperCall
                                       Callable<?> proxy,
                                       @SuperMethod(nullIfImpossible=true)
                                       Method method,
                                       @StubValue
                                       Object stub)
                                throws Exception
        Parameters:
        errorCollector - the ErrorCollector to gather assertions error for the assertion instance
        assertion - 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:
        Exception - may be thrown from the assertion proxy call
      • addError

        public void addError​(Throwable error)
      • wasSuccess

        public boolean wasSuccess()
      • isNestedErrorCollectorProxyCall

        private boolean isNestedErrorCollectorProxyCall()
      • countErrorCollectorProxyCalls

        private static long countErrorCollectorProxyCalls()