根据以下page,可以通过以下方式为TestNG指定自定义侦听器:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M5</version>
<configuration>
<properties>
<property>
<name>listener</name>
<value>
com.mycompany.MyResultListener,com.mycompany.MyAnnotationTransformer,com.mycompany.MyMethodInterceptor
</value>
</property>
</properties>
</configuration>
</plugin>我的问题是,除了通过命令行之外,我如何做同样的事情(提供自定义侦听器)?
发布于 2021-07-23 03:20:07
您可以简单地定义一个属性,比如tCustomListener
<properties>
<tCustomListener>intelligent_default_listener</value>
</properties>并使用${tCustomListener}将其传递给<value>
使用-DtCustomListener=yourvalues运行
https://stackoverflow.com/questions/68482560
复制相似问题