You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Mi...@amsinc.com on 2001/08/21 19:27:49 UTC

Problem using junit with ant 1.5 nightly builds




When I try to use ant to run a junit test (with the optional.jar in my
ANT_HOME/lib directory and junit.jar in my classpath, this script:


    <target name="unit.test">
        <junit haltonfailure="yes">
            <classpath refid="project.class.path.ref"/>
            <test
name="test.com.ams.icsg.acq.security.SecurityAndConnectivityTest"
haltonfailure="yes" outfile="result" >
                <formatter type="xml" />
            </test>
        </junit>
    </target>


generates this error:
Buildfile: build.xml

unit.test:
BUILD FAILED

Could not create task of type: junit. Common solutions are to use taskdef to
declare your task, or, if this is an optional task, to put the optional.jar in
the lib directory of your ant installation (ANT_HOME).

Total time: 1 second

I've looked through all the documentation on the optional junit task, and can't
seem to see the errors of my ways.  The optional jar is definitely getting into
the classpath:
localcp =
D:\JDK1.3.1\lib\tools.jar;D:\jakarta-ant-1.5alpha\lib\optional.jar;D:\jakarta-ant-1.5alpha\lib\jaxp.jar;D:\jakarta-ant-1.5alpha\lib\crimson.jar;D:\jakarta-ant-1.5alpha\lib\ant.jar;d:\sybase\jConnect-5_5\classes\jconn2.jar;d:\pd50dev\lib\deploy\crypto-all.jar;d:\pd50dev\lib\deploy\log4j.jar;d:\pd50dev\lib\deploy\concurrent.jar;d:\pd50dev\lib\deploy\jakarta-regexp-1.2.jar;d:\pd50dev\lib\deploy\event-api.jar


Any help would be appreciated.  Thanks.

-----------------------------------------------------
Michael Stopper
Senior Principal / SPS Technical Architect
American Management Systems, Inc.
4114 Legato Road
Fairfax, Virginia  22033
703.227.6646 Office
703.227.4696 FAX
mailto:Michael.Stopper@ams.com



Re: Problem using junit with ant 1.5 nightly builds

Posted by Stefan Bodewig <bo...@apache.org>.
On Tue, 21 Aug 2001, Mike Stopper <Mi...@amsinc.com> wrote:

> When I try to use ant to run a junit test (with the optional.jar in
> my ANT_HOME/lib directory and junit.jar in my classpath, this
> script

Could you check optional.jar whether it actually contains classes in
the org.apache.tools.ant.taskdefs.optional.junit package?  The machine
doing the nightly builds may not be able to build all optional tasks.

Right now I'd recommend using 1.4beta2 over the nightly builds anyway,
as the 1.5 branch isn't very active ATM and bugs get fixed in the 1.4
branch first.

Stefan