-
Notifications
You must be signed in to change notification settings - Fork 100
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
PAXEXAM-674 Configurations and probe builders do not need to be static #45
base: master
Are you sure you want to change the base?
Conversation
Thanks for the patch - but we need some more info to apply it.
|
Hi. Thanks for the feedback. |
- Repair the parameterized runner for non-PerMethod strategies. - Add an integration test for parameterized PAX configurations. - Format the code with the right formatter.
Hi. I have updated my patch. FYI, the use case I wanted to cover works perfectly (PerMethod strategy in Karaf, with parameterized configuration). This use case is illustrated with a new integration test. And I formatted the code with the right formatter. However, I got some troubles with integration tests. |
OK. I thought about it recently, and I think I will submit a new runner for tests that use a parameterized OSGi configuration. It will only suit PerMethod strategies with a real container. It is much more simple than upgrading the existing Parameterized runner (which already covers several use cases). I will do it as soon as a I have some time. |
By default, JUnit parameterized tests with PAX Exam need static methods for configuration and probe builders. Notice that this is not mentioned in the documentation. When these methods are not static, you get a NullPointerException, as mentioned in PAXEXAM-674.
This patch allows to use non-static methods for configurations and probe builders.
The test class is instantiated with every configuration. And every test class instance comes with its own OSGi configuration.
This was tested with parameterized tests on Apache Karaf 4.0.2.
This patch also comes with support of custom names for parameterized tests (the name attribute of the Parameters annotation).
I asked for some feedback on JIRA, but nothing yet.
I hope more will come with this PR.