Showing posts with label JUnit. Show all posts
Showing posts with label JUnit. Show all posts

Saturday, February 15, 2014

Running all jUnit tests in package with IntelliJ

To run all jUnit tests in a package using IntelliJ click on Run > Edit configurations:


On the left bar, click on the + sign and select JUnit (you must have JUnit plugin and JUnit dependencies on your project).


This will open a Dialog Window to edit the run configuration for a new test.

Name the new configuration, I've used the label <Run all tests>
The fork mode for JUnit allows you to run each test method or class in a separate process, if you're not sure what to use just leave it at <None>
On the <Test Kind> field, select the <All in package> option.
On the <Package> field, select the package from where tests should be executed, then click <Ok>.



It is also a good idea to click on the Code Coverage tab and add your test package to run coverage:


Now run your tests by clicking on the shortcut located on the top bar:


Results should be displayed at the bottom of the screen:


In case you want to see coverage, use the shortcut:

 

Results displayed on the dialog: