DBUnit escape pattern on multiple database tests
See original GitHub issueI have my tests on multiple databases (H2, PostgreSQL, MariaDB), and I want to use an escape pattern specific to the database test currently running. Here is my test configuration:
@DBRider
@DBUnit(caseSensitiveTableNames = true, escapePattern = "\"")
@SpringJUnitConfig(RepositoryTestBase.Config.class)
public abstract class RepositoryTestBase {
@Configuration
public static class Config {
}
}
The test classes will extend the abstract class above and be annotated with @DataSet
for the sample data. On the class above, I use escape pattern "
which works for H2 and PostgreSQL, while on MariaDB I get SQL syntax error below for table name path
:
org.mariadb.jdbc.internal.util.exceptions.MariaDbSqlException: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '"path"' at line 1
What is the best way to make it possible to set escape pattern on multiple database tests? Thank you.
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
[dbunit-user] Specifying escape pattern for DatabaseTestCase
We've got some columns in our MSSQL database that have spaces in the names (like "Client ID"). When using the dbunit ant task,...
Read more >Configurable Features and Properties - DBUnit
Allows schema, table and column names escaping. The property value is an escape pattern where the ? is replaced by the name. For...
Read more >Escaping reserved database keywords with spring-test-dbunit
From Expoting Dataset to a xml file giving error in DBunit, I see that this can be done in dbunit by setting a...
Read more >DbUnit - Configurable Features and Properties
Escape pattern ; Default, none ; Description, Allows schema, table and column names escaping. The property value is an escape pattern where the...
Read more >1.9.1 - Database Rider Documentation
2. Seeding database. In order to insert data into database before test execution. As a developer. I want to easily use DBUnit in...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The fix for this issue is available on v
1.28.0
which was just released, thank you for the contribution @muhammadkholidb!Nice, I’ll create a PR for that. Thank you