Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Ant/JUnit, BatchTest: ClassNotFound...

tumbleweed and gunslinger
Posts: 192
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Started using JUnit more in a more complex project and specifying each TestCase individually works great. However, cannot get the BatchTest to work.
The following output is generated:
Testsuite: AdminDBTest
Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0 sec
Caused an ERROR
java.lang.ClassNotFoundException: AdminDBTest
at Method)
at java.lang.ClassLoader.loadClass(
at sun.misc.Launcher$AppClassLoader.loadClass(
at java.lang.ClassLoader.loadClass(
at java.lang.ClassLoader.loadClass(
Below is the JUnit section of build.xml for Ant:
<target name="junit" depends="compile">
<junit printsummary="yes" haltonfailure="no">
<pathelement location="./"/>
<pathelement path="${classpath}"/>
<formatter type="plain"/>

<batchtest fork="no" todir="../">
<fileset dir="${junit}">
<include name="**/*Test*.java"/>

The variables classpath and junit are set and work fine with all other code/ant processes. Not sure why it's failing...
Ant v1.5.1
JUnit v3.8.1
JDK 1.3.1_03
Ranch Hand
Posts: 2676
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I will move this to the Open Source forum.
Because those who mind don't matter and those who matter don't mind - Seuss. Tiny ad:
Thread Boost feature
    Bookmark Topic Watch Topic
  • New Topic