You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 3, 2023. It is now read-only.
Currently, @BeforeClass methods get invoked once for the test class and then again every time a new Class Parameter combination gets tested the first time.
The code below will result in a sequence of messages like:
As can be seen, the @BeforeClass annotated method gets invoked multiple times.
My test methods need some resources that are read only and thus can be shared. However, it takes multiple seconds to create these, so I'd like to initialize them once for the entire test class.
I propose, BeforeClass should be called once for every test class, not for every new combination of Class Parameters. This is how JUnit's Parameterized Class does it as well.
Also, it would be great to have a new annotation that can be used to invoke a method every time a new Class Parameter combination is created, just like @BeforeClass does now, but give it access to the newly created Class Parameter combination, so that it can be used to do a one time setup and teardown for each Class Parameter combination.
I propose, BeforeClass should be called once for every test class, not for every new combination of Class Parameters. This is how JUnit's Parameterized Class does it as well.
Currently, @BeforeClass methods get invoked once for the test class and then again every time a new Class Parameter combination gets tested the first time.
The code below will result in a sequence of messages like:
As can be seen, the @BeforeClass annotated method gets invoked multiple times.
My test methods need some resources that are read only and thus can be shared. However, it takes multiple seconds to create these, so I'd like to initialize them once for the entire test class.
I propose, BeforeClass should be called once for every test class, not for every new combination of Class Parameters. This is how JUnit's Parameterized Class does it as well.
Also, it would be great to have a new annotation that can be used to invoke a method every time a new Class Parameter combination is created, just like @BeforeClass does now, but give it access to the newly created Class Parameter combination, so that it can be used to do a one time setup and teardown for each Class Parameter combination.
Example Code:
The text was updated successfully, but these errors were encountered: