Eclipse Break-point for Assertion Failed
May 11th, 2009 | By admin | Category: EclipseAssertion in Java is a very useful testing tool.A java developer can add more and more tests in code while developing the application.Assertion use as a safeguard to your java code. A failed assertion would throw java.lang.AssertionError. Developer has to log the exception in code to know that the assertion is failed.
In development environment we rely on the debugging and inspect the variables when it hits the break-point.If you are using Eclipse as your development IDE , you have to enable the AssertionError exception to hit the breakpoint on the error in case an assertion fails.
You can achieve it by ,
1. Go to Run > Java Exception Point

Run - Java Exception Point
2. Type java.lang.AssertionError in the text box for choose an exception and press OK.

Add the exception
Here the exception is added. Now whenever you do debug your code , AssertionError should be selected by default as a debug point.

break-point
