Package org.dbunit.database.rowcount
package org.dbunit.database.rowcount
-
ClassDescription
RowCounterthat issues oneSELECT COUNT(*)per table, by loopingIDatabaseConnection.getRowCount(String).Compares a database's table row counts before and after a test, to catch a table the test left dirty - either one it should have cleaned up and did not, or a reference table it wrongly cleaned.Resolves whether the row count check is enabled, its excluded table patterns, and theRowCounterto use, from aDatabaseConfigand thedbunit.*system property overrides.Manages aRowCountCheckbaseline across one caller's test lifecycle: lazily resolves aRowCountCheckon first use - from a connection'sDatabaseConfigby default, layering an enabled flag and excluded table patterns onto it instead whenRowCountChecker.setEnabledOverride(boolean, String[])was called, or bypassing resolution entirely whenRowCountChecker.setRowCountCheck(RowCountCheck)was - captures a baseline, verifies it later, and lets the baseline be discarded when a verify would be noise - e.g. the caller's own test steps already failed, so the database is in an unknown state and a count difference is not a finding worth its own report.Immutable record of one table's row count having changed between aRowCountCheckbaseline and a later comparison.Counts the rows of a set of database tables.Immutable snapshot of table row counts, keyed by table name, taken at one point in aRowCountCheck.Thrown byRowCountCheck.verify(RowCountSnapshot, IDatabaseConnection)when one or more tables' row counts no longer match the baseline.