org.dbunit.assertion.comparer.value.IsActualLessThanOrEqualToExpectedValueComparer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of dbunit Show documentation
Show all versions of dbunit Show documentation
dbUnit is a JUnit extension (also usable from Ant and Maven) targeted for database-driven projects that, among other things, puts your database into a known state between test runs. This is an excellent way to avoid the myriad of problems that can occur when one test case corrupts the database and causes subsequent tests to fail or exacerbate the damage.
package org.dbunit.assertion.comparer.value;
import org.dbunit.DatabaseUnitException;
import org.dbunit.dataset.ITable;
import org.dbunit.dataset.datatype.DataType;
/**
* {@link ValueComparer} implementation that verifies actual value is less than
* or equal to expected value.
*
* @author Jeff Jensen
* @since 2.6.0
*/
public class IsActualLessThanOrEqualToExpectedValueComparer
extends ValueComparerTemplateBase
{
@Override
protected boolean isExpected(final ITable expectedTable,
final ITable actualTable, final int rowNum, final String columnName,
final DataType dataType, final Object expectedValue,
final Object actualValue) throws DatabaseUnitException
{
return dataType.compare(actualValue, expectedValue) < 1;
}
@Override
protected String getFailPhrase()
{
return "not less than or equal to";
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy