1 package test.verify; 2 3 import org.testng.annotations.Listeners; 4 import org.testng.annotations.Test; 5 6 /** 7 * Illustrate the implementation of a @Verify/@Verifier test. 8 * 9 * One method should be annotated with @Verifier and then each test method 10 * annotated with @Verify will be followed with a call to the @Verifier 11 * method. 12 */ 13 @Listeners(VerifyMethodInterceptor.class) 14 public class VerifySampleTest { 15 16 @Verify 17 @Test f1()18 public void f1() { 19 log("f1"); 20 } 21 22 @Verify 23 @Test f2()24 public void f2() { 25 log("f2"); 26 } 27 28 @Verifier 29 @Test verify()30 public void verify() { 31 log("Verifying"); 32 } 33 log(String string)34 private void log(String string) { 35 if (false) { 36 System.out.println(string); 37 } 38 } 39 } 40