Skip to content

Conversation

@sfodje
Copy link

@sfodje sfodje commented Apr 15, 2020

This is in response to issue #2232


public SELF withInitScript(String initScriptPath) {
this.initScriptPath = initScriptPath;
public SELF withInitScript(String... initScriptPath) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this breaks binary compatibility. Please make sure that the old method (withInitScript(String)) works as before

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @bsideup,
Thanks for your feedback.
I've merged some changes from @jbek7 into this pull request that introduces a separate method withMultiInitScript to accept multiple sql files.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sfodje @bsideup
thanks.

return withMultiInitScript(initScriptPath);
}

public SELF withMultiInitScript(String... initScriptPaths) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a thought but... If the parameters were String, String... couldn't we keep the original method name and avoid problems with overloading/binary incompatibility? 🤔

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had the same thought, but assumed the purpose was to keep the API visually and functionally the same. Now that you raise it up, it is a good question. The previous iteration was a lot simpler and less complicated.

* @param initScriptPaths the resources to load the init scripts from
*/
public static void runInitScript(DatabaseDelegate databaseDelegate, String initScriptPath) {
public static void runMultiInitScript(DatabaseDelegate databaseDelegate, String... initScriptPaths) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need such big changes to ScriptUtils for this? It looks like this other PR has a simpler approach, and I can't see why that wouldn't work...

@jmandal0907
Copy link

jmandal0907 commented May 14, 2020

Hello @rnorth / @bsideup /@kiview,
I tried to overcome this issue by overriding runInitScriptIfRequired of JdbcDatabaseContainer class for supporting multiple script files, Invoking ScriptUtils.runInitScript() for each script file. It worked locally but failed in CI Jenkins with error not able to create JDBC connection. However, for single file it worked in CI also. Any update on this ticket?

@stale
Copy link

stale bot commented Aug 15, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you believe this is a mistake, please reply to this comment to keep it open. If there isn't one already, a PR to fix or at least reproduce the problem in a test case will always help us get back on track to tackle this.

@stale stale bot added the stale label Aug 15, 2020
@stale
Copy link

stale bot commented Aug 29, 2020

This issue has been automatically closed due to inactivity. We apologise if this is still an active problem for you, and would ask you to re-open the issue if this is the case.

@stale stale bot closed this Aug 29, 2020
savinov added a commit to savinov/testcontainers-java that referenced this pull request Oct 18, 2023
savinov added a commit to savinov/testcontainers-java that referenced this pull request Oct 19, 2023
savinov added a commit to savinov/testcontainers-java that referenced this pull request Jan 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants