Package com.google.common.truth
Class Expect.ExpectationGatherer
java.lang.Object
com.google.common.truth.Expect.ExpectationGatherer
- All Implemented Interfaces:
FailureStrategy
- Enclosing class:
Expect
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static voidappendIndented(int countLength, StringBuilder builder, String toAppend) (package private) voidprivate voiddoCheckInRuleContext(AssertionError failure) private voidprivate voiddoLeaveRuleContext(Throwable caught) (package private) voidvoidfail(AssertionError failure) Handles a failure.(package private) boolean(package private) voidleaveRuleContext(Throwable caught) private StringprintSubsequentFailure(StackTraceElement[] baseTraceFrames, AssertionError toPrint) private voidrecord(AssertionError failure) toString()
-
Field Details
-
failures
-
inRuleContext
-
-
Constructor Details
-
ExpectationGatherer
ExpectationGatherer()
-
-
Method Details
-
fail
Description copied from interface:FailureStrategyHandles a failure. The parameter is anAssertionErroror 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:
failin interfaceFailureStrategy
- message:
-
enterRuleContext
void enterRuleContext() -
leaveRuleContext
- Throws:
Throwable
-
checkInRuleContext
void checkInRuleContext() -
hasFailures
boolean hasFailures() -
toString
-
appendIndented
-
printSubsequentFailure
-
doCheckInRuleContext
-
doLeaveRuleContext
private void doLeaveRuleContext() -
doLeaveRuleContext
- Throws:
Throwable
-
record
-