Hi
When I see a failing test case from an inherited code base, sometimes the expected and the actual values are swapped in the message of the Java exception. I have created a proof of concept rule to check that the parameters of the assertEquals are specified correctly:
What do you think about creating a similar rule to Sonar?
Regards
Peter
PS: example stack trace
org.junit.ComparisonFailure:
Expected :str ing
Actual :string
at org.junit.Assert.assertEquals(Assert.java:115)
at org.junit.Assert.assertEquals(Assert.java:144)
at com.AssertTest.testAsserts(AssertTest.java:12)