1 package test.expectedexceptions; 2 3 4 import org.testng.annotations.ExpectedExceptions; 5 import org.testng.annotations.Test; 6 7 public class WrappedExpectedExceptionTest { 8 @Test(timeOut = 1000L) 9 @ExpectedExceptions({ IllegalStateException.class }) testTimeout()10 public void testTimeout() { 11 throw new IllegalStateException("expected failure"); 12 } 13 } 14