Package com.streambase.sb.unittest
Interface TupleComparator
- All Known Implementing Classes:
FieldBasedTupleComparator
public interface TupleComparator
A
TupleComparator
abstracts comparison of tuples.- Since:
- 6.6
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Compare two tuples.boolean
compareValues
(CompleteDataType cdt, Object expected, Object actual) Compare two values withCompleteDataType
cdt.Convert the provided Tuple into a string appropriate for error messages.
-
Method Details
-
compare
Compare two tuples.- Parameters:
expected
- The expected valueactual
- The actual value- Returns:
- true if the tuples are equal
- Throws:
StreamBaseException
- error comparing tuples
-
compareValues
boolean compareValues(CompleteDataType cdt, Object expected, Object actual) throws StreamBaseException Compare two values withCompleteDataType
cdt.- Parameters:
cdt
- TheCompleteDataType
for the objects being comparedexpected
- The expected valueactual
- The actual value- Returns:
- true if the values are equal
- Throws:
StreamBaseException
- error comparing tuples
-
formatForErrorMessage
Convert the provided Tuple into a string appropriate for error messages. Some comparators may wish to omit fields that are not salient to the comparison.- Parameters:
t
- The tuple to format- Returns:
- A human readable string.
-