2017-02-03 4 views
0

次のように私は私のmaven-failsafe-pluginが設定されている:IntegrationTestの名前に基づいて作業ディレクトリを設定できますか?

<plugin> 
    <groupId>org.apache.maven.plugins</groupId> 
    <artifactId>maven-failsafe-plugin</artifactId> 
    <version>2.19.1</version> 
    <executions> 
     <execution> 
      <id>integration-test</id> 
      <goals> 
       <goal>integration-test</goal> 
       <goal>verify</goal> 
      </goals> 
      <phase>integration-test</phase> 
      <configuration> 
       <excludes> 
        <exclude>none</exclude> 
       </excludes> 
       <includes> 
        <include>**/*IntegrationTest.java</include> 
       </includes> 
       <workingDirectory>${project.build.directory}/integration-test/</workingDirectory> 
       <skipTests>${skipITs}</skipTests>      

      </configuration> 
     </execution> 
    </executions> 
</plugin> 

を今私が何をしたいのか、目的のフォルダに別のディレクトリで実行し、私の統合テストのそれぞれを持っている - 私は、それぞれのログを確認することができるように1。

がいる可能性がある - 例えば、何かのように:

<workingDirectory>${project.build.directory}/integration-test/${integration.test.name}</workingDirectory>

+0

私はフェールセーフプラグインを使用してこれを行うことはできないと思います。ただし、ログをstdoutにリダイレクトできます。テストごとに異なる出力ファイルがあるので、ログラインを分離することができます。 – GauravJ

答えて

1

あなたは、各テスト用の出力ファイルを持つ結果と、各テストのために出力をファイルにリダイレクトする場合はtrueにredirectTestOutputToFileを設定できます

reportsDirectory/testName-output.txt 

reportsDirectoryが${project.build.directory}/failsafe-reportsに設定され、デフォルトであるreportsDirectory設定によって定義されます。このようになります。

関連する問題