1

コードカバレッジ (Sonar + JaCoCo + Maven + Selenium (統合テスト)) に問題があります。これが私のプロジェクトの構造です。

+-[CLIENT] 
|  +-[src]
|      +-[main]
|      +-[test]    <= Unit tests
+-[SERVICE] 
|  +-[src]
|      +-[main]
|      +-[test]    <= Unit tests
+-[TESTS] 
|  +-[src]
|      +-[main]
|      +-[test]    <= Integration tests

「TESTS」フォルダの統合テストで、「CLIENT」モジュールと「SERVICE」モジュールのコードカバレッジを測定できますか?

4

2 に答える 2

0

The problem is that Jacoco needs the class files of the tested classes to create the report, which in your case are not available (because they are in different module). Here is a post which presents a solution to this by making the sources available with the maven-source-plugin. It uses ant, which is not an option in my case, but maybe it helps you:

http://olafsblog.sysbsb.de/measuring-test-coverage-of-integration-tests-for-separated-modules-with-jacoco/

于 2014-09-02T21:31:43.347 に答える
0

この投稿が役立つかもしれません: http://www.lordofthejars.com/2012/07/jacoco-in-maven-multi-module-projects.html

私の提案: すべてのテストを実行して、同じ jacoco 実行データ ファイルに記録することができます。ただし、プロジェクトごとにレポートを作成すると、このプロジェクトのクラスのみが使用されます。

于 2013-02-05T19:56:04.710 に答える