01: package test.expectedexceptions;
02:
03: /**
04: * This class tests @ExpectedExceptions
05: *
06: * @author cbeust
07: */
08: public class SampleExceptions2 {
09:
10: /**
11: * @testng.test expectedExceptions="java.lang.NumberFormatException"
12: */
13: public void shouldPass() {
14: throw new java.lang.NumberFormatException();
15: }
16:
17: /**
18: * @testng.test expectedExceptions="java.lang.NumberFormatException"
19: */
20: public void shouldFail1() {
21: throw new RuntimeException();
22: }
23:
24: /**
25: * @testng.test expectedExceptions="java.lang.NumberFormatException"
26: */
27: public void shouldFail2() {
28: }
29:
30: }
|