我需要在两个不同的JVM实例中并行启动testng类。我试图使用ant并行任务来实现这一目标但不成功。使用下面的块,它按顺序启动两个testng任务,而不是并行启动。能帮我解决这个问题吗?
<parallel threadCount="1">
<testng classpathref="maven.test.classpath" outputdir="target/first">
<classfileset dir="build">
<include name="**/TestX.class" />
</classfileset>
<jvmarg line="${java.args}" />
<jvmarg line="${run.args}" />
</testng>
<testng classpathref="maven.test.classpath" outputdir="target/second">
<classfileset dir="build">
<include name="**/TestY.class" />
</classfileset>
<jvmarg line="${java.args}" />
<jvmarg line="${run.args}" />
</testng>
</parallel>
答案 0 :(得分:0)
根据TestNG任务文档,它始终以fork模式运行(从Ant单独读取JVM)。所以,我认为threadCount="1"
可能是顺序执行的原因。