Files
pmd/pmd-java
Robert Whitebit cd52e39b08 [JUnit] Check assertion message present in assertEquals with delta
A missing assertion message for assertEquals(double, double, double)
is detected in most cases now. If the assertEquals method has two
arguments, an assertion message is missing, if the assertEquals method
has three arguments, the first one has to be a string.

Pmd will only print an error if the first argument type has been
determined (getType() != null) and isn't a String. Therefore
assertEquals(getInt(), getInt(), getInt()) won't be detected as an
error. However, double d = 1.0; assertEquals(d, 1.0, 1.0); will be
detected.

The JUnitAssertionsShouldIncludeMessageRule.check method has been moved
to the inner class AssertionCall and has been expanded by an
isException hook. The assertEquals with three arguments check overrides
the isException method, returns true if the first argument can't be
determined or is a String and if so, no violation will be added. Also
the constructor arguments have been swapped for readability.

https://sourceforge.net/p/pmd/bugs/1313/
2015-02-20 00:36:11 +01:00
..
2015-01-19 19:22:03 +01:00