• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Using easy mocks : getting NoClassDefFoundError

 
Ranch Hand
Posts: 299
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Iam using STS (SpringSourceToolSuite), and i cerated a unit test case. when i try to run the Junit test case, i get the below exception




I see , in my project build path "easyMock2.2jar" , and this being a grails project, I also see "GrailsDependencies", which in turn includes "junit3.8Jar". However, i dont understand why am i getting the above exceptions, despite having these jars in build path
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You need them on the runtime path as well, not just the build path.

Is there a specific reason you're using the 3.8 version?
 
Maan Suraj
Ranch Hand
Posts: 299
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Is there a specific reason you're using the 3.8 version?


When i create a grails project, it automatcially adds the above version of Junit to my grails dependencies. Is there any problem with this version?


You need them on the runtime path as well, not just the build path.



Could you please tell me how to add in runtime? (using eclipse)
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Maan Suraj wrote:Is there any problem with this version?


No, just not as easy to use as JUnit 4. I'd also recommend using the org.junit packages, but I honestly don't recall if they're in JUnit 3.8. It doesn't make any difference from a functionality standpoint, I just think it's a better idea to use the more conventional package naming.

Could you please tell me how to add in runtime? (using eclipse)


This would depend on how you're running the tests--better to ask in the IDE forum.
 
Maan Suraj
Ranch Hand
Posts: 299
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks david
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

David Newton wrote:

Maan Suraj wrote:Is there any problem with this version?


No, just not as easy to use as JUnit 4. I'd also recommend using the org.junit packages, but I honestly don't recall if they're in JUnit 3.8. It doesn't make any difference from a functionality standpoint, I just think it's a better idea to use the more conventional package naming.


org.junit was added with JUnit 4. It wouldn't be in JUnit 3.8.
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Oh. Well, in fairness, 3.8 was released in like 2002 :p (3.8.2 was something like 2005/2006?)

But in any case, thanks for the correction--to the original poster, I guess don't use the org.junit imports :)
 
reply
    Bookmark Topic Watch Topic
  • New Topic