• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 package test.configurationfailurepolicy;
2 
3 import org.testng.SkipException;
4 import org.testng.annotations.BeforeMethod;
5 import org.testng.annotations.Test;
6 
7 public class ClassWithSkippingBeforeMethod {
8 
9   private int invocations = 0;
10 
11   @BeforeMethod
beforeMethod()12   public void beforeMethod() {
13       invocations++;
14       if (invocations ==2) {
15         throw new SkipException("skipping");
16       }
17   }
18 
19   @Test
test1()20   public void test1() {}
21 
22   @Test
test2()23   public void test2() {}
24 }
25