-
Notifications
You must be signed in to change notification settings - Fork 38.3k
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
Merge class-level and method-level @Sql declarations #1835
Conversation
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.
Please make the changes requested in comments.
In addition, please revert all changes to existing test classes. We need new, separate test classes in order to properly test the new feature while ensuring 100% backwards compatibility for existing code bases.
When introducing the new tests, please add some inline comments explaining why you have chosen to drop the schema if that was not done in the existing tests.
Thanks!
...est/src/main/java/org/springframework/test/context/jdbc/SqlScriptsTestExecutionListener.java
Outdated
Show resolved
Hide resolved
...-test/src/test/java/org/springframework/test/context/jdbc/DataSourceOnlySqlScriptsTests.java
Outdated
Show resolved
Hide resolved
...est/src/test/java/org/springframework/test/context/jdbc/NonTransactionalSqlScriptsTests.java
Outdated
Show resolved
Hide resolved
.../test/java/org/springframework/test/context/jdbc/RepeatableSqlAnnotationSqlScriptsTests.java
Outdated
Show resolved
Hide resolved
This code is looking good, can't wait to use it! |
@asympro, what's the status of your work on this? |
Tests are failing, will try to finish coding next week.
2018-08-03 17:20 GMT+03:00 Sam Brannen <[email protected]>:
… @asympro <https://github.com/asympro>, what's the status of your work on
this?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1835 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACe9rjNdYVJ7vytTVJ5XhMFdwOAvl8Umks5uNFw4gaJpZM4UN_O3>
.
|
OK. thanks for the feedback |
Should be finished now, please review. |
Tests are looking good I think. What do you think @sbrannen? |
I'm reviewing it locally now. |
Current work on this PR can be viewed in the following feature branch. https://github.com/sbrannen/spring-framework/commits/issues/gh-1835-merge-sql-annotations |
In my latest commit on the aforementioned feature branch, I've moved the merge mode configuration to a dedicated @asympro, feel free to chime in if you like. Otherwise, I'll take it from here. |
@sbrannen, I have looked through your work in the branch and it looks good. What can I do further to provide progress on the feature? |
Thanks for the feedback.
Your feedback was enough. I'll take it from here. |
Prior to these commits method-level @Sql declarations always overrode class-level @Sql declarations, which required developers to redeclare class-level @Sql declarations on test methods (e.g., via copy-and-paste) in order to combine them with method-level @Sql declarations. These commits provide developers the ability to optionally merge class-level and method-level @Sql declarations via a new @SqlMergeMode annotation that can be applied at the class level or method level, with method-level declarations of @SqlMergeMode overriding class-level declarations. For example, @SqlMergeMode(MERGE) switches from the default OVERRIDE behavior to merging behavior, with class-level SQL scripts and statements executed before method-level SQL scripts and statements. Closes gh-1835
@sbrannen the pleasure is mine. Thanks for the reviews and polishing to a better solution! |
Pull request for #20570