public class IsActualWithinToleranceOfExpectedTimestampValueComparer extends ValueComparerTemplateBase
ValueComparer implementation for Timestamps that verifies
actual value is within a low and high milliseconds tolerance range of
expected value.
Note: If actual and expected values are both null, the comparison passes.| Modifier and Type | Field and Description |
|---|---|
static long |
FIVE_MINUTES_IN_MILLIS |
static long |
FIVE_SECONDS_IN_MILLIS |
static long |
FOUR_MINUTES_IN_MILLIS |
static long |
FOUR_SECONDS_IN_MILLIS |
static long |
ONE_MINUTE_IN_MILLIS |
static long |
ONE_SECOND_IN_MILLIS |
static long |
TEN_MINUTES_IN_MILLIS |
static long |
THREE_MINUTES_IN_MILLIS |
static long |
THREE_SECONDS_IN_MILLIS |
static long |
TWO_MINUTES_IN_MILLIS |
static long |
TWO_SECONDS_IN_MILLIS |
BASE_FAIL_MSG| Constructor and Description |
|---|
IsActualWithinToleranceOfExpectedTimestampValueComparer(long lowToleranceValueInMillis,
long highToleranceValueInMillis)
Create instance specifying the allowed actual time difference range from
expected.
|
| Modifier and Type | Method and Description |
|---|---|
protected long |
calcTimeDifference(long actualTimeInMillis,
long expectedTimeInMillis) |
protected long |
convertValueToTimeInMillis(java.lang.Object timestampValue) |
protected java.lang.String |
getFailPhrase() |
protected boolean |
isExpected(ITable expectedTable,
ITable actualTable,
int rowNum,
java.lang.String columnName,
DataType dataType,
java.lang.Object expectedValue,
java.lang.Object actualValue) |
protected boolean |
isExpectedWithNull(java.lang.Object expectedValue,
java.lang.Object actualValue)
Since one is a known null, isExpected=true when they equal.
|
protected boolean |
isExpectedWithoutNull(java.lang.Object expectedValue,
java.lang.Object actualValue)
Neither is null so compare values with tolerance.
|
protected boolean |
isTolerant(long diffTime) |
doCompare, makeFailMessagecompare, toStringpublic static final long ONE_SECOND_IN_MILLIS
public static final long TWO_SECONDS_IN_MILLIS
public static final long THREE_SECONDS_IN_MILLIS
public static final long FOUR_SECONDS_IN_MILLIS
public static final long FIVE_SECONDS_IN_MILLIS
public static final long ONE_MINUTE_IN_MILLIS
public static final long TWO_MINUTES_IN_MILLIS
public static final long THREE_MINUTES_IN_MILLIS
public static final long FOUR_MINUTES_IN_MILLIS
public static final long FIVE_MINUTES_IN_MILLIS
public static final long TEN_MINUTES_IN_MILLIS
public IsActualWithinToleranceOfExpectedTimestampValueComparer(long lowToleranceValueInMillis,
long highToleranceValueInMillis)
lowToleranceValueInMillis - The minimum time difference allowed.highToleranceValueInMillis - The maximum time difference allowed.protected boolean isExpected(ITable expectedTable, ITable actualTable, int rowNum, java.lang.String columnName, DataType dataType, java.lang.Object expectedValue, java.lang.Object actualValue) throws DatabaseUnitException
isExpected in class ValueComparerTemplateBaseDatabaseUnitExceptionprotected boolean isExpectedWithNull(java.lang.Object expectedValue,
java.lang.Object actualValue)
protected boolean isExpectedWithoutNull(java.lang.Object expectedValue,
java.lang.Object actualValue)
protected boolean isTolerant(long diffTime)
protected long convertValueToTimeInMillis(java.lang.Object timestampValue)
protected long calcTimeDifference(long actualTimeInMillis,
long expectedTimeInMillis)
protected java.lang.String getFailPhrase()
getFailPhrase in class ValueComparerTemplateBaseValueComparerBase.BASE_FAIL_MSG.Copyright © 2002-2018. All Rights Reserved.