Вопрос

My development environment is Netbeans 7.4 and Maven 3.0.5 (bundled with Netbeans). I'm using JUnit 4.11 to build unit (class names ending with Test) and integration tests (class names ending with IT). I'm running unit tests and excluding integration tests with the "-DskipITs" Maven option. I have a custom action which runs just the integration tests with the failsafe plugin. Both execute successfully. However, I only see the results in the "Test Results" window when running the unit tests. How can I get the integration tests to show in the "Test Results" window? With the integration tests, I'm only seeing the output in the console.

Это было полезно?

Решение

The maven-failsafe-plugin only executes in integration-test and verify (and of course the help) goal while the maven-surefire-plugin runs during test goal.

NetBeans Test Results window only shows the tests that were executed using the 'test' goal.

My solution for this situation is to categorize my integration tests into

  • testintegration - just lightweight ITs, I run them with surefire (to see them in Test Results window)
  • testheavy - those that will require me to bootstrap something I run with the fail-safe plugin

I hope you have the option of doing something close to that.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top