标签:conf zed pre 修改 round org ges package 配置
public void run(final IHookCallBack icb, ITestResult testResult) { // Preferably initialized in a @Configuration method mySubject = authenticateWithJAAs(); Subject.doAs(mySubject, new PrivilegedExceptionAction() { public Object run() { icb.callback(testResult); } }; }
@Listeners({SuiteListener.class}) public class InvokedMethodListenerExample { @BeforeSuite public void beforeSuite() { System.out.println("before suite"); } @Test public void t1() { System.out.println("t1 test method"); } @AfterSuite public void afterSuite() { System.out.println("after suite"); } }
?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd"> <suite verbose="0" name="listeners-test"> <listeners> <listener class-name="listeners.ProgressTracker" /> <listener class-name="listeners.SuitListener" /> <listener class-name="listeners.RetryListener" /> </listeners> <test name="listeners.testng"> <packages> <package name="listeners" /> </packages> </test> </suite>
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>2.17</version> <configuration> <suiteXmlFiles> <suiteXmlFile>TestNG_${env}.xml</suiteXmlFile> </suiteXmlFiles> <properties> <property> <name>listener</name> <value>listeners.SuitListener, listeners.RetryListener</value> </property> </properties> </configuration> </plugin>
当你扩展这个类来重载这些方法时,如果你想要这个列表测试Test被维护时,需要调用super的同类。
标签:conf zed pre 修改 round org ges package 配置
原文地址:http://www.cnblogs.com/heaven1025/p/6021517.html