blob: 0af6d5aee51eda8d7691633ee2b87a0cfa9ee4c0 [file] [log] [blame]
package test.expectedexceptions;
import org.testng.annotations.ExpectedExceptions;
import org.testng.annotations.Test;
/**
* This class tests @ExpectedExceptions
*
* @author cbeust
*/
public class SampleExceptions2 {
@Test(expectedExceptions = NumberFormatException.class )
public void shouldPass() {
throw new NumberFormatException();
}
@Test(expectedExceptions = NumberFormatException.class)
public void shouldFail1() {
throw new RuntimeException();
}
@Test(expectedExceptions = NumberFormatException.class)
public void shouldFail2() {
}
// @Test
// @ExpectedExceptions({ FileNotFoundException.class, IOException.class })
// public void shouldPass2() throws Exception {
// throw new FileNotFoundException();
// }
}