Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

JUnit Task

Status
Not open for further replies.

karyn1617

Programmer
Joined
Feb 17, 2005
Messages
6
Location
US
I am having problems using the junit task. Ant is not recognizing the junit as a task. I get this error message:
Could not create task or type of type: junit.
Ant could not find the task or a class this task
relies upon.

I have read the FAQ corresponding to this problem on the apache ant page, but it does not make sense. I am using ant version 1.6.2. I have removed the classpath environment variable completely. I also copied the junit.jar file to my ant/lib directory. I verified that the ant-junit.jar file is in the lib directory as well. In my build.xml file I declare the following path

<path id="library.junit.classpath">
<pathelement location="../../lib/junit.jar" />
</path>
<junit>
<classpath refid="library.junit.classpath" />
<formatter type="brief" usefile="false" />
<test name="BinStringTest" />
</junit>

Does anyone know what is going on? The FAQ solution confused me because I thought it was hinting at removing my ant-junit.jar file from the lib directory, and including in in a taskdef...was I misunderstanding the solution?

 
You just need to put a copy of the junit.jar into the ant/lib directory. This one's an easy fix. The harder problems are yet to come... :-P Hopefully, you won't stumble on those.

________________________________________
Michael Flanakin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top