-
Notifications
You must be signed in to change notification settings - Fork 38.5k
Introduce mechanism for automatic discovery of default TestExecutionListeners [SPR-11466] #16092
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
Comments
Sam Brannen commented Since this issue contains two proposals, the first of which duplicates #13496, I will revise the summary and description to address only the second proposal. |
Sam Brannen commented Can you please expound on your thoughts for how such an auto-discovery SPI might work (e.g., properties file in a well known location in the classpath, or...)? Thanks, Sam p.s. why do you have two JIRA accounts: |
Rob Winch commented I am not too particular how it is implemented so long as Spring Security can automatically register a TestExecutionLitener. I was thinking a properties file to stay consistent with the way the Custom XML namespace handlers are implemented, but again I am not particular. I'm not sure how I ended up with two usernames. I don't think I am able to do a merge of the users. |
Rob Winch commented Another example of adding an additional TestExecutionListener is in Spring Test HtmlUnit to update the HtmlDriver in a Geb test. Keep in mind this is still milestone code, but it might help provide another example. I believe the current thought is this may end up in spring-test as another optional package eventually. This means the adding of the TestExecutionListener might need to be based on the classpath. For an example of using it, see https://github.com/spring-projects/spring-test-mvc-htmlunit/blob/master/mail-webapp/src/test/groovy/org/springframework/test/web/servlet/htmlunit/geb/MockMvcCreateMessagesSpec.groovy |
Sam Brannen commented I've just pushed working code to my repo: https://github.com/sbrannen/spring-framework/commits/SPR-11466 In summary, the TCF now loads default Please check it out ASAP and let me know if you that suits your needs, and then we can hopefully get it into Spring Framework 4.1 RC2 (which is eminent). ;) Cheers, Sam |
Sam Brannen commented Update: this feature now makes use of the Properties-based |
Sam Brannen commented Implemented as described in the comments for GitHub commit e6d1614:
|
Rob Winch opened SPR-11466 and commented
Overview
It would be nice if there were a way for a custom
TestExecutionListener
to register itself as a defaultTestExecutionListener
.This will be very valuable for the Spring Security test module that is currently in development.
Proposal
One idea might be to allow using an SPI discovery of the
TestExecutionListener
default implementations. Each defaultTestExecutionListener
could declare an@Order
annotation to ensure that they are run in the correct order.Affects: 3.0 GA
Issue Links:
@TestExecutionListeners
Referenced from: commits 66250b1, e753f23, e6d1614
The text was updated successfully, but these errors were encountered: