Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ant and junit, kicking my butt

 
Tony Smith
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'd read the documentation, but I don't know what part of the documentation to read!



Gives the ubiquitous


Does this mean that somehow junit isn't bound to the appropriate class in the classpath? I am using websphere, it understands the syntax of the junit task.

I am probably making this a lot harder than it is but I keep going around in circles.

questions:
1) how can I tell which class (and jar) the junit task is supposed to be associated with
2) when do I specify that jar? it seems to me that putting it in the classpath within the junit task is too late! I added the ant-junit.jar to my system path but that didn't seem to help.

help please!
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24211
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is stupid, painful, and obnoxious, and frankly, I don't understand why they don't simply ship things this way already, but... the simple, direct, easy fix is to drop a copy of junit.jar into your ANT_HOME/lib directory.
 
Tony Smith
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I copied the file and got no change in behavior.

When ant sees 'junit' how does it know which junit class to execute? I have tried 100 things and nothing has affected the output at all - same error. It is if my error is far more basic.
 
Tony Smith
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This problem relates to websphere. Specifically, it includes a way to configure the environment for ant internally. It seems to ignore the system classpath and path. I pointed it to the junit.jar as inspired by your suggestion and got a little farther.
 
Tony Smith
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It seems like I can't solve anything until I get frustrated and post here.

Anyway, here's a solution that is pure ant (no websphere) except for putting junit.jar into the classpath before the 'junit' target gets invoked.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic