ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steve Loughran" <stev...@iseran.com>
Subject Re: junit task not working
Date Fri, 14 Jun 2002 15:49:35 GMT

----- Original Message -----
From: "Domagoj Jugovic" <domagoj@laus.hr>
To: <ant-user@jakarta.apache.org>
Sent: Friday, June 14, 2002 07:03
Subject: junit task not working


> <LOOP times="999999999999" message="PLEASE HELP !!!" />
> I am running ant (1.4 and 1.5b2) on win98 , the build did'n work on 1.4 so
> I reached out for 1.5 and it's not working either.
>
> I have a target called "junit" :
> ....................

>
> on that target I get printout like :
> ..................
> junit:
> BUILD FAILED
> C:\java\ojb9\build.xml:407: Could not create task or type of type: junit.
> Ant could not find the task or a class this task relies upon.
> This is common and has a number of causes; the usual
> solutions are to read the manual pages then download and
> install needed JAR files, or fix the build file:
> - You have misspelt 'junit'.
> Fix: check your spelling.
> - The task needs an external JAR file to execute
> and this is not found at the right place in the classpath.
> Fix: check the documentation for dependencies.
> Fix: declare the task.
> - The task is an Ant optional task and optional.jar is absent
> Fix: look for optional.jar in ANT_HOME/lib, download if needed
> - The task was not built into optional.jar as dependent
> libraries were not found at build time.
> Fix: look in the JAR to verify, then rebuild with the needed
> libraries, or download a release version from apache.org
> - The build file was written for a later version of Ant
> Fix: upgrade to at least the latest release version of Ant
> - The task is not an Ant core or optional task
> and needs to be declared using <taskdef>.

We put that message in to reduce confusion; seems ok to me

> So I tried to fix things by manualy defining taskdef for "junit" task.
> At the beginning of the build.xml I added :
> <taskdef name="junit"
> classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask"
> classpathref="runtime-classpath"/>
> Then I got this printout (Failing at my taskdef) :
> ..................
> BUILD FAILED
> C:\java\ojb9\build.xml:36: taskdef class
> org.apache.tools.ant.taskdefs.optional.junit.JUnitTask cannot be found


That wont work because of this:
 - The task is not an Ant core or optional task
 and needs to be declared using <taskdef>.

you cannot redeclare stuff that is already declared; classpath issues:.


> ..........................
> So it can't find junit/framework/TestListener. OK
> But this IS on the classpath ??? How this i possible ?
> So I removed taskdef and added this :
> (to see does VM sees that classes with the same classpath : "<classpath
> refid="runtime-classpath"/>" )
> ...................
> <target name="junit" description="Performs all JUnit regression tests." >
> <!-- ADDED STUFF ********to see will the VM find the
> classes***************************************** -->
> <java classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask"
> fork="no">
> <classpath refid="runtime-classpath"/>
> </java>
> <java classname="junit.framework.TestListener" fork="no">
> <classpath refid="runtime-classpath"/>
> </java>

This was a brave effort, but it aint going to work.

>
> So the VM can find these classes , but the "junit" task still does'n work
> (without or with my try to make new taskdef for it).
> SO PLEASE HELP, I AM GOING MAD !


What was wrong with following this advice :

> - The task needs an external JAR file to execute
> and this is not found at the right place in the classpath.
> Fix: check the documentation for dependencies.



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


Mime
View raw message