2011-12-06 126 views
2

有沒有辦法讓Emma報告集成測試?目前我們的艾瑪報道只顯示單元測試。Emma覆蓋率報告和集成測試

加入澄清: 我們正在使用maven來運行構建和測試。測試是使用testng運行的,而不是jUnit,我們運行的是surefire插件:maven-surefire-plugin

+0

什麼是你的集成測試樣?他們也是JUnit測試還是某種GUI測試......? – Kai

回答

0

我花了很多時間試圖讓Emma在結果覆蓋範圍內包含集成測試。我查看了emma4it插件,但我能找到的唯一文檔是this blog post from Sonatype,並且無法使其工作。

最後我放棄了,轉而使用JaCoCo代替。它是由寫愛瑪的同樣的人撰寫的,所以它的目的是成爲其繼任者。我還沒有使用它與TestNG的嘗試,但我得到了它加入下面的「插件」聲明,以一個POM使用JUnit工作:

<plugin> 
    <groupId>org.jacoco</groupId> 
    <artifactId>jacoco-maven-plugin</artifactId> 

    <executions> 
     <execution> 
      <id>agent</id> 
      <goals> 
       <goal>prepare-agent</goal> 
      </goals> 
     </execution> 
     <execution> 
      <id>report</id> 
      <phase>install</phase> 
      <goals> 
       <goal>report</goal> 
      </goals> 
     </execution> 
    </executions> 
</plugin> 
相關問題