ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave <dwal...@users.sourceforge.net>
Subject Help with JUNit task
Date Sat, 10 Mar 2001 04:49:24 GMT
I know many others have asked this same question. I've looked at the
responses they've gotten, but I can't figure it out. I had junit tests
working with ant 1.2, but they aren't working with 1.3.

Yes, I'm getting the "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)." problem.

I am out of ideas for where to put optional.jar and junit.jar. I've got
them everywhere! Can one of you please help me figure this out.

My ant command (after modifying the ant file in /usr/bin) is this:

java -classpath
/usr/share/java/ant.jar:/usr/share/java/jaxp.jar:/usr/share/java/optional.jar:/usr/share/java/parser.jar:/usr/local/java/junit/junit.jar:/usr/java/jdk1.3.1/lib/tools.jar:/usr/java/jdk1.3.1/jre/lib/rt.jar:/usr/java/jdk1.3.1/jre/lib/rt.jar
-Dant.home=/usr/share/ant org.apache.tools.ant.Main

/usr/share/ant/lib contains junit.jar and optional.jar , which I believe
matches the instructions in
file:/home/httpd/html/manual/ant/manual/install.html .

The task is:

        <target name="test-support" depends="support-test">

         <echo message="${test-class-path}:${java.class.path}" />
         <junit printsummary="yes" fork="yes" haltonfailure="yes"
dir="${src}/support/javahelp/property/test">
          <jvmarg value="-Djava.compiler=NONE"/>
          <jvmarg
value="-Dlyophil.properties=${src}/support/javahelp/property/test/lyophil.properties"/>

          <formatter type="plain" usefile="no"/>
          <classpath>
           <pathelement path="${java.class.path}" />
           <pathelement path="${test-class-path}" />
          </classpath>
          <test name="javahelp.test.JavaHelpTests" />
         </junit>

        </target>

The classpath for that is:
/usr/local/java/junit/junit.jar:/usr/local/java/extensions/jdbc2.0ext/jdbc2_0-stdext.jar:/usr/local/java/idb/Classes/idb.jar:/usr/local/java/idb/Classes/idbexmpl.jar:/usr/local/java/extensions/jdbc2.0ext/jdbc2_0-stdext.jar:/usr/local/java/extensions/jta-spec1_0_1/jta-spec1_0_1.jar:/usr/local/java/jonas/lib/RMI_jonas.jar:/usr/local/java/jonas/lib/ejb.jar:/usr/local/java/extensions/jndi/lib/jndi.jar:/usr/local/java/extensions/jndi/lib/providerutil.jar:/usr/local/java/extensions/jndi/lib/rmiregistry.jar:production/dist/lib/tools.jar:production/dist/lib/support.jar:production/dist/lib/lyophil-core.jar:production/dist/lib/lyophil-mem.jar:production/dist/lib/lyophil-jdbc20.jar:production/dist/lib/lyophil-instantdb-3-26.jar:production/dist/lib/lyophil-ejb11.jar:production/dist/lib/support-test.jar:production/dist/lib/lyophil-core-test.jar:production/dist/lib/lyophil-mem-test.jar:production/dist/lib/lyophil-jdbc20-test.jar:production/dist/lib/lyophil-ejb11-jonas.jar:production/dist/lib/lyophil-ejb11-test.jar:production/dist/lib/lyophil-ejb11-jonas-test.jar:/usr/local/java/junit/junit.jar:/usr/share/ant/lib/optional.jar:/usr/share/java/ant.jar:/usr/share/java/jaxp.jar:/usr/share/java/optional.jar:/usr/share/java/parser.jar:/usr/local/java/junit/junit.jar:/usr/java/jdk1.3.1/lib/tools.jar:/usr/java/jdk1.3.1/jre/lib/rt.jar:/usr/java/jdk1.3.1/jre/lib/rt.jar

junit.jar is in this path three times, and optional.jar is in it twice.
And it doesn't work.

What's set wrong?

Thanks,

Dave


Mime
View raw message