01: package test.annotationtransformer;
02:
03: import java.util.List;
04:
05: import junit.framework.Assert;
06:
07: import org.testng.TestListenerAdapter;
08: import org.testng.TestNG;
09:
10: import test.BaseTest;
11:
12: public class AnnotationTransformerTest extends BaseTest {
13:
14: /**
15: * @testng.test
16: */
17: public void verifyInvocationCount() {
18: TestNG tng = new TestNG();
19: tng.setVerbose(0);
20: tng.setAnnotations(TestNG.JAVADOC_ANNOTATION_TYPE);
21: tng.setSourcePath("test-14/src");
22: tng.setAnnotationTransformer(new MyTransformer());
23: tng
24: .setTestClasses(new Class[] { AnnotationTransformerSampleTest.class });
25: TestListenerAdapter tla = new TestListenerAdapter();
26: tng.addListener(tla);
27:
28: tng.run();
29:
30: List passed = tla.getPassedTests();
31: Assert.assertEquals(15, passed.size());
32: }
33:
34: }
|