@Listeners(DataProviderInfoProvider.class) public class InstanceBasedDataProviderWithListenerAnnotationSample { @Test(dataProvider = "getData") public void testMethod(int i) { Assert.assertTrue(i > 0); } @DataProvider public Object[][] getData() { return new Object[][] {{1}, {2}}; } }
@Listeners(HookListener.class) public class HookSuccessWithListenerTest { @Test public void verify() { Assert.assertTrue(HookListener.m_hook); } }
@Listeners(SuiteListener2.class) public class SuiteListenerSample2 { @Test public void foo(){} }
@Listeners(SimpleDataProviderWithListenerAnnotationSample1.class) public class SimpleDataProviderWithListenerAnnotationSample1 extends LocalDataProviderListener { @Test(dataProvider = "getData") public void testMethod(int i) { Assert.assertTrue(i > 0); } @DataProvider public Object[][] getData() { return new Object[][] {{1}, {2}}; } }
@Listeners(L2.class) public class AggregateSampleTest extends BaseAggregate { static int m_count = 0; static public void incrementCount() { m_count++; } @Test public void f() { } }
@Listeners (ListenerFor956.class) public static class FirstTestClass { @Test public void testMethod() { Assert.assertEquals(true, true); } }
@Listeners(LocalVisualiser.class) public class TestSampleWithListener { @Test public void parent() {} @Test(dependsOnMethods = "parent") public void child() {} }
@Listeners(ResultContextListener.class) public class ResultContextListenerSample { @Test public void f() { } }
@Listeners(SimpleListener.class) public class FailingSampleTest { @AfterMethod public void am() { SimpleListener.m_list.add(6); } @Test public void a1() { SimpleListener.m_list.add(4); throw new RuntimeException(); } }
@Listeners(MyClassListener.class) public class ClassListenerSample { @Test public void test() {} @Test public void test2() {} }
@Listeners(LocalDataProviderListener.class) public class SimpleDataProviderWithListenerAnnotationSample { @Test(dataProvider = "getData") public void testMethod(int i) { Assert.assertTrue(i > 0); } @DataProvider public Object[][] getData() { return new Object[][] {{1}, {2}}; } }
@Listeners(LocalExecutionListener.class) public class TestClassSample { @Test public void testMethod(){} }
@Listeners(ReporterLogListener.class) public class ReporterLogSuccessSample { @Test public void test_onSuccess() { Reporter.log("Log from test_onSuccess"); } }
@Listeners(TestListenerFor1232.class) public static class SimpleTestClassWithListener { @Test public void testMethod() { } }
@Listeners(DummyListenerFactory.class) public class TestClassWithCompositeListener { @Test public void testMethod() {} }
@Listeners(ReporterLogListener.class) public class ReporterLogSkippedSample { @BeforeMethod public void beforeMethod() { throw new RuntimeException("Intentionally failed"); } @Test public void test_onSkip() { Reporter.log("Log from test_onSkip"); } }
@Listeners(ExecutionListenerTest.ExecutionListener.class) public class ExecutionListener2SampleTest { @Test public void f() {} }
@Listeners(SuiteListener.class) public class SuiteListenerSample { @Test public void foo(){} }
@Listeners(value = {L3.class, SuiteListener.class, MyInvokedMethodListener.class}) class BaseWithListener { static int m_count = 0; public static void incrementCount() { m_count++; } }
@Listeners(LocalExecutionListener.class) public class TestClassTwoSample { @Test public void testMethod(){} }