Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/changes/changes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
</properties>

<body>
<release version="3.4.1-SNAPSHOT" date="TBD" description="A documentation-site overhaul (new tutorials, 9 database vendor guides, a class-by-class Core Components reference, consolidated Filters/Datasets/Operations pages, and a new Developing DbUnit contributor section covering coding standards, commit/changelog requirements, and the GitHub workflow); a new JUnit 5/6 extension module (DbUnitExtension) for @ExtendWith-based lifecycle management; a new JSON dataset format (JsonDataSet/JsonProducer/JsonWriter); an opt-in all-column sort for tables without a primary key; an opt-in sort-on-filtered-columns-only mode for DefaultPrepAndExpectedTestCase fixing false failures on tables with a generated/identity first column; an optional DefaultPrepAndExpectedTestCase FailureHandler for collecting every mismatch instead of failing fast; MultiSchemaMySqlMetadataHandler for multi-schema MySQL connections; constructor-injected per-connection DatabaseConfig support for DataSourceDatabaseTester; new MariaDB support (MariaDbDataTypeFactory plus a Docker-backed IT profile); and multiple bug fixes including escape-pattern handling, primary-key filter fallback, empty-dataset DTD export, DatabaseDataSet initialization order, and a from-scratch clean-build pass across Javadoc doclint, Checkstyle, and compiler warnings">
<release version="3.4.1-SNAPSHOT" date="TBD" description="A documentation-site overhaul (new tutorials, 9 database vendor guides, a class-by-class Core Components reference, consolidated Filters/Datasets/Operations pages, and a new Developing DbUnit contributor section covering coding standards, commit/changelog requirements, and the GitHub workflow); a new JUnit 5/6 extension module (DbUnitExtension) for @ExtendWith-based lifecycle management; a new JSON dataset format (JsonDataSet/JsonProducer/JsonWriter); an opt-in all-column sort for tables without a primary key; an opt-in sort-on-filtered-columns-only mode for DefaultPrepAndExpectedTestCase fixing false failures on tables with a generated/identity first column; an optional DefaultPrepAndExpectedTestCase FailureHandler for collecting every mismatch instead of failing fast; MultiSchemaMySqlMetadataHandler for multi-schema MySQL connections; constructor-injected per-connection DatabaseConfig support for DataSourceDatabaseTester; new MariaDB support (MariaDbDataTypeFactory plus a Docker-backed IT profile); an opt-in cycle-check bypass (FEATURE_SKIP_CYCLE_CHECK) letting DatabaseSequenceFilter proceed on schemas with circular foreign-key references; and multiple bug fixes including escape-pattern handling, primary-key filter fallback, empty-dataset DTD export, DatabaseDataSet initialization order, and a from-scratch clean-build pass across Javadoc doclint, Checkstyle, and compiler warnings">
<action dev="jeffjensen" type="add" issue="840" system="github" due-to="jeffjensen">
Add repo-root README.adoc, rendered natively by GitHub via Asciidoctor, so the repository landing page shows a pitch, build/reproducible-build badges, a pointer to the "dbUnit in 5 Minutes" tutorial, and links to the documentation site, Maven coordinates, GitHub Discussions, and CONTRIBUTING.md instead of nothing.
</action>
Expand Down Expand Up @@ -245,6 +245,9 @@
<action dev="jeffjensen" type="fix" issue="496" system="github" due-to="zigarn">
Fix a flat XML/DTD table declared in the DTD but never appearing as a row element (a genuinely empty fixture table) being silently absent from the produced IDataSet: FlatXmlProducer only ever registered a table inside startElement()'s new-table handling, so a table with zero rows in a given fixture never entered the dataset at all, letting CLEAN_INSERT/DELETE_ALL skip it and risk a foreign-key violation against data a prior test left behind. FlatXmlProducer now cross-references every table name reported by the available metadata source (the parsed DTD, or an explicitly-supplied metadata IDataSet) against the tables actually encountered in the XML body once parsing finishes, and reports any still missing as an empty table using that source's column metadata. No-op, so behavior is unchanged, when no DTD or metadata dataset is available.
</action>
<action dev="jeffjensen" type="add" issue="501" system="github" due-to="jeffjensen">
Add DatabaseConfig.FEATURE_SKIP_CYCLE_CHECK, an opt-in escape hatch letting DatabaseSequenceFilter proceed on a schema with a foreign-key dependency cycle instead of unconditionally rejecting it with CyclicTablesDependencyException (issues 501 and 517: dbUnit could not order, and therefore could not CLEAN_INSERT/DELETE_ALL, tables bound together by circular FK references). This is the configurable cycle-breaking escape hatch issue 411 originally proposed rather than a full topological resolution of the cycle itself: DatabaseSequenceFilter.sortTableNames now collapses each cycle into a single strongly-connected-component unit for ordering purposes and logs a warning per cycle instead of throwing, so a table outside the cycle is still correctly ordered relative to it (e.g. a table with its own FK to a cyclic table still sorts after the whole cycle, not merely after whichever cyclic member happened to be placed) and every requested table is still returned exactly once; only the relative order of the tables making up the cycle itself is unresolved and falls back to their original input order, leaving the caller responsible for making the cycle insertable another way (e.g. nullable FK columns populated in a later operation, or database-side deferred constraint checking). Off by default, preserving the existing fail-fast behavior for callers who never touch it.
</action>
</release>
<release version="3.4.0" date="Jul 28, 2026" description="Test-suite hardening (un-skip and strengthen dozens of disabled/no-op tests); add CachingConnectionProvider and reduce DefaultPrepAndExpectedTestCase's per-test connection churn; pin identifier case-folding to Locale.ENGLISH for Turkish-locale correctness; and a broad set of correctness fixes across export formats (XML, YAML, CSV, XLS, Ant), TimestampDataType timezone handling, InsertOperation/TransactionOperation, and resource-leak cleanups">
<action dev="jeffjensen" type="fix" issue="797" system="github" due-to="jeffjensen">
Expand Down
14 changes: 13 additions & 1 deletion src/main/java/org/dbunit/database/DatabaseConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,15 @@ public class DatabaseConfig
/** Name of the feature controlling whether all columns are used for sorting when a table has no primary key. */
public static final String FEATURE_SORT_ALL_COLUMNS_WHEN_NO_PRIMARY_KEY =
"http://www.dbunit.org/features/sortAllColumnsWhenNoPrimaryKey";
/**
* Name of the feature controlling whether {@link DatabaseSequenceFilter} skips its
* foreign-key dependency cycle check instead of throwing
* {@link CyclicTablesDependencyException}. When enabled, tables involved in a cycle are
* appended in their original order and the resulting order is not guaranteed to respect
* foreign-key dependencies among them.
*/
public static final String FEATURE_SKIP_CYCLE_CHECK =
"http://www.dbunit.org/features/skipCycleCheck";

