- java.lang.Object
-
- com.pervasive.datarush.test.FloatingPointMismatchFilter
-
- All Implemented Interfaces:
Assertions.MismatchFilter
public class FloatingPointMismatchFilter extends Object implements Assertions.MismatchFilter
A filter for handling mismatches in floating point values. Errors within a specified tolerance are ignored.
-
-
Field Summary
-
Fields inherited from interface com.pervasive.datarush.commons.test.Assertions.MismatchFilter
IGNORE_SORT_ORDER, NO_FILTER
-
-
Constructor Summary
Constructors Constructor Description FloatingPointMismatchFilter(FloatingPointTolerance tolerance, String separator)Declares a filter using the specified tolerance range.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanignoreMismatch(String expected, String actual)Indicates whether the specified mismatch should be ignored for comparison purposed.booleanignoreSortOrder()Indicates whether the filter should ignore sort order
-
-
-
Constructor Detail
-
FloatingPointMismatchFilter
public FloatingPointMismatchFilter(FloatingPointTolerance tolerance, String separator)
Declares a filter using the specified tolerance range. The line is assumed to consist of floating point values separated by the given separator.- Parameters:
tolerance- the permitted degree of error in valuesseparator- the character sequence separating field values
-
-
Method Detail
-
ignoreMismatch
public boolean ignoreMismatch(String expected, String actual)
Description copied from interface:Assertions.MismatchFilterIndicates whether the specified mismatch should be ignored for comparison purposed.- Specified by:
ignoreMismatchin interfaceAssertions.MismatchFilter- Parameters:
expected- the expected lineactual- the actual line found- Returns:
trueif the mismatch is not significant,falseif it is.
-
ignoreSortOrder
public boolean ignoreSortOrder()
Description copied from interface:Assertions.MismatchFilterIndicates whether the filter should ignore sort order- Specified by:
ignoreSortOrderin interfaceAssertions.MismatchFilter- Returns:
- whether the filter should ignore sort order
-
-