Saturday, August 17, 2013
How to debug Maven tests in IntelliJ IDEA
In this blog post I'll describe how to debug Maven test in IntelliJ IDEA.
1. Create run configuration
First you need to create a run configuration that for JUnit tests in your project. Select menu item "Edit Configurations..." under "Run" menu. You will see the following window:
Now click the add button with the "+" icon and select "JUnit". The configuration for running JUnit tests will appear. Fill the fields in the appeared form in the following way:
Name - arbitrary name of the run configuration
Package - name of the package where sources of you projects reside
Search for tests - where sources from the specified package will be searched.
2. Start debugging
Now you can set a breakpoint and start debugging. To start debugging click "Debug <SelectedName>" under the "Run" menu.
That's all.
Have a good day.
Subscribe to:
Post Comments (Atom)
If I'm not mistaken that's far from running a Maven test. I'd have expected a tutorial on how to debug a test with "mvn test". So if you keep "make" you'll compile with your selected IDE compiler, which is not necessarily the Maven compiler.
ReplyDeleteI'm not seeing anything about Maven here actually.
This comment has been removed by the author.
ReplyDeleteThank you so much for sharing this pretty post, it was so good to read and useful to improve my knowledge as
ReplyDeleteSplitwise
appvn
Congratulation for the great post. Those who come to read your Information will find lots of helpful and informative tips.
ReplyDeletehome tutor in mumbai