WrappedUnwrappedExceptionTest.java :  » Testing » testng » test » expectedexceptions » Java Open Source

Java Open Source » Testing » testng 
testng » test » expectedexceptions » WrappedUnwrappedExceptionTest.java
package test.expectedexceptions;


/**
 * Regression test for bug with expected exceptions.
 * See forum http://forums.opensymphony.com/thread.jspa?threadID=4792&tstart=0
 */
public class WrappedUnwrappedExceptionTest {

  /**
   * @testng.test
   * @testng.expected-exceptions value="java.lang.RuntimeException"
   */
  public void runtimeWithNoCause() {
    throw new RuntimeException();
  }

  /**
   * @testng.test
   * @testng.expected-exceptions value="java.lang.RuntimeException"
   */
  public void runtimeWithCause() {
    try {
      throw new java.io.EOFException();
    }
    catch(java.io.IOException ex) {
      throw new RuntimeException(ex);
    }
  }
}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.