Added by Alex Ruiz, last edited by Alex Ruiz on Nov 02, 2009  (view change)

Labels:

assert assert Delete
junit junit Delete
fest fest Delete
Enter labels to add to this page:
Wait Image 
Looking for a label? Just start typing.

If JUnit 4 (or greater) is in the classpath, failures of

will throw ComparisonFailure instead of the default AssertionError.

This feature can be useful when using tools that have special support for this exception. For example, Eclipse provides a nice GUI that shows the differences between the expected and actual String values: