Home | History | Annotate | Download | only in dataprovider
      1 package test.dataprovider;
      2 
      3 import org.testng.Assert;
      4 import org.testng.annotations.DataProvider;
      5 import org.testng.annotations.Test;
      6 
      7 /**
      8  * @author Vladislav.Rassokhin
      9  */
     10 public class DataProviderWithError {
     11   @Test(dataProvider = "Data", invocationCount = 2)
     12   public void testShouldSkip() throws Exception {
     13     Assert.fail();
     14   }
     15 
     16   @Test(dataProvider = "Data", invocationCount = 2, successPercentage = 10)
     17   public void testShouldSkipEvenIfSuccessPercentage() throws Exception {
     18     Assert.fail();
     19   }
     20 
     21   @DataProvider(name = "Data")
     22   public static Object[][] Data() {
     23     throw new RuntimeException("Fail");
     24   }
     25 }
     26