1 package test.skipex; 2 3 import org.testng.Assert; 4 import org.testng.TestListenerAdapter; 5 import org.testng.TestNG; 6 import org.testng.annotations.Test; 7 8 import test.SimpleBaseTest; 9 10 public class SkipAndExpectedTest extends SimpleBaseTest { 11 12 @Test shouldSkip()13 public void shouldSkip() { 14 TestNG tng = create(SkipAndExpectedSampleTest.class); 15 TestListenerAdapter tla = new TestListenerAdapter(); 16 tng.addListener(tla); 17 tng.run(); 18 19 Assert.assertEquals(tla.getPassedTests().size(), 0); 20 Assert.assertEquals(tla.getSkippedTests().size(), 1); 21 Assert.assertEquals(tla.getFailedTests().size(), 0); 22 } 23 } 24