1 package test.listeners; 2 3 import org.testng.annotations.AfterMethod; 4 import org.testng.annotations.BeforeMethod; 5 import org.testng.annotations.Listeners; 6 import org.testng.annotations.Test; 7 8 import test.SimpleBaseTest; 9 10 @Listeners(SimpleListener.class) 11 public class OrderedListenerSampleTest extends SimpleBaseTest { 12 13 @BeforeMethod bm()14 public void bm() { 15 SimpleListener.m_list.add(1); 16 } 17 18 @Test f()19 public void f() { 20 SimpleListener.m_list.add(2); 21 } 22 23 @AfterMethod am()24 public void am() { 25 SimpleListener.m_list.add(4); 26 } 27 } 28 29