ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sebastien Blanc <Sebastien.Bl...@alcatel.com>
Subject Re: Junit test problem
Date Fri, 06 Jun 2003 18:22:16 GMT
Hi !
the junit task is not finding your test class in the classpath attribute.
you can launch ANT in verbose mode (-v) or do an <echoproperties> before your <junit>
call, to check that the test.path is correctly defined (either in terms of directory
or package name).
seb.

Joseph Yang wrote:

> Hello all,
>
> I am very new to ant, I need some help please (I have searched the mail
> archive...), I am trying to run junit test using ant, in build.xml
>
>  <path id="test.path">
>         <fileset dir="${basedir}/test">
>             <include name="*.class"/>
>         </fileset>
>  </path>
>
>     <target name="runtests" depends="compiletests">
>         <junit fork="yes" haltonerror="no" haltonfailure="no"
> printsummary="yes" >
>             <classpath refid="test.path"/>
>             <test fork="true" name="teluswonderland.AllTests" haltonfailure="yes"
> outfile="result">
>                 <formatter type="xml"/>
>             </test>
>         </junit>
>     </target>
>
> When I run the test, it keeps giving me error as below, how to solve this?
>
>   <error message="teluswonderland.AllTests"
> type="java.lang.ClassNotFoundException">java.lang.ClassNotFoundException:
> teluswonderland.AllTests
>         at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at java.net.URLClassLoader.findClass(URLClassLoader.java:183)
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:294)
>         at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:281)
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:250)
>         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:310)
>         at java.lang.Class.forName0(Native Method)
>         at java.lang.Class.forName(Class.java:115)
> </error>
>
> Thanks
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message