Problem
#968 adds MultiDataSourcePrepAndExpectedTestCase, a programmatic API for prepping
and verifying multiple data sources in one test. The annotation path
(org.dbunit.annotation / DbUnitExtension, #753) has no equivalent — @DbUnitPrep
/ @DbUnitExpected and the tester resolution are single-data-source only, and
TesterResolver explicitly rejects more than one IDatabaseTester field as
ambiguous.
Proposal
Extend the annotation vocabulary and DbUnitExtension to drive
MultiDataSourcePrepAndExpectedTestCase (or an equivalent) declaratively:
- a named-tester model — e.g.
@DbUnitTester("orders"), or a qualifier member on the
field markers — so more than one tester can be declared without ambiguity
- per-data-source
@DbUnitPrep / @DbUnitExpected (repeatable, keyed by data-source
name)
TesterResolver / AnnotatedTestExecutor / ExpectedLifecycle / the resolvers
updated to carry a keyed set of testers instead of exactly one, and the
ParameterResolver for a keyed IDatabaseConnection / Connection
Scope note
Deliberately deferred from #968. It is a larger change touching TesterResolver,
AnnotatedTestExecutor, ExpectedLifecycle, and the parameter-injection model, and it
needs a named-connection design that does not exist yet. The @ParameterizedTest
limitation of annotations (see the DbUnit Annotations page's "When Not to Use These
Annotations") applies here too — the programmatic API from #968 remains the tool for
data that varies per invocation.
Dependencies
Depends on #968 and #753.
Problem
#968 adds
MultiDataSourcePrepAndExpectedTestCase, a programmatic API for preppingand verifying multiple data sources in one test. The annotation path
(
org.dbunit.annotation/DbUnitExtension, #753) has no equivalent —@DbUnitPrep/
@DbUnitExpectedand the tester resolution are single-data-source only, andTesterResolverexplicitly rejects more than oneIDatabaseTesterfield asambiguous.
Proposal
Extend the annotation vocabulary and
DbUnitExtensionto driveMultiDataSourcePrepAndExpectedTestCase(or an equivalent) declaratively:@DbUnitTester("orders"), or a qualifier member on thefield markers — so more than one tester can be declared without ambiguity
@DbUnitPrep/@DbUnitExpected(repeatable, keyed by data-sourcename)
TesterResolver/AnnotatedTestExecutor/ExpectedLifecycle/ the resolversupdated to carry a keyed set of testers instead of exactly one, and the
ParameterResolverfor a keyedIDatabaseConnection/ConnectionScope note
Deliberately deferred from #968. It is a larger change touching
TesterResolver,AnnotatedTestExecutor,ExpectedLifecycle, and the parameter-injection model, and itneeds a named-connection design that does not exist yet. The
@ParameterizedTestlimitation of annotations (see the DbUnit Annotations page's "When Not to Use These
Annotations") applies here too — the programmatic API from #968 remains the tool for
data that varies per invocation.
Dependencies
Depends on #968 and #753.