We are what we repeatedly do. Excellence, therefore, is not an act, but a habit.
                    - Aristotle
 
Search
Search

 
 
Navigation menu
Navigation menu
 
 
 
 
Size_box_tl   Size_box_tr
 

JUnit problem - java.lang.NoSuchMethodError: junit.framework.TestCase.getName()Ljava/lang/String;

 

Recently I switched to Junit 4.6 and started noticing the following error JUnit problem - java.lang.NoSuchMethodError: junit.framework.TestCase.getName()Ljava/lang/String; when JUnit tries to assert strings.

After looking at it more closely and googling a little I have found the cause of the problem. I am using dbUnit which in its own respect is dependant on JUnit and its dependency was lower version of JUnit that I was using which caused the above error.

In order to fix this issue you need to open build path and reaarange the jar depencies order to that JUnit jar is above all other jars like so:

Eclipse JUnit multi dependency problem

After doing so the assertion should work normally.

Enjoy :-)



© Inspire Software, Denys Pavlov, 2005-2012
© Inspire Software, Denys Pavlov, 2005-2012
 
Size_box_bl   Size_box_br