【发布时间】:2015-12-23 08:57:02
【问题描述】:
我正在使用 testng 并行运行测试。 xml 文件包含线程数参数。
<suite name="Lalala" parallel="tests" thread-count="3" preserve-order="true">
但我想从 POM 文件中设置线程计数值。我试过了
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.3.1</version>
</dependency>
和
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.19</version>
<configuration>
<parallel>classes</parallel>
<threadCount>10</threadCount>
<suiteXmlFiles>
<suiteXmlFile>src/test/resources/${suite}.xml</suiteXmlFile>
</suiteXmlFiles>
<workingDirectory>target/</workingDirectory>
</configuration>
</plugin>
但线程数仍然等于 1
有没有办法从 Pom 文件中添加线程数??
【问题讨论】:
标签: multithreading maven testng maven-surefire-plugin