• 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:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

ant 1.6 and junit task

 
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
i'm trying to get junit to work with ant 1.6. Obviously a few things have changed. I managed to get it working but I have doubts on the way it is accomplished. What I understood from the doc is that I should shove the optional.jar and the junit.jar on the classpath. I tried that and there is no optional.jar anymore so I used the ant-junit.jar and the junit.jar. I made sure they were both on the classpath. No Luck.
After that I edited the run.bat file so the ant-junit.jar and junit.jar were explicitely put on the -classpath argument of java cmd. No luck!
junit was still not recognized, than I put the
<taskdef name="junit" classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask">
first without a classpath entry: No Luck,
than with a classpath entry:
<classpath refid="ant.path"/> (ant.path being a path element with jawhich yields another error:
A class needed by class org.apache.tools.ant.taskdefs.optional.junit.JUnitTask cannot be found: org/apache/tools/ant/Task
I also put the ant.jar entry hardcode on the classpath argument of the JVM.
than it started complaining on the commons-logging.
Which I will also be able to get to work, probably. Now my question: Am I overlooking something, or is this the preferred way to get it working?
ANT_HOME is set, JAVA_HOME is set. (jvm 1.4.2).
thanks in advance
Jeroen.
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'll move this to the Ant forum -- you're likely to get better answers there since this is mainly an "Ant 1.6" question
 
Sheriff
Posts: 9109
12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My ANT_HOME environment variable is set to C:\apache-ant-1.6.1
My JUNIT_HOME environment variable is set to C:\junit3.8.1
My CLASSPATH includes %ANT_HOME%\lib\ant.jar;%JUNIT_HOME%\junit.jar
My PATH includes %ANT_HOME%\bin

I am able to run JUnit in Ant with these settings.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic