ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Louise Pryor <louise.pr...@riskexplorer.com>
Subject Re: More optional task problems
Date Fri, 08 Jun 2001 13:56:39 GMT
At 15:20 08/06/01 +0200, you wrote:
>Louise Pryor <louise.pryor@riskexplorer.com> wrote:
>
> > However, I still have to do a taskdef for the junit task, else it
> > doesn't find the task;
> >
> >
> > and then, when I run it, I get
> >
> > run.test:
> >      [junit] Running dev.uk.co.sfs.calcengine.RRResultsTest
> >      [junit] java.lang.NoClassDefFoundError:
> >      org/apache/tools/ant/taskdefs/optional/junit/JUnitTestRunner
>
>Well, if this is the message, Ant obviously knows which class it is
>supposed to load for the junit task.
>
>Are you specifying a classpath with your taskdef? I guess junit is not
>in your system CLASSPATH so Ant cannot load the junit task because it
>doesn't find JUnit itself.

Yes, classpath specified and definitely includes junit.

When I run it with verbose, junit prints out the classpath it is using: it 
definitely includes the junit jar, and definitely doesn't include any of 
the ant jars.

It really looks as if it's the 
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner class that 
isn't being found because it's not in the class path: which it isn't, as 
the ant jars aren't there.

So should I be specifying the ant jars in my own class path?  That really 
doesn't seem as if it should be right.

Note that the problem above occurs when I specify fork="yes"
When I do fork="no", I get
java.lang.NoClassDefFoundError: junit/framework/TestListener
         at 
org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.executeInVM(JUnitTask.java, 
Compiled Code)
         at 
org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execute(JUnitTask.java:283)
         at 
org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execute(JUnitTask.java, 
Compiled Code)
   [stuff omitted...]

This time it looks like it *is* a junit class that it can't find, but again 
the verbose output says that the junit jar is in the classpath.

I really don't understand what is going on here!

(and why do I have to use taskdef to set up the junit task when it's meant 
to be a default one?)

Louise



---------------------------------------------------------------
Louise Pryor                     Securities Finance Systems Ltd
louise.pryor@riskexplorer.com    CBC House
T: +44 131 272 2782              24 Canning Street
F: +44 131 272 2800              Edinburgh EH3 8EG
http://www.riskexplorer.com      Scotland


Mime
View raw message