@TestExecutionListeners({ FirstTel.class, SecondTel.class, ThirdTel.class }) private static class ExampleTestCase { @SuppressWarnings("unused") public void exampleTestMethod() { } }
@TestExecutionListeners(inheritListeners = false) public static abstract class BaseTestCase extends AbstractTestNGSpringContextTests { @org.testng.annotations.Test public void testNothing() { } }
@TestExecutionListeners( listeners = {QuuxTestExecutionListener.class, DependencyInjectionTestExecutionListener.class}, mergeMode = MERGE_WITH_DEFAULTS) static class MergedDefaultListenersWithCustomListenerPrependedTestCase { }
@TestExecutionListeners({}) public abstract static class AbstractRepeatedTestCase { protected void incrementInvocationCount() throws IOException { invocationCount.incrementAndGet(); } }
@TestExecutionListeners( {FooTestExecutionListener.class, BarTestExecutionListener.class, BazTestExecutionListener.class}) static class ExplicitListenersTestCase { }
@TestExecutionListeners({ FailingAfterTestClassListener1.class, FailingAfterTestClassListener2.class }) private static class FailingAfterTestClassTestCase { }
@Ignore("TestCase classes are run manually by the enclosing test class") @TestExecutionListeners({}) public static final class ExpectedExceptionSpringRunnerTestCase { // Should Pass. @Test(expected = IndexOutOfBoundsException.class) public void verifyJUnitExpectedException() { new ArrayList<>().get(1); } }
@Ignore("TestCase classes are run manually by the enclosing test class") @TestExecutionListeners(AlwaysFailingPrepareTestInstanceTestExecutionListener.class) public static class AlwaysFailingPrepareTestInstanceTestCase extends BaseTestCase { }
@Ignore("TestCase classes are run manually by the enclosing test class") @TestExecutionListeners(AlwaysFailingAfterTestClassTestExecutionListener.class) public static class AlwaysFailingAfterTestClassSpringRuleTestCase extends BaseSpringRuleTestCase { }
@Ignore("TestCase classes are run manually by the enclosing test class") @TestExecutionListeners(AlwaysFailingAfterTestExecutionTestExecutionListener.class) public static class AlwaysFailingAfterTestExecutionTestCase extends BaseTestCase { }
@Ignore("TestCase classes are run manually by the enclosing test class") @TestExecutionListeners(AlwaysFailingAfterTestMethodTestExecutionListener.class) public static class AlwaysFailingAfterTestMethodTestCase extends BaseTestCase { }
@Ignore("TestCase classes are run manually by the enclosing test class") @TestExecutionListeners(AlwaysFailingPrepareTestInstanceTestExecutionListener.class) public static class AlwaysFailingPrepareTestInstanceSpringRuleTestCase extends BaseSpringRuleTestCase { }
@Ignore("TestCase classes are run manually by the enclosing test class") @TestExecutionListeners(AlwaysFailingBeforeTestMethodTestExecutionListener.class) public static class AlwaysFailingBeforeTestMethodSpringRuleTestCase extends BaseSpringRuleTestCase { }
@Ignore("TestCase classes are run manually by the enclosing test class") @TestExecutionListeners(AlwaysFailingAfterTestMethodTestExecutionListener.class) public static class AlwaysFailingAfterTestMethodSpringRuleTestCase extends BaseSpringRuleTestCase { }
@Ignore("TestCase classes are run manually by the enclosing test class") @TestExecutionListeners(AlwaysFailingBeforeTestClassTestExecutionListener.class) public static class AlwaysFailingBeforeTestClassTestCase extends BaseTestCase { }
@Ignore("TestCase classes are run manually by the enclosing test class") @TestExecutionListeners(AlwaysFailingAfterTestClassTestExecutionListener.class) public static class AlwaysFailingAfterTestClassTestCase extends BaseTestCase { }
@Ignore("TestCase classes are run manually by the enclosing test class") @TestExecutionListeners(AlwaysFailingBeforeTestExecutionTestExecutionListener.class) public static class AlwaysFailingBeforeTestExecutionTestCase extends BaseTestCase { }
@Ignore("TestCase classes are run manually by the enclosing test class") @TestExecutionListeners(AlwaysFailingBeforeTestClassTestExecutionListener.class) public static class AlwaysFailingBeforeTestClassSpringRuleTestCase extends BaseSpringRuleTestCase { }
@Ignore("TestCase classes are run manually by the enclosing test class") @TestExecutionListeners(AlwaysFailingBeforeTestMethodTestExecutionListener.class) public static class AlwaysFailingBeforeTestMethodTestCase extends BaseTestCase { }
@TestExecutionListeners({}) public abstract static class AbstractRepeatedTestCase { @ClassRule public static final SpringClassRule springClassRule = new SpringClassRule(); @Rule public final SpringMethodRule springMethodRule = new SpringMethodRule(); protected void incrementInvocationCount() throws IOException { invocationCount.incrementAndGet(); } }