01: package test.expectedexceptions;
02:
03: /**
04: * Regression test for bug with expected exceptions.
05: * See forum http://forums.opensymphony.com/thread.jspa?threadID=4792&tstart=0
06: */
07: public class WrappedUnwrappedExceptionTest {
08:
09: /**
10: * @testng.test
11: * @testng.expected-exceptions value="java.lang.RuntimeException"
12: */
13: public void runtimeWithNoCause() {
14: throw new RuntimeException();
15: }
16:
17: /**
18: * @testng.test
19: * @testng.expected-exceptions value="java.lang.RuntimeException"
20: */
21: public void runtimeWithCause() {
22: try {
23: throw new java.io.EOFException();
24: } catch (java.io.IOException ex) {
25: throw new RuntimeException(ex);
26: }
27: }
28: }
|