Well I have looked all over the web and I can't find the answer to
this seemingly simple problem.

I get the following error when I try to run junit testcase classes
through the Ant junit task

<error message="com.mycomp.MyClassTest"
type="java.lang.ClassNotFoundException">java.lang.ClassNotFoundExcept
ion: com.mycomp.MyClassTest
        at java.net.URLClassLoader.findClass(URLClassLoader.java:375)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:562)
        at sun.misc.Launcher$AppClassLoader.loadClass
(Launcher.java:442)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:494)
        at java.lang.Class.forName1(Native Method)
        at java.lang.Class.forName(Class.java:180)
</error>

The error snipet above is from the xml report that the junit task
produces.  I call junit from ant with this command

<target name="unit" depends="compile">
  <junit printsummary="yes" dir="${build_dir}">
    <classpath refid="project.classpath"/>
    <formatter type="xml"/>
    <batchtest fork="yes" todir="${distribute_dir}">
      <fileset dir="${build_dir}">
        <include name="**/*Test.class"/>
      </fileset>
    </batchtest>
  </junit>
</target>

ahead of time I set up the project.classpath to contain all my test
classes, junit.jar and any dependent classes my test cases need. 
Junit is actually running but for some reason the class loader can't
find my test classes even though they are on the classpath.

I'm sure the problem must be trivial but I'm just not seeing it.

Thanks in advance

Dave










Yahoo! Groups Sponsor
ADVERTISEMENT
click here
Web Bug from http://us.adserver.yahoo.com/l?M=315388.5529720.6602079.3001176/D=groups/S=:HM/A=2372354/rand=494350027


Yahoo! Groups Links

Reply via email to