|
43 | 43 |
|
44 | 44 | import org.junit.jupiter.api.Assertions;
|
45 | 45 | import org.junit.jupiter.api.BeforeAll;
|
| 46 | +import org.junit.jupiter.api.Test; |
46 | 47 | import org.junit.jupiter.params.ParameterizedTest;
|
47 | 48 | import org.junit.jupiter.params.provider.Arguments;
|
48 | 49 | import org.junit.jupiter.params.provider.MethodSource;
|
|
52 | 53 |
|
53 | 54 | public class AbstractParentClassTests {
|
54 | 55 |
|
| 56 | + public static class OuterClass { |
| 57 | + @Test |
| 58 | + protected void test() { |
| 59 | + Assertions.assertTrue(true, "Just a dummy test that should be executed in outer class"); |
| 60 | + } |
| 61 | + |
| 62 | + /* Since at org.graalvm.junit.platform.JUnitPlatformFeature#registerTestClassForReflection we register all |
| 63 | + * declared classes and superclass of the test class, and we do so recursively, we want to avoid infinite loop. |
| 64 | + * This inheritance shows that we won't call registration of these classes indefinitely (call registration of |
| 65 | + * all declared classes of AbstractParentClassTests, then recursively call superclass of InfiniteLoopTest and |
| 66 | + * repeat the process indefinitely) */ |
| 67 | + private class InfiniteLoopTest extends OuterClass { |
| 68 | + @Test |
| 69 | + protected void test() { |
| 70 | + Assertions.assertTrue(true, "Just a dummy test that should be executed in inner class"); |
| 71 | + } |
| 72 | + } |
| 73 | + |
| 74 | + /* Since enum here is declared class of AbstractParentClassTests, we want to avoid registrations of |
| 75 | + * enum's internal superclasses and sub-classes at org.graalvm.junit.platform.JUnitPlatformFeature#registerTestClassForReflection */ |
| 76 | + private enum EnumTest { |
| 77 | + SOME_VALUE, |
| 78 | + OTHER_VALUE |
| 79 | + } |
| 80 | + } |
| 81 | + |
55 | 82 | public abstract static class MathPowerTests {
|
56 | 83 | protected static BiFunction<Integer, Integer, Integer> powFunction;
|
57 | 84 |
|
|
0 commit comments