public abstract class GenericTests<T extends Number> {
protected abstract T getT();
@Test public void test1() {
getT();
}
}
public class ConcreteTests1 extends GenericTests<Integer> { ... }
public class ConcreteTests2 extends GenericTests<Double> { ... }
No tests are executed at all, both concrete classes are ignored. How do I make it work? (I expect test1()
to be executed for both Integer
and Double
).
I use JUnit 4.8.1.
Update: it appeared that problem is related with maven-surefire-plugin and not JUnit itself. See my answer below.
mvn clean test
. That works fine for other tests in the same package, the only difference is, these tests doesn't use inheritance. – GreaveNumber
instead ofB
. It's pretty minor detail, but yes, it should be more pedantic. I'll fix it. – Greave