public class BasicErrorReport extends java.lang.Object implements ErrorReport
ExpectTuplesFailure
for reporting errors.Constructor and Description |
---|
BasicErrorReport(java.lang.String header)
Create an empty error report.
|
Modifier and Type | Method and Description |
---|---|
void |
addFoundTuple(TupleMatcher m,
com.streambase.sb.Tuple t)
add a successfully matched tuple to the report.
|
void |
addMissingMatcher(TupleMatcher m)
add a matcher that failed to match anything to the report.
|
void |
addUnexpectedTuple(com.streambase.sb.Tuple t)
add a tuple that failed to match anything to the report.
|
protected java.lang.String |
formatTupleForMessage(com.streambase.sb.Tuple t)
Subclasses wishing to customize the display of Tuples in the
error message should override this method.
|
java.lang.String |
getActualMessage()
inside Eclipse the JUnit view will present a graphical diff of
ErrorReport.getExpectedMessage() and ErrorReport.getActualMessage() . |
java.lang.String |
getExpectedMessage()
inside Eclipse the JUnit view will present a graphical diff of
ErrorReport.getExpectedMessage() and ErrorReport.getActualMessage() . |
java.util.List<TupleMatcher> |
getFoundMatchers()
get the tuple matchers that matched successfully
|
java.util.List<com.streambase.sb.Tuple> |
getFoundTuples()
get the tuples that matched successfully
|
java.lang.String |
getMessage()
get the message shown in the stack trace, when reporting a failure.
|
java.util.List<TupleMatcher> |
getMissingMatchers()
get the tuple matchers that failed to match.
|
java.util.List<com.streambase.sb.Tuple> |
getUnexpectedTuples()
get the tuples that arrived unexpectedly
|
protected java.lang.String |
makeFoundMessage()
Subclasses wishing to customize the "Found tuples" section of the
error message should override this method.
|
protected java.lang.String |
makeMissingMessage()
Subclasses wishing to customize the "Missing tuples" section of the
error message should override this method.
|
protected java.lang.String |
makeUnexpectedMessage()
Subclasses wishing to customize the "Unexpected tuples" section of the
error message should override this method.
|
void |
throwIfError(StreamMatcher.ExtraTuples extra)
throw an error that summarizes the report, if it contains errors.
|
public BasicErrorReport(java.lang.String header)
header
- A human readable header to preface the error messagepublic void addFoundTuple(TupleMatcher m, com.streambase.sb.Tuple t)
ErrorReport
addFoundTuple
in interface ErrorReport
m
- The matcher that succeededt
- The tuple that it succeeded againstpublic java.util.List<com.streambase.sb.Tuple> getFoundTuples()
ErrorReport
getFoundTuples
in interface ErrorReport
public java.util.List<TupleMatcher> getFoundMatchers()
ErrorReport
getFoundMatchers
in interface ErrorReport
public void addUnexpectedTuple(com.streambase.sb.Tuple t)
ErrorReport
addUnexpectedTuple
in interface ErrorReport
public java.util.List<com.streambase.sb.Tuple> getUnexpectedTuples()
ErrorReport
getUnexpectedTuples
in interface ErrorReport
public void addMissingMatcher(TupleMatcher m)
ErrorReport
addMissingMatcher
in interface ErrorReport
public java.util.List<TupleMatcher> getMissingMatchers()
ErrorReport
getMissingMatchers
in interface ErrorReport
public void throwIfError(StreamMatcher.ExtraTuples extra) throws java.lang.AssertionError
ErrorReport
throwIfError
in interface ErrorReport
extra
- Should unexpected tuples be treated as errorsjava.lang.AssertionError
public java.lang.String getMessage()
ErrorReport
getMessage
in interface ErrorReport
public java.lang.String getActualMessage()
ErrorReport
ErrorReport.getExpectedMessage()
and ErrorReport.getActualMessage()
.getActualMessage
in interface ErrorReport
public java.lang.String getExpectedMessage()
ErrorReport
ErrorReport.getExpectedMessage()
and ErrorReport.getActualMessage()
.getExpectedMessage
in interface ErrorReport
protected java.lang.String makeMissingMessage()
protected java.lang.String makeUnexpectedMessage()
protected java.lang.String makeFoundMessage()
protected java.lang.String formatTupleForMessage(com.streambase.sb.Tuple t)