/**
* A list of all properties as {@link ConfigProperty} objects.
Expand All @@ -135,6 +144,7 @@ public class DatabaseConfig
new ConfigProperty(FEATURE_ALLOW_EMPTY_FIELDS, Boolean.class, false),
new ConfigProperty(PROPERTY_ALLOW_VERIFYTABLEDEFINITION_EXPECTEDTABLE_COUNT_MISMATCH, Boolean.class, false),
new ConfigProperty(FEATURE_SORT_ALL_COLUMNS_WHEN_NO_PRIMARY_KEY, Boolean.class, false),
new ConfigProperty(FEATURE_SKIP_CYCLE_CHECK, Boolean.class, false),
};

/**
Expand All @@ -148,7 +158,8 @@ public class DatabaseConfig
FEATURE_DATATYPE_WARNING,
FEATURE_SKIP_ORACLE_RECYCLEBIN_TABLES,
FEATURE_ALLOW_EMPTY_FIELDS,
FEATURE_SORT_ALL_COLUMNS_WHEN_NO_PRIMARY_KEY
FEATURE_SORT_ALL_COLUMNS_WHEN_NO_PRIMARY_KEY,
FEATURE_SKIP_CYCLE_CHECK
};

private static final DefaultDataTypeFactory DEFAULT_DATA_TYPE_FACTORY =
Expand Down Expand Up @@ -180,6 +191,7 @@ public DatabaseConfig()
setFeature(FEATURE_SKIP_ORACLE_RECYCLEBIN_TABLES, false);
setFeature(FEATURE_ALLOW_EMPTY_FIELDS, false);
setFeature(FEATURE_SORT_ALL_COLUMNS_WHEN_NO_PRIMARY_KEY, false);
setFeature(FEATURE_SKIP_CYCLE_CHECK, false);

setProperty(PROPERTY_STATEMENT_FACTORY, PREPARED_STATEMENT_FACTORY);
setProperty(PROPERTY_RESULTSET_TABLE_FACTORY, RESULT_SET_TABLE_FACTORY);
Expand Down
Loading
Loading