我正在使用TestNg和Maven的surefire插件来运行我的测试。我有几个不同的测试,我想在同一个pom中运行。目前要做到这一点,我有两个不同的XML文件定义,我已经定义了两个配置文件来运行不同的XML文件,但这不断抛出错误!maven多重测试套装在surefire插件
我不知道我该如何解决这个问题。 任何帮助将不胜感激!
<profile>
<id>run</id>
<activation>
<property>
<name>start</name>
<value>true</value>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skip>true</skip>
<suiteXmlFiles>
<suiteXmlFile>${project.build.directory}/resources/testng.xml</suiteXmlFile>
</suiteXmlFiles>
</configuration>
<executions>
<execution>
<id>test</id>
<phase>integration-test</phase>
<goals>
<goal>test</goal>
</goals>
<configuration>
<skip>false</skip>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
想象型材(2)是几乎相同的,但XML套件文件是不同
我得到一个解析错误:它无法找到在suiteXmlFile测试类。但是,如果我只使用一个配置文件只有一个xml文件,这是可以接受的。那个失败的人也有效。
可以给POM? – khmarbaise 2012-07-24 07:39:45
你会得到什么错误? – 2012-07-24 12:49:18
我已更新我的问题。 – 12rad 2012-07-24 14:11:01