使用TestNG和sure-fire插件跳过报告生成

时间:2014-07-14 13:51:54

标签: java testng maven-surefire-plugin

我是TestNG框架的新手。我不想使用sure-fire插件生成报告,是否有任何选项可以禁用此功能。我也更喜欢使用TestNG框架停止报告生成。在目前的情况下,同样的报告生成2次,一次是通过sure-fire插件(在目标目录下),一次是通过TestNG框架(在测试输出目录下)。另外,就像你可以建议一些关于自定义报告的好教程。目前的报道太冗长了。这就是我配置sure-fire插件的方式。

<plugin>
       <groupId>org.apache.maven.plugins</groupId>
       <artifactId>maven-surefire-plugin</artifactId>
       <version>2.17</version>
       <configuration>
         <suiteXmlFiles>
           <suiteXmlFile>testng.xml</suiteXmlFile>
         </suiteXmlFiles>                 
       </configuration>
</plugin>

这是我的testng.xml看起来的样子

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="Suite" parallel="none">
  <test name="Test">
    <classes>
      <class name="SampleTest"/>
      <methods>
        <exclude name="testRun"></exclude>
      </methods>
    </classes>
  </test> <!-- Test-->
</suite> <!-- Suite-->

编辑:

我可以通过为maven-surefire-plugin设置以下属性来跳过报告。但这已经超过了两份报告。我希望至少生成一份简短的报告。

     <properties>
       <property>
           <name>usedefaultlisteners</name>
           <key>false</key>
       </property>
     </properties>

0 个答案:

没有答案
相关问题