2010-05-07 3 views
15

मेरे पास निम्नलिखित जुनीट टास्क में कई परीक्षण विफल हो रहे हैं।जूनिट चींटी टास्क, आउटपुट स्टैक ट्रेस

<target name="test-main" depends="build.modules" description="Main Integration/Unit tests"> 
     <junit fork="yes" 
       description="Main Integration/Unit Tests" 
       showoutput="true" 
       printsummary="true" 
       outputtoformatters="true"> 
      <classpath refid="test-main.runtime.classpath"/> 
      <batchtest filtertrace="false" todir="${basedir}"> 
       <fileset dir="${basedir}" includes="**/*Test.class" excludes="**/*MapSimulationTest.class"/> 
      </batchtest> 
     </junit> 
    </target> 

मैं कैसे करूँ ताकि मैं स्टैक ट्रेस और मुद्दों डिबग देख सकते हैं प्रत्येक परीक्षा के लिए त्रुटियों ouput को JUnit बताओ।

उत्तर

8

उत्तर टैग के भीतर टैग को जोड़ना था।

<target name="test-main" depends="build.modules" description="Main Integration/Unit tests"> 
     <junit fork="yes" 
       description="Main Integration/Unit Tests" 
       showoutput="true" 
       printsummary="true" 
       outputtoformatters="true"> 
      <classpath refid="test-main.runtime.classpath"/> 
      <batchtest filtertrace="false"> 
       <fileset dir="${basedir}/out/test/common" includes="**/*Test.class" excludes="**/*MapSimulationTest.class"/> 
       <fileset dir="${basedir}/out/test/test-simulation" includes="**/*Test.class" excludes="**/*MapSimulationTest.class"/> 
      </batchtest> 
      <formatter type="brief" usefile="false"/> 
     </junit> 
    </target> 
17

आप batchtest कार्य के एक बच्चे के रूप फ़ॉर्मेटर कार्य जोड़ने की आवश्यकता होगी (नहीं JUnit कार्य के तत्काल बच्चे के रूप में)

फ़ॉर्मेटर की वाक्य रचना है:

<formatter type="plain" usefile="false"/> 

typeplain, brief, xml या failure में से एक हो सकता है।

usefile="false" एंट को कंसोल को आउटपुट भेजने के लिए कहता है।

अधिक जानकारी के लिए 0 प्रारूपपर "स्वरूपण" पर एच 4 तक स्क्रॉल करें।

+1

कम से कम चींटी 1.9.0 के साथ, आप जूनिट कार्य के बच्चे के रूप में फॉर्मेटर भी जोड़ सकते हैं। यदि आपके पास कई बैच कार्य हैं तो यह सहायक होगा। –