@TestExecutionListeners({ FirstTel.class, SecondTel.class, ThirdTel.class }) private static class ExampleTestCase { @SuppressWarnings("unused") public void exampleTestMethod() { } }
boolean inheritListeners = testExecutionListeners.inheritListeners(); AnnotationDescriptor<TestExecutionListeners> superDescriptor = MetaAnnotationUtils.findAnnotationDescriptor( testExecutionListeners.mergeMode() == MergeMode.MERGE_WITH_DEFAULTS) { if (logger.isDebugEnabled()) { logger.debug(String.format("Merging default listeners with listeners configured via " + classesList.addAll(0, Arrays.asList(testExecutionListeners.listeners()));
boolean inheritListeners = testExecutionListeners.inheritListeners(); AnnotationDescriptor<TestExecutionListeners> superDescriptor = MetaAnnotationUtils.findAnnotationDescriptor( testExecutionListeners.mergeMode() == MergeMode.MERGE_WITH_DEFAULTS) { if (logger.isDebugEnabled()) { logger.debug(String.format("Merging default listeners with listeners configured via " + classesList.addAll(0, Arrays.asList(testExecutionListeners.listeners()));
@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(AlwaysFailingAfterTestExecutionTestExecutionListener.class) public static class AlwaysFailingAfterTestExecutionTestCase extends BaseTestCase { }
@TestExecutionListeners(QuuxTestExecutionListener.class) static class InheritedListenersTestCase extends ExplicitListenersTestCase { }
@TestExecutionListeners(listeners = QuuxTestExecutionListener.class, inheritListeners = false) static class NonInheritedListenersTestCase extends InheritedListenersTestCase { }
@TestExecutionListeners({ FailingAfterTestClassListener1.class, FailingAfterTestClassListener2.class }) private static class FailingAfterTestClassTestCase { }
@TestExecutionListeners(AlwaysFailingBeforeTestClassTestExecutionListener.class) static class AlwaysFailingBeforeTestClassTestCase extends BaseTestCase { }
@TestExecutionListeners(AlwaysFailingAfterTestClassTestExecutionListener.class) public static class AlwaysFailingAfterTestClassTestCase extends BaseTestCase { }
@TestExecutionListeners(AlwaysFailingBeforeTestMethodTestExecutionListener.class) public static class AlwaysFailingBeforeTestMethodTestCase extends BaseTestCase { }
@TestExecutionListeners(AlwaysFailingBeforeTestExecutionTestExecutionListener.class) static class AlwaysFailingBeforeTestExecutionTestCase extends BaseTestCase { }
@TestExecutionListeners(AlwaysFailingBeforeTestExecutionTestExecutionListener.class) public static class AlwaysFailingBeforeTestExecutionTestCase extends BaseTestCase { }
@TestExecutionListeners({ FooTestExecutionListener.class, BarTestExecutionListener.class }) interface ExplicitListenersTestInterface { }
@TestExecutionListeners(AlwaysFailingPrepareTestInstanceTestExecutionListener.class) static class AlwaysFailingPrepareTestInstanceTestCase extends BaseTestCase { }
@TestExecutionListeners(AlwaysFailingBeforeTestMethodTestExecutionListener.class) static class AlwaysFailingBeforeTestMethodTestCase extends BaseTestCase { }
@TestExecutionListeners(AlwaysFailingAfterTestMethodTestExecutionListener.class) public static class AlwaysFailingAfterTestMethodTestCase extends BaseTestCase { }