1
votes

I want to include a line separator (horizontal line of hyphens) before and after the assert failure message so that they are more visible and can be easily found in log.

Is there I can do this in a way that it shows up for when any assert fails? Naive way of doing this of course is to add the line separator strings to each assertEquals method.

1
Which build tool are you using? - Stefan Birkner

1 Answers

1
votes

you can do it with test listener. Create test listener extention from RunListener RunListener overide method

public void testFailure(Failure failure) throws Exception

Called when an atomic test fails, or when a listener throws an exception.