-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Combine db tests #242
Combine db tests #242
Conversation
…r refactoring of common elements.
Adopt MySQL and MariaDB default configuration with lighter resource requirements
2f9a146
to
fd6542c
Compare
public static Iterable<Object[]> data() { | ||
return asList( | ||
new Object[][]{ | ||
{"jdbc:tc:mysql:5.5.43://hostname/databasename", false, false, false}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
awesome!
}); | ||
} | ||
|
||
@Parameterized.Parameter(0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe static import Parameter
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Definitely - will do.
new QueryRunner(dataSource).query("SELECT foo FROM bar WHERE foo LIKE '%world'", (ResultSetHandler<Object>) rs -> { | ||
rs.next(); | ||
String resultSetString = rs.getString(1); | ||
assertEquals("A basic SELECT query succeeds where the schema has been applied from a script", "hello world", resultSetString); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm just wondering what if ResultSetHandler will not be called.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well spotted - will address that!
assertEquals("A basic SELECT query succeeds where the schema has been applied from a script", "hello world", resultSetString); | ||
return true; | ||
}); | ||
dataSource.close(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
HikariDataSource is AutoClosable, you can use try-with-resources
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do
…o enable them to be volume mounted into containers.
…path resources that have been extracted from JAR files.
|
||
<dependency> | ||
<groupId>com.googlecode.junit-toolbox</groupId> | ||
<artifactId>junit-toolbox</artifactId> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will remove
As this PR is completely included in #243 but doesn't include some bugfixes that are in the other PR, I'm going to close this one. Seems more straightforward that way. |
This change relocates all (non-proprietary) DB tests into a single module, to reduce the amount of boilerplate. It is envisaged that we can clean up these tests further going forward.
Additionally this PR includes changes to reduce the initial memory consumption of MySQL and MariaDB containers for reliability reasons.