1package test.reports;
2
3import org.testng.Assert;
4import org.testng.Reporter;
5import org.testng.annotations.Test;
6
7/**
8 * Generates multiple permutations of TestNG output to see how things look in EmailableReporter.
9 *
10 * @author Paul Mendelson
11 * @since 5.3
12 * @version $Revision$
13 */
14@Test
15public class EmailableReportDriver {
16
17  public void doFailureSansLog() {
18    Assert.fail("show failure in report");
19  }
20  public void doFailureNested() {
21    Assert.fail("show failure in report",new Exception("Real cuase"));
22  }
23  public void doFailureWithLog() {
24    Reporter.log("Preparing to fail");
25    Assert.fail("show failure in report");
26  }
27  @Test(expectedExceptions={NumberFormatException.class})
28  public void doExpectedExceptionSansLog() {
29    Reporter.log("step 1");
30    Reporter.log("step 2");
31    Integer.parseInt("BAD TEXT");
32  }
33  @Test(expectedExceptions={NumberFormatException.class})
34  public void doExpectedExceptionWithLog() {
35    Integer.parseInt("BAD TEXT");
36  }
37
38}
39