01: package test.invocationcount;
02:
03: import org.testng.Assert;
04: import org.testng.TestListenerAdapter;
05: import org.testng.TestNG;
06: import org.testng.internal.AnnotationTypeEnum;
07:
08: public class FailedInvocationCountTest {
09:
10: /**
11: * @testng.test
12: */
13: public void verifyAttributeShouldStop() {
14: TestNG testng = new TestNG();
15: testng.setVerbose(0);
16: testng.setSourcePath(".");
17: testng.setAnnotations(AnnotationTypeEnum.JAVADOC.toString());
18: testng
19: .setTestClasses(new Class[] { FailedInvocationCount2.class });
20: TestListenerAdapter tla = new TestListenerAdapter();
21: testng.addListener(tla);
22: testng.run();
23:
24: Assert.assertEquals(tla.getPassedTests().size(), 8);
25: Assert.assertEquals(tla.getFailedTests().size(), 7);
26: Assert.assertEquals(tla.getSkippedTests().size(), 5);
27:
28: }
29: }
|