2013-10-16 40 views
0

我在設置TestNG suite config xml文件中的詳細輸出時遇到問題。TestNG - 套件xml配置文件沒有顯示詳細輸出

,這裏是我的Maven的個人資料

<profile> 
      <id>faster-test</id> 
      <build> 
       <pluginManagement> 
        <plugins> 
         <plugin> 
          <groupId>org.apache.maven.plugins</groupId> 
          <artifactId>maven-surefire-plugin</artifactId> 
          <configuration> 
            <suiteXmlFiles> 
             <suiteXmlFile>src/test/resources/faster.xml</suiteXmlFile> 
            </suiteXmlFiles> 
          </configuration> 

         </plugin> 
        </plugins> 
       </pluginManagement> 
      </build> 
     </profile> 

和配置文件faster.xml看起來如下─

<?xml version="1.0" encoding="UTF-8"?> 
<suite name="FasterSuite" verbose="10" > 
    <test name ="standard"> 
     <groups> 
      <run> 
       <exclude name="slow"/> 
      </run> 
     </groups> 
     <classes> 
      <class name="com.dao.SampleTest"/> 
      <class name ="com.dao.Sample2Test"/> 
       </classes> 
    </test> 
</suite> 

當我使用MVN -Pfaster測試它不顯示任何運行測試在運行測試方面的進展。有人能讓我知道我是否缺少任何東西嗎?任何幫助將不勝感激。

回答

1

試試這個配置在Maven的:

<plugin> 
    <groupId>org.apache.maven.plugins</groupId> 
    <artifactId>maven-surefire-plugin</artifactId> 
    <version>2.5</version> 
    <configuration> 
    <useFile>false</useFile> 
    </configuration> 
</plugin> 

useFile元素應該有所幫助。

+0

:我在哪裏放置suitexmlfile條目? – user2506840

+0

相同的地方。嵌套在配置中。 – Vidya

+0

感謝Vidya的幫助,但我仍然沒有得到控制檯上的進度輸出-------------------------------- ------------------------ 測試 ----------------------- -------------------------------- ---------------- --------------------------------------- 測試 -------- ----------------------------------------------- 運行TestSuite 測試運行:57,失敗:0,錯誤:0,跳過:0,經過時間:109.774秒 結果: 測試運行:57,失敗:0,錯誤:0,跳過:0 – user2506840