1 package test.reports; 2 3 import org.testng.Assert; 4 import org.testng.Reporter; 5 import 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 15 public class EmailableReportDriver { 16 doFailureSansLog()17 public void doFailureSansLog() { 18 Assert.fail("show failure in report"); 19 } doFailureNested()20 public void doFailureNested() { 21 Assert.fail("show failure in report",new Exception("Real cuase")); 22 } doFailureWithLog()23 public void doFailureWithLog() { 24 Reporter.log("Preparing to fail"); 25 Assert.fail("show failure in report"); 26 } 27 @Test(expectedExceptions={NumberFormatException.class}) doExpectedExceptionSansLog()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}) doExpectedExceptionWithLog()34 public void doExpectedExceptionWithLog() { 35 Integer.parseInt("BAD TEXT"); 36 } 37 38 } 39