tags:

views:

66

answers:

2

When I try to use assertNotLesser or assertNotGreater I get compile error .. and eclipse suggest me to create a new method called like this .. http://junit-addons.sourceforge.net/junitx/framework/ComparableAssert.html I found it here I never used these options before but I need to write this test, I can do it jmock as well but I don't know how .. I need to compare my expected results let say 0, if the real result is greater that the test should fail.

A: 

Try this:

assertNotLesser(new Integer(first), new Integer(second));

where first and second are the two integers you want to compare.

klez
method does not exist with that or any other signature..
Gandalf StormCrow
+1  A: 

Don't forget to add the JUnit-addons JAR to your classpath (download the archive here: http://sourceforge.net/projects/junit-addons/files/).

Alternatively, use assertTrue():

asserTrue ("value1="+value1+" value2="+value2, value1.compareTo(value2) >= 0);
Aaron Digulla