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)
testShouldSkip()12   public void testShouldSkip() throws Exception {
13     Assert.fail();
14   }
15 
16   @Test(dataProvider = "Data", invocationCount = 2, successPercentage = 10)
testShouldSkipEvenIfSuccessPercentage()17   public void testShouldSkipEvenIfSuccessPercentage() throws Exception {
18     Assert.fail();
19   }
20 
21   @DataProvider(name = "Data")
Data()22   public static Object[][] Data() {
23     throw new RuntimeException("Fail");
24   }
25 }
26