I have implemented JUnit in my project. I found couple of good features using org.junit.experimental.theories.Theories.
One of the advantage is I could very well separate the data and test case.
JUnit version 4.12
Now the question is these classes are part of 'experimental' package. Does it mean in future releases this feature may not be available? [This question may not be the right kind of question for SO, however it is a decision point for the solution]
Thank you.
The Theories runner allows to test a certain functionality against a subset of an infinite set of data points. A Theory is a piece of functionality (a method) that is executed against several data inputs called data points.
org.junit If you allocate external resources in a Before method you need to release them after the test runs. Annotating a public void method with @After causes that method to be run after the Test method. All @After methods are guaranteed to run even if a Before or Test method throws an exception.
Class Categories. From a given set of test classes, runs only the classes and methods that are annotated with either the category given with the @IncludeCategory annotation, or a subtype of that category. Note that, for now, annotating suites with @Category has no effect.
For me it's a good question. As the FAQ and the Wiki of JUnit do not explicitely mention the experimental
package. For Theories
they are part at least since five years (maybe longer). So I would not expect that this feature would disappear. What might happen is that the API for those package changes.
edit At least in the JUnit 5 user guide there is a similar annotation mentioned (@API(Experimental)).
Experimental Intended for new, experimental features where we are looking for feedback. Use this element with caution; it might be promoted to Maintained or Stable in the future, but might also be removed without prior notice, even in a patch.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With