ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 3978] New: - junit task error message
Date Thu, 04 Oct 2001 19:53:45 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=3978>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=3978

junit task error message

           Summary: junit task error message
           Product: Ant
           Version: 1.4
          Platform: PC
               URL: http://www.lgc.com
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Optional Tasks
        AssignedTo: ant-dev@jakarta.apache.org
        ReportedBy: pwray@lgc.com
                CC: pwray@lgc.com


Ant fails to create the junit task.

Here is the target containing the junit task:

    <target name="test" depends="init" description="Run unit tests">
        <delete dir="${junit.results}"/>
        <mkdir dir="${junit.results}"/>
        <property name="DefClassPath" refid="classpath.default" />
        <echo message="Compiling with classpath ${DefClassPath}" />
        <echo message="Running unit tests..."/>
        <junit fork="yes" haltonfailure="yes">
            <classpath>
                <path refid="classpath.default"/>
                <pathelement location="${build.dir}"/>
            </classpath>
            <formatter type="plain" usefile="false"/>
            <formatter type="xml"/>
            <batchtest todir="${junit.results}">
                <fileset dir="${build.dir}" includes="**/*Test.class"/>
            </batchtest>
        </junit>
    </target>


Here is the classpath it works with locally:

     [echo] Compiling with classpath C:\junit3.7\lib\junit.jar;C:\junit3.7\lib\s
rc.jar;C:\ant\jakarta-ant-1.4\lib\ant.jar;C:\ant\jakarta-ant-1.4\lib\crimson.jar
;C:\ant\jakarta-ant-1.4\lib\jakarta-ant-1.4-optional.jar;C:\ant\jakarta-ant-1.4\
lib\jaxp.jar;C:\ant\jakarta-ant-1.4\lib\StarTeam-sdk.jar;C:\cruisecontrol\1.2.1a
\cruisecontrol.jar;C:\cruisecontrol\1.2.1a\lib\activation.jar;C:\cruisecontrol\1
.2.1a\lib\ant-leakfree.jar;C:\cruisecontrol\1.2.1a\lib\ant.jar;C:\cruisecontrol\
1.2.1a\lib\jakarta-oro-2.0.3.jar;C:\cruisecontrol\1.2.1a\lib\jmxri.jar;C:\cruise
control\1.2.1a\lib\jmxtools.jar;C:\cruisecontrol\1.2.1a\lib\junit.jar;C:\cruisec
ontrol\1.2.1a\lib\mail.jar;C:\cruisecontrol\1.2.1a\lib\optional.jar;C:\cruisecon
trol\1.2.1a\lib\servlet.jar;C:\cruisecontrol\1.2.1a\lib\starteam-sdk-interfaceon
ly.jar;C:\cruisecontrol\1.2.1a\lib\StarTeam-sdk.jar;C:\cruisecontrol\1.2.1a\lib\
xalan.jar;C:\cruisecontrol\1.2.1a\lib\xerces.jar

Here is the error:

BUILD FAILED

C:\cruisecontrol\1.2.1a\bin\starteambuild.xml:135: Could not create task of type
: junit due to java.lang.NoClassDefFoundError: junit/framework/TestListener
        at org.apache.tools.ant.Project.createTask(Project.java:509)
        at org.apache.tools.ant.UnknownElement.makeTask(UnknownElement.java:148)

        at org.apache.tools.ant.UnknownElement.maybeConfigure(UnknownElement.jav
a:83)
        at org.apache.tools.ant.Task.perform(Task.java:216)
        at org.apache.tools.ant.Target.execute(Target.java:164)
        at org.apache.tools.ant.Target.performTasks(Target.java:182)
        at org.apache.tools.ant.Project.executeTarget(Project.java:601)
        at org.apache.tools.ant.Project.executeTargets(Project.java:560)
        at org.apache.tools.ant.Main.runBuild(Main.java:454)
        at org.apache.tools.ant.Main.start(Main.java:153)
        at org.apache.tools.ant.Main.main(Main.java:176)

Here is the nested exception:

java.lang.NoClassDefFoundError: junit/framework/TestListener
        at java.lang.ClassLoader.defineClass0(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:486)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:11
1)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:248)
        at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:297)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:286)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:253)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:313)
        at java.lang.Class.newInstance0(Native Method)
        at java.lang.Class.newInstance(Class.java:237)
        at org.apache.tools.ant.Project.createTask(Project.java:486)
        at org.apache.tools.ant.UnknownElement.makeTask(UnknownElement.java:148)

        at org.apache.tools.ant.UnknownElement.maybeConfigure(UnknownElement.jav
a:83)
        at org.apache.tools.ant.Task.perform(Task.java:216)
        at org.apache.tools.ant.Target.execute(Target.java:164)
        at org.apache.tools.ant.Target.performTasks(Target.java:182)
        at org.apache.tools.ant.Project.executeTarget(Project.java:601)
        at org.apache.tools.ant.Project.executeTargets(Project.java:560)
        at org.apache.tools.ant.Main.runBuild(Main.java:454)
        at org.apache.tools.ant.Main.start(Main.java:153)
        at org.apache.tools.ant.Main.main(Main.java:176)

Mime
View raw message