We are using our custom test runner, that extend ParentRunner:
public class OurTestRunner extends ParentRunner<TestRunnerForOneConfigCase> {...}
class TestRunnerForOneConfigCase extends BlockJUnit4ClassRunner {...}
Inspired by how to combine @RunWith with @RunWith(Parameterized.class), I would like to use OurTestRunner
with test parameters. So I am trying to implement the factory:
public class OurTestRunnerFactory implements ParametersRunnerFactory {
@Override
public org.junit.runner.Runner createRunnerForTestWithParameters(TestWithParameters test) throws InitializationError {
return new OurTestRunner(test /* but it takes Class<T> as parameter */);
}
}
However, OurTestRunner
and the its parent class ParentRunner
take only the Class<T>
as parameter, and not TestWithParameters
(i.e. it doesn't take the parameters).
Is there a version of ParentRunner
that is compatible with Parameterized
? If not, what is the easiest way to extend our setup (without rewriting everything)?