Saturday, February 19, 2011

Debugging JUNIT maven test case


It will be very useful if you can test your JUNIT test cases when you are using Maven. Maven supports debugging with eclipse. Steps are as follows

1. Create a new debug configuration in eclipse as Remote Java Debugging on port 5005
2. Set break point on the required class files
3. Go to your project directory and execute the below command 'mvn test -Dmaven.surefire.debug=true' .The Test case will wait for a listener at 5005
4. Now go back to eclipse and start the debugger with the new debug configuration
There you go... Enjoy finding bugs and destroying them:)

No comments:

Post a Comment