Running @Ignored JUnit test in Eclipse

In my Eclipse (Eclipse Luna) project, I have some JUnit test cases that I don’t want to run in a full regression test. For example, because they require the user to be present to check the result (for example, if the sound was reproduced correctly) or because they only work on certain systems. These tests are mainly used manually when making changes to the test class. I used @Ignoreto ignore those tests.

When I run a class with ignored tests in it from Eclipse (Run As -> Junit test), it will show ignored tests as ignored in the test list.

Is there a way to force ignored tests to run from Eclipse?

Currently, I always remove the tag @Ignored, but it's easy to forget to ignore the tests again before making my changes. Is there a better way to do this?

I expected that Eclipse, in order to be able to ignore tests in the JUnit View, also runs tests with ignore, but I cannot find them.

+4
source share
1 answer

You can use JUnit Categories . Create a category for tests that require manual interaction, and exclude this category in your automatic assembly.

+4
source

Source: https://habr.com/ru/post/1617956/


All Articles