junit4 icon indicating copy to clipboard operation
junit4 copied to clipboard

Move test class validation aside

Open ydewit opened this issue 14 years ago • 12 comments

I am extending ParentRunner<?> with my own implementation using DI and the single constructor check is getting in the way:

    public TestClass(Class> klass) {
        fClass= klass;
        if (klass != null && klass.getConstructors().length > 1)
            throw new IllegalArgumentException(
                    "Test class can only have one constructor");

Could this be moved aside to a protected validateXXX method or even move it up to BlockJUnit4ClassRunner?

ydewit avatar Aug 20 '11 19:08 ydewit