Issue
I'm working on a project at the moment that we're using junit to test, but as its still fairly early stages a lot of features aren't yet implemented, though they already have tests written for them
this means these tests (obviously) always fail
I was wondering if anyone knew a way to get JUnit to pass the test while displaying a warning. preferably with a customizable message so we can note that the feature is not yet implemented.
The point of this being that we want to code to compile only if all tests pass, and at the moment this simply isn't possible.
I realise we can just comment out or remove the problem tests, but we then run the risk of forgetting to add them back in later.
Solution
You can @Ignore in front of the test method. It then depends on the test runner what kind of output you get. You can get something like successfully run 25 tests and 6 tests are ignored...
All further things depend on how you want to run the unit tests.
Answered By - Janusz