Class Expect.ExpectationGatherer

    • Field Detail

      • failures

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

      • ExpectationGatherer

        ExpectationGatherer()
    • Method Detail

      • fail

        public void fail​(java.lang.AssertionError failure)
        Description copied from interface: FailureStrategy
        Handles a failure. The parameter is an AssertionError or subclass thereof, and it contains information about the failure, which may include:
        • message: getMessage()
        • cause: getCause()
        • actual and expected values: ComparisonFailure.getActual(), ComparisonFailure.getExpected()
        • stack trace: Throwable.getStackTrace()

        We encourage implementations to record as much of this information as practical in the exceptions they may throw or the other records they may make.

        Specified by:
        fail in interface FailureStrategy
      • enterRuleContext

        void enterRuleContext()
      • leaveRuleContext

        void leaveRuleContext​(java.lang.Throwable caught)
                       throws java.lang.Throwable
        Throws:
        java.lang.Throwable
      • checkInRuleContext

        void checkInRuleContext()
      • hasFailures

        boolean hasFailures()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • appendIndented

        private static void appendIndented​(int countLength,
                                           java.lang.StringBuilder builder,
                                           java.lang.String toAppend)
      • printSubsequentFailure

        private java.lang.String printSubsequentFailure​(java.lang.StackTraceElement[] baseTraceFrames,
                                                        java.lang.AssertionError toPrint)
      • doCheckInRuleContext

        private void doCheckInRuleContext​(java.lang.AssertionError failure)
      • doLeaveRuleContext

        private void doLeaveRuleContext()
      • doLeaveRuleContext

        private void doLeaveRuleContext​(java.lang.Throwable caught)
                                 throws java.lang.Throwable
        Throws:
        java.lang.Throwable
      • record

        private void record​(java.lang.AssertionError failure)