-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Description
The execution model for @Theory
-based tests is virtually tailor-made for generative testing: you take some parameters and assert an invariant over them. However, based on my reading of the current Javadoc, all data points have to be known up front. They can still technically be generated if you use a @DataPoints
-annotated factory method, but this results in all of the randomly generated test data being buffered in memory up-front.
My hunch is that this limitation can be traced back to one of the many, many limitations of the JUnit execution model (maybe it's unacceptable to not know all the test methods/cases up front?). If not, however, it would be really nice if an Iterator<T>
(or Iterable<T>
) could be returned from a @DataPoints
method, rather than just an array.