Skip to content
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

Introduce class-level execution phases for @Sql [SPR-14357] #18929

Closed
spring-projects-issues opened this issue Jun 13, 2016 · 8 comments
Closed
Labels
in: test Issues in the test module status: superseded An issue that has been superseded by another type: enhancement A general enhancement

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Jun 13, 2016

urbanq opened SPR-14357 and commented

It would be helpful to introduce class-level support in the ExecutionPhase enum used by @Sql: BEFORE_CLASS and AFTER_CLASS.

So when executing integration test we can easily run one single SQL script for all test methods in the test class.


Affects: 4.2.6

Reference URL: https://stackoverflow.com/questions/32871817/using-annotation-sql-is-it-possible-to-execute-scripts-in-class-level-before-m

Issue Links:

4 votes, 5 watchers

@spring-projects-issues
Copy link
Collaborator Author

Semukhin Dmitry commented

Proposal

Introduce additional BEFORE_TEST_CLASS and AFTER_TEST_CLASS enum constants in Sql.ExecutionPhase and override the beforeTestClass() and afterTestClass() methods in SqlScriptsTestExecutionListener with corresponding invocations of executeSqlScripts(...) - for example:

public void beforeTestClass(TestContext testContext) throws Exception {
    executeSqlScripts(testContext, ExecutionPhase.BEFORE_TEST_CLASS);
}

The implementation of afterTestClass() would be analogous to the above.

Sam Brannen, please share your thoughts on the plan if you have time for that.

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented May 25, 2018

Semukhin Dmitry commented

Actually issue #20570 should be marked not as "relates to" but rather "blocked by"

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Jun 2, 2018

Sam Brannen commented

In what way do you foresee that it is blocked?

@spring-projects-issues
Copy link
Collaborator Author

Sam Brannen commented

FYI: I took the liberty to edit your comments/proposal.

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Jun 2, 2018

Sam Brannen commented

Sam Brannen, please share your thoughts on the plan if you have time for that.

I think the general idea sounds fine.

The main issue I see is coming up with a compelling story for implementing both #20570 and #18929, and if we implement both we will then need to test use cases that combine the two (i.e., in order to verify that they work together in harmony and whether or not it makes sense to implement both).

So I would appreciate it if you could document that story as you see it.

@aahlenst
Copy link
Contributor

@sbrannen I opened #27285 to get the ball rolling. Please let me know what you think and what I could do to improve the PR (like adding more tests).

@juzunoglu
Copy link

Is this still being implemented?

@sbrannen sbrannen changed the title Introduce class-level execution phases for @Sql [SPR-14357] Introduce class-level execution phases for @Sql [SPR-14357] Sep 16, 2023
@sbrannen sbrannen linked a pull request Sep 16, 2023 that will close this issue
@sbrannen
Copy link
Member

@sbrannen sbrannen closed this as not planned Won't fix, can't repro, duplicate, stale Sep 16, 2023
@sbrannen sbrannen removed this from the General Backlog milestone Sep 16, 2023
@sbrannen sbrannen removed their assignment Sep 16, 2023
@sbrannen sbrannen added the status: superseded An issue that has been superseded by another label Sep 16, 2023
aahlenst added a commit to aahlenst/spring-framework that referenced this issue Sep 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: test Issues in the test module status: superseded An issue that has been superseded by another type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants