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:
@@ -30,6 +30,7 @@ public class TestExecutedOnlyOnceTest extends TestCase {
|
|||||||
testA = true;
|
testA = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@RunWith(JUnit3RunnerWithInners.class)
|
||||||
public static class InnerTest extends TestCase {
|
public static class InnerTest extends TestCase {
|
||||||
private static boolean testB;
|
private static boolean testB;
|
||||||
private static boolean testC;
|
private static boolean testC;
|
||||||
@@ -44,8 +45,10 @@ public class TestExecutedOnlyOnceTest extends TestCase {
|
|||||||
testC = true;
|
testC = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@RunWith(JUnit3RunnerWithInners.class)
|
||||||
public static class InnerInnerTest extends TestCase {
|
public static class InnerInnerTest extends TestCase {
|
||||||
|
|
||||||
|
@RunWith(JUnit3RunnerWithInners.class)
|
||||||
public static class InnerInnerInnerTest extends TestCase {
|
public static class InnerInnerInnerTest extends TestCase {
|
||||||
private static boolean testD;
|
private static boolean testD;
|
||||||
private static boolean testE;
|
private static boolean testE;
|
||||||
|
|||||||
Reference in New Issue
Block a user