classpathsuite

JUnit: (possibly indirectly) contains itself as a SuiteClass

匆匆过客 提交于 2019-12-02 03:44:26
问题 I want to add a subtest, FailingIO, to FailingTest while inheriting the parent's useful methods @RunWith(Suite.class) @Suite.SuiteClasses({FailingTest.FailingIO.class}) class FailingTest { @Test test1() {} static class FailingIO extends FailingTest { I am getting JUnit: (possibly indirectly) contains itself as a SuiteClass because the annotations are also inherited, I guess. Is there a way to inherit only the methods and leave the annotations to the parent? I see in Eclipse that Suite

JUnit: (possibly indirectly) contains itself as a SuiteClass

折月煮酒 提交于 2019-12-01 22:45:59
I want to add a subtest, FailingIO, to FailingTest while inheriting the parent's useful methods @RunWith(Suite.class) @Suite.SuiteClasses({FailingTest.FailingIO.class}) class FailingTest { @Test test1() {} static class FailingIO extends FailingTest { I am getting JUnit: (possibly indirectly) contains itself as a SuiteClass because the annotations are also inherited, I guess. Is there a way to inherit only the methods and leave the annotations to the parent? I see in Eclipse that Suite.SuiteClasses has the @Inherited but JUnit API has not such attribute. What is going on? What is the JUnit