Package org.dbunit.annotation.runtime
package org.dbunit.annotation.runtime
-
ClassDescriptionImmutable configuration resolved from one test element's
org.dbunit.annotationinstances, ready forAnnotatedTestExecutorto drive - no dataset has been applied to a database yet, but every dataset path is normalized, every provider and catalog has been consulted, and every reflective instantiation that can fail (a provider or comparer with no accessible no-arg constructor, conflicting inline-value-and-provider attributes) has already happened.Drives one test's dbUnit lifecycle from a resolvedAnnotatedTestConfiguration, dispatchingAnnotatedTestExecutor.beforeTest()/AnnotatedTestExecutor.afterTest(boolean)to one of two path objects -SetupTeardownLifecyclewhenAnnotatedTestConfiguration.isExpected()is false,ExpectedLifecyclewhen it is true - and owning what both share: the oneTestScopedConnectionthis test's steps reuse, itsConnectionOwnershipdecision, the@DbUnitPropertyapplication, and (for an annotation-driven test) theExecutorOperationListenerinstalled on the tester.Decides whether a test opts into theorg.dbunit.annotationfamily, and so into the annotation-driven lifecycle: any of the annotations that configure a test (DbUnitConfig,DbUnitPrep,DbUnitSetup,DbUnitExpected,DbUnitTearDown,DbUnitRowCountCheck) on the test method or class, or a@DbUnitTester/@DbUnitTestCasefield in the test class or one enclosing it.A binding's way of finding theorg.dbunit.annotationannotation that applies to the test it is running, and the class that declares it: the one search strategy that differs between test frameworks, since each has its own rules for meta-annotations, inheritance and enclosing classes.Normalizes a dataset path fromorg.dbunit.annotation'sDbUnitPreporDbUnitExpectedannotations into an absolute classpath resource path, the formDataFileLoader.load(String)expects.Checks whether a type provides its own body for a method it would otherwise inherit - either an interface default method (DefaultMethodOverrideCheck.overridesDefaultMethod(java.lang.Class<?>, java.lang.Class<?>, java.lang.String, java.lang.Class<?>...)), or a method a known base class declares (DefaultMethodOverrideCheck.declaresBelow(java.lang.Class<?>, java.lang.Class<?>, java.lang.String, java.lang.Class<?>...)).Resolves theIDatabaseTesterfor an already-injected@DbUnitTestCaseinstance:PrepAndExpectedTestCase.getDatabaseTester()if it already has one, otherwise a caller-supplied fallback, wired back onto the test case and round-trip-verified.The shared rules, and the one message shape, for anorg.dbunit.annotationattribute that can be given inline or through a provider class.Reflectively instantiates, via its no-arg constructor, a class anorg.dbunit.annotationattribute names byClass- shared by every such attribute (DbUnitConfig.dataFileLoader(),failureHandler(), aVerifyTableDefinitionsProvidercatalog class, aDatabaseTesterFactory, and so on) so a missing or throwing constructor is reported consistently everywhere.An immutable snapshot of the three pieces of anIDatabaseTesterthe annotation runtime mutates for a test - its dataset, setup operation, and teardown operation - so they can be put back after the test.The binding-neutral part of resolving, for one test, theIDatabaseTesterand (when present) thePrepAndExpectedTestCaseanAnnotatedTestExecutordrives: what the test instances' fields andDbUnitConfig.databaseTesterFactory()say.The resolved tester, and the test case when a@DbUnitTestCasefield supplied one.Reads one or more catalog classes named byDbUnitConfig.verifyDefinitions()orDbUnitExpected.verifyDefinitions()and indexes theirVerifyTableDefinitions by table name, forDbUnitExpected.verifyTables()to select from.