Class ErrorCollector


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

      • 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
      • errors

        private final java.util.List<java.lang.AssertionError> errors
    • Constructor Detail

      • ErrorCollector

        public ErrorCollector()
    • 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 - 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:
        java.lang.Exception - may be thrown from the assertion proxy call
      • collectAssertionError

        protected static void collectAssertionError​(java.lang.AssertionError error,
                                                    ErrorCollector errorCollector)
      • addError

        public void addError​(java.lang.AssertionError error)
      • errors

        public java.util.List<java.lang.AssertionError> errors()
      • wasSuccess

        public boolean wasSuccess()
      • isNestedErrorCollectorProxyCall

        private boolean isNestedErrorCollectorProxyCall()
      • countErrorCollectorProxyCalls

        private static long countErrorCollectorProxyCalls()