Exception tests from running in IntellIJ

Could some tests be excluded in IntelliJ IDEA Ultimate? I want to run unit tests in IntelliJ, but exclude integration tests. I call integration tests using *IT.java , so the Maven fail-safe plugin can run them separately from unit tests.

+45
java intellij-idea maven junit
Oct 27
source share
2 answers

In the JUnit Run configuration, set Test kind to Pattern , specify the following regular expression as a pattern:

 ^(?!.*IT$).*$ 

It matches the class name, so you do not need to match the .java . The regular expression will not match if the class name ends in IT using a negative lookup .

ignore tests ending with IT

+83
Oct 27
source share

I would divide them into the fact that they are in different packages. In the end, they do different things. Then you can run tests on one package. This link indicates how to do this.

+3
Oct 27 '12 at 21:32
source share



All Articles