From 228588a87cb519c36ba2f94d8aeb67a873336057 Mon Sep 17 00:00:00 2001 From: Simon Ogorodnik Date: Tue, 3 Oct 2017 15:45:36 +0300 Subject: [PATCH] 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 --- .../jetbrains/kotlin/test/util/TestExecutedOnlyOnceTest.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/compiler/tests/org/jetbrains/kotlin/test/util/TestExecutedOnlyOnceTest.java b/compiler/tests/org/jetbrains/kotlin/test/util/TestExecutedOnlyOnceTest.java index c3729cb2d04..94c174b28d4 100644 --- a/compiler/tests/org/jetbrains/kotlin/test/util/TestExecutedOnlyOnceTest.java +++ b/compiler/tests/org/jetbrains/kotlin/test/util/TestExecutedOnlyOnceTest.java @@ -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;