Class Expect.ExpectationGatherer

java.lang.Object
com.google.common.truth.Expect.ExpectationGatherer
All Implemented Interfaces:
FailureStrategy
Enclosing class:
Expect

private static final class Expect.ExpectationGatherer extends Object implements FailureStrategy
  • Field Details

  • Constructor Details

    • ExpectationGatherer

      ExpectationGatherer()
  • Method Details

    • fail

      public void fail(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:

      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(Throwable caught) throws Throwable
      Throws:
      Throwable
    • checkInRuleContext

      void checkInRuleContext()
    • hasFailures

      boolean hasFailures()
    • toString

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

      private static void appendIndented(int countLength, StringBuilder builder, String toAppend)
    • printSubsequentFailure

      private String printSubsequentFailure(StackTraceElement[] baseTraceFrames, AssertionError toPrint)
    • doCheckInRuleContext

      private void doCheckInRuleContext(AssertionError failure)
    • doLeaveRuleContext

      private void doLeaveRuleContext()
    • doLeaveRuleContext

      private void doLeaveRuleContext(Throwable caught) throws Throwable
      Throws:
      Throwable
    • record

      private void record(AssertionError failure)