2016-05-16 6 views
-2

私はjunitテストから一意のIDを出力しようとしています。異なるバージョンのリリースで単体テストを実行する複数のビルドボックスがあるためです。しかし、私はtodir =を同じフォルダに入れたい。junit unique xml出力名

<target name="test" depends="compileTest"> 
    <junit fork="yes" forkmode="once" failureproperty="test.failure"> 
     <classpath path="${TomcatClassPath};${TestClassPath};${TestBuildDir};${buildDir}"/> 
     <formatter type="xml" usefile="true" /> 
     <batchtest todir="${unitTestReultDir}"> 
      <fileset dir="${TestSrcDir}"> 
      </fileset> 
     </batchtest> 
    </junit> 
    <fail message="test failed" if="test.failure"> 
    </fail> 
</target> 

常に出力:TEST-com.company.app.component.ClassNameTest.xml

希望 を: TEST-com.company.app.component.ClassNameTest_YYYYMMDDHHMMSSmmmm.xml

ですファイルが互いに上書きされないようにタイムスタンプを付加する方法があります。

+0

質問を編集してコードを投稿する必要があります。 – Matsmath

+0

@ TXN_747あなたの質問を編集してください。それ以外の場合は明確ではありません。 –

答えて

0

私はあなたが<formatter type="xml" extension="${timestamp}.xml"/>を使用できると信じています。これにより、タイムスタンプ変数がテスト結果ファイル名に追加されます。注:timestampは、定義する必要がある変数です。

関連する問題