I have jspwiki version 2.1.165 source. I have most everythings working correct. But when I try to run unit test, I get error messeges like below.


Buildfile: C:\BenDev\Projects\JSPWiki\build.xml
mkpropertyfile:
init:
compile:
compiletests:
tests:

BUILD FAILED
C:\BenDev\Projects\JSPWiki\build.xml:429: 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 the JAR file and/or libraries
     implementing the functionality were not found at the time you
     yourself built your installation of Ant from the Ant sources.
   Fix: Look in the ANT_HOME/lib for the 'ant-' JAR corresponding to the
     task and make sure it contains more than merely a META-INF/MANIFEST.MF.
     If all it contains is the manifest, then rebuild Ant with the needed
     libraries present in ${ant.home}/lib/optional/ , or alternatively,
     download a pre-built 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>.
 - You are attempting to use a task defined using 
    <presetdef> or <macrodef> but have spelt wrong or not 
   defined it at the point of use

Remember that for JAR files to be visible to Ant tasks implemented
in ANT_HOME/lib, the files must be in the same directory or on the
classpath

Please neither file bug reports on this problem, nor email the
Ant mailing lists, until all of these causes have been explored,
as this is not an Ant bug.


I can run guitests target fine except tests and stresstests targets. Based on the exception messeges, I've checked for exception suggestions but :-( still not get it work right. Anyone please give me a clue on how to get these two unit test targets running properly.

Thank you,

Ben Nguyen


Hello, Ben.

Ant requires that the junit.jar to be on its classpath when running the optional junit task in the build script. Place copy of junit.jar in your ANT_HOME/lib folder. If you don't have a copy of junit.jar handy, you can get a distribution of junit from the JUnit home page.

SeanDockery


Thank you for your time and help to respond to my question. :-). Wonderful

BN.


Hi, While running the Junit with ANT i am uable to send e-mail. It is givine me error

BUILD FAILED
C:\appl\COS\COS Unit Tests\build-TestCase.xml:93: Problem while sending mime mai
l:
        at org.apache.tools.ant.taskdefs.email.MimeMailer.send(MimeMailer.java:2
29)
        at org.apache.tools.ant.taskdefs.email.EmailTask.execute(EmailTask.java:
548)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
        at org.apache.tools.ant.Task.perform(Task.java:364)
        at org.apache.tools.ant.Target.execute(Target.java:341)
        at org.apache.tools.ant.Target.performTasks(Target.java:369)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
        at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExe
cutor.java:40)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
        at org.apache.tools.ant.Main.runBuild(Main.java:668)
        at org.apache.tools.ant.Main.startAnt(Main.java:187)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)
Caused by: javax.mail.SendFailedException: Sending failed;
  nested exception is:
        javax.mail.MessagingException: 454 5.7.3 Client does not have permission
 to submit mail to this server.

        at javax.mail.Transport.send0(Transport.java:219)
        at javax.mail.Transport.send(Transport.java:81)
        at org.apache.tools.ant.taskdefs.email.MimeMailer.send(MimeMailer.java:2
27)
        ... 13 more
--- Nested Exception ---
javax.mail.SendFailedException: Sending failed;
  nested exception is:
        javax.mail.MessagingException: 454 5.7.3 Client does not have permission
 to submit mail to this server.

        at javax.mail.Transport.send0(Transport.java:219)
        at javax.mail.Transport.send(Transport.java:81)
        at org.apache.tools.ant.taskdefs.email.MimeMailer.send(MimeMailer.java:2
27)
        at org.apache.tools.ant.taskdefs.email.EmailTask.execute(EmailTask.java:
548)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
        at org.apache.tools.ant.Task.perform(Task.java:364)
        at org.apache.tools.ant.Target.execute(Target.java:341)
        at org.apache.tools.ant.Target.performTasks(Target.java:369)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
        at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExe
cutor.java:40)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
        at org.apache.tools.ant.Main.runBuild(Main.java:668)
        at org.apache.tools.ant.Main.startAnt(Main.java:187)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)

Anyone knows what could be the reason? Thanks in advance

--Kish, 21-Aug-2006

Looking at the exception, it seems that your configuration is trying to send mail via a server which it's not allowed to. Check your configuration.

-- JanneJalkanen


Instead of copying the junit.jar in ANT_HOME/lib, is there an alternate solution?

--cm, 01-Oct-2007

Add new attachment

Only authorized users are allowed to upload new attachments.
« This page (revision-22) was last changed on 01-Oct-2007 22:16 by cm