1 package test.timeout; 2 3 import org.testng.Assert; 4 import org.testng.TestListenerAdapter; 5 import org.testng.TestNG; 6 import org.testng.annotations.Test; 7 import org.testng.xml.XmlSuite; 8 9 public class TimeOutIntegrationTest { 10 11 @Test(description = "https://github.com/cbeust/testng/issues/811") testTimeOutWhenParallelIsTest()12 public void testTimeOutWhenParallelIsTest() { 13 TestNG tng = new TestNG(); 14 tng.setParallel(XmlSuite.ParallelMode.TESTS); 15 tng.setTestClasses(new Class[]{TimeOutWithParallelSample.class}); 16 17 TestListenerAdapter tla = new TestListenerAdapter(); 18 tng.addListener(tla); 19 20 tng.run(); 21 22 Assert.assertEquals(tla.getFailedTests().size(), 1); 23 Assert.assertEquals(tla.getSkippedTests().size(), 0); 24 Assert.assertEquals(tla.getPassedTests().size(), 0); 25 } 26 } 27