Annotation Type TestCaseInstanceProvider
Determines how instances of the test suite class are created for each test
case.
By default JUnit creates a new class instance for every test to prevent test
case ordering dependencies. This is sometimes inconvenient as there is no
"suite" context other than static fields (which are a nuisance to clean up
properly, for example). This annotation changes the default behavior and
permits the test cases to be executed on the same instance, for example.
Note that special care should be given to scenarios in which same-instance is
reused with arguments provided via
ParametersFactory
(each set of
parameters will create a separate instance, which will then be used to run
all of test suite's test cases).
Note that the same instance will be used if the test cases are multiplied
with Seeds
or Repeat
annotations.- See Also:
-
Nested Class Summary
Nested Classes -
Optional Element Summary
Optional Elements
-
Element Details
-
value
- Default:
INSTANCE_PER_TEST_METHOD
-