Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/329.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 为什么Maven会因SurefireExecutionException失败:>;无法将选项设置为与值并行_Java_Maven 2_Testng_Surefire - Fatal编程技术网

Java 为什么Maven会因SurefireExecutionException失败:>;无法将选项设置为与值并行

Java 为什么Maven会因SurefireExecutionException失败:>;无法将选项设置为与值并行,java,maven-2,testng,surefire,Java,Maven 2,Testng,Surefire,嗨,我正在使用windows XP和最新版本完成教程 有人能告诉我标签是什么吗 <parallel>true</parallel> <threadCount>10</threadCount> 从文件中: parallel(仅限TestNG)当您使用parallel属性时,TestNG将尝试在单独的线程中运行所有测试方法,但相互依赖的方法除外,这些方法将在同一线程中运行,以尊重它们的执行顺序 threadCount(仅限TestNG)属性thre

嗨,我正在使用windows XP和最新版本完成教程

有人能告诉我标签是什么吗

<parallel>true</parallel>
<threadCount>10</threadCount>
从文件中:

parallel(仅限TestNG)当您使用parallel属性时,TestNG将尝试在单独的线程中运行所有测试方法,但相互依赖的方法除外,这些方法将在同一线程中运行,以尊重它们的执行顺序

threadCount(仅限TestNG)属性thread count允许您指定应为此执行分配多少线程。只有与parallel结合使用才有意义

在插件文档的后面有一个关于并行运行测试的部分。为此,您的surefire插件应配置如下:

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-surefire-plugin</artifactId>
  <version>2.4.2</version>
  <configuration>
    <parallel>methods</parallel>
    <threadCount>10</threadCount>
  </configuration>
</plugin>

org.apache.maven.plugins
maven surefire插件
2.4.2
方法
10

true
不是选项
parallel
的有效值;尝试
方法
()

如果使用旧版本的TestNG,也可能发生这种情况

尝试将依赖项升级到TestNG,例如:

<dependency>
  <groupId>org.testng</groupId>
  <artifactId>testng</artifactId>
  <version>5.11</version>
  <classifier>jdk15</classifier>
  <scope>test</scope>
</dependency>

org.testng

<dependency>
  <groupId>org.testng</groupId>
  <artifactId>testng</artifactId>
  <version>5.11</version>
  <classifier>jdk15</classifier>
  <scope>test</scope>
</dependency>