• 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

Ant and JUnit

 
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
i wanted to run some testcases, and send the report to a folder named 'report'. when i try to run the script, ant doesnt recognise the junit tag, it throws an error
"Could not create task or type of type:junit"
"Ant could not find the task or a class this task relies upon."
Can any1 pls give me a small piece of code that runs a batchtest, including all the files in a directory, sending the report to some directory.
 
Ranch Hand
Posts: 1953
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Do you have junit.jar in your ${ANT_HOME}/lib?
 
Karthik Veeramani
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks, i thought ant packs it with optional.jar. but theres another doubt now (might be a dumber 1) -
the testcases run, and the report keeps giving ClassNotFoundException for all my testcase classes. this is how my directory structure is -
lets say my project has only 1 package, xyz.
i hav a folder src, inside that a folder xyz, inside which the code resides. inside this src folder, theres another folder testcases, inside which the testcase code resides (the testcase classes r written with same package structure, ie., each test class will b in a package testcases.xyz.ClassName) ... similarly, theres a 'bin' folder, and the same directory structure inside. these folders hold the compiled classes.
Should the ant script using junit tag point to the source directory, or to the compiled class files?
my junit task code contains something like
fileset dir="${src}" includes="**/*Test*.java"
will this take care of all the subfolders inside src?
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic