Fix TestExecutedOnlyOnceTest by properly setting RunWith

When test contains nested test classes
Both root and nested classes should be annotated with
`@RunWith(JUnit3RunnerWithInners.class)`
to avoid running tests twice
This commit is contained in:
Simon Ogorodnik
2017-10-03 15:45:36 +03:00
parent 289b0862a7
commit 228588a87c
@@ -30,6 +30,7 @@ public class TestExecutedOnlyOnceTest extends TestCase {
testA = true;
}
@RunWith(JUnit3RunnerWithInners.class)
public static class InnerTest extends TestCase {
private static boolean testB;
private static boolean testC;
@@ -44,8 +45,10 @@ public class TestExecutedOnlyOnceTest extends TestCase {
testC = true;
}
@RunWith(JUnit3RunnerWithInners.class)
public static class InnerInnerTest extends TestCase {
@RunWith(JUnit3RunnerWithInners.class)
public static class InnerInnerInnerTest extends TestCase {
private static boolean testD;
private static boolean testE;