Class VerifyTableDefinitionCatalog

java.lang.Object
org.dbunit.annotation.runtime.VerifyTableDefinitionCatalog

public class VerifyTableDefinitionCatalog extends Object
Reads one or more catalog classes named by DbUnitConfig.verifyDefinitions() or DbUnitExpected.verifyDefinitions() and indexes their VerifyTableDefinitions by table name, for DbUnitExpected.verifyTables() to select from.

Each catalog class is read one of two ways: if it implements VerifyTableDefinitionsProvider, it is reflectively instantiated with its no-arg constructor and asked for its definitions; otherwise its public static final VerifyTableDefinition fields are read directly. The same table name appearing in two catalog classes is rejected rather than silently resolved by declaration order.

Not intended for direct use by test code; this is machinery consumed by AnnotatedTestConfiguration.

Since:
3.6.0
Author:
Jeff Jensen
  • Constructor Details

    • VerifyTableDefinitionCatalog

      public VerifyTableDefinitionCatalog(Class<?>... catalogClasses)
      Reads and merges the given catalog classes.
      Parameters:
      catalogClasses - The catalog classes to read; each either implements VerifyTableDefinitionsProvider or exposes public static final VerifyTableDefinition fields.
  • Method Details

    • select

      public VerifyTableDefinition[] select(String... tableNames)
      Selects the named tables' definitions, or every definition in the catalog when no names are given.
      Parameters:
      tableNames - The table names to select; empty selects every definition in the catalog.
      Returns:
      The selected definitions, in the order named (or catalog order, when every definition is selected).
      Throws:
      IllegalStateException - When a named table is not present in the catalog.