-
Notifications
You must be signed in to change notification settings - Fork 150
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
Parameters on BeforeClass #85
Comments
Update: I digged a bit more and faced a This happened while trying to pass params to |
JUnitParams supports parameterization only of test methods.
In your case I would suggest to creata a method that provides all the parameters (file names) and use it in your BeforeClass preparation and as a parameters provider for tests. |
I get this, but the issue is if I do this, then all of my tests will repeat the file processing which can be just done at a class(or instance) level. That is why I was initializing members in Anyway, I guess that is by JUnit's design, I'd have to try something else. Thanks. |
Maybe this snippet will help you
EDIT: this snippet won't work - |
Thanks, I'm doing something similar to this. I assume you mean |
There's one issue, though. According to your snippet, |
Oh right. Sorry, but you will have to try a different approach. |
I thought so. For now I'm just using indexes instead of actual objects and initializing them in |
Current Scenario: I initialize some variables in
BeforeClass
method and keep them as members. Since, I do some processing on files, to optimize tests, I just do them once in the@BeforeClass
method, and have asserts in different tests.Requirement: I want to test multiple files, and hence was thinking may be there is some way I can call BeforeClass with each file and call all of the tests again with the new members.
Is there any way to do this? Maybe some class level params?
The text was updated successfully, but these errors were encountered: