2010-10-21 85 views
2

我正在使用ant腳本並運行junit,我面對的問題是我無法在控制檯上獲取輸出,而是在日誌文件中獲取輸出。當通過ant腳本運行junit時在控制檯上輸出輸出

我該如何做到這一點.. 我正在使用以下腳本。

<target name="validate_mapping" description="Testing the Hibernate "> 

    <path id="validator.classpath"> 
     <fileset dir="${basedir}\lib"> 
      <include name="Junit-Temp-Test.jar" /> 
     </fileset> 
    </path> 

    <junit printsummary="yes"> 
     <formatter type="plain"/> 
     <test name="com.ofss.fc.junit.test.SampleTest" /> 
     <classpath> 
      <path refid="validator.classpath" /> 
      <path refid="lib.ext.classpath" /> 
     </classpath> 
    </junit>  
</target> 

回答

3

我認爲你需要指定 「usefile」 屬性<formatter usefile="false" type="plain"/>

相關問題