01: package test.dataprovider;
02:
03: import org.testng.Assert;
04: import org.testng.annotations.DataProvider;
05: import org.testng.annotations.Test;
06:
07: /**
08: * This class/interface
09: */
10: public class FailingDataProvider {
11: @DataProvider
12: public Object[][] throwsExpectedException() {
13: throw new RuntimeException("expected exception from @DP");
14: }
15:
16: @Test(dataProvider="throwsExpectedException")
17: public void dpThrowingException() {
18: Assert.fail("Method should never get invoked");
19: }
20: }
|