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 void
appendIndented
(int countLength, StringBuilder builder, String toAppend) (package private) void
private void
doCheckInRuleContext
(AssertionError failure) private void
private void
doLeaveRuleContext
(Throwable caught) (package private) void
void
fail
(AssertionError failure) Handles a failure.(package private) boolean
(package private) void
leaveRuleContext
(Throwable caught) private String
printSubsequentFailure
(StackTraceElement[] baseTraceFrames, AssertionError toPrint) private void
record
(AssertionError failure) toString()
-
Field Details
-
failures
-
inRuleContext
-
-
Constructor Details
-
ExpectationGatherer
ExpectationGatherer()
-
-
Method Details
-
fail
Description copied from interface:FailureStrategy
Handles a failure. The parameter is anAssertionError
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 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
-