Simple JUnit runner allowing you to dynamically generate tests with human readable names. This can be pretty convenient for adding customer generated test data into your test suites.
Btw, as far as I can tell, doing these things will be easier with JUnit 5.
package com.github.kimble;
import com.github.kimble.FactoryRunner;
@RunWith(FactoryRunner.class)
public class TestFactoryRunnerTest implements FactoryRunner.Producer {
@Override
public void produceTests(FactoryRunner.TestConsumer tc) throws Throwable {
for (int i=0; i<10; i++) {
final int number = i;
final String name = String.format("Test %d", number);
tc.accept(name, () -> {
System.out.println("This is test #" + number);
});
}
}
}
Dynamically generated tests shows up as expected in html reports generated by Gradle.
The same is true for Intellij, although you will not be able to re-run / debug a single test as you're used to.