Dear Han,

My suggestion is:

<?xml version="1.0"?>

<project basedir="." default="test">

<property name="build.sysclasspath" value="ignore"/>

<property environment="env"/> <!-- use environment variable -->
<property name="classes" value="." />
<property name="junit.jar" value="${env.ANT_HOME}/lib/junit.jar"/>

<property name="test.class.name" value="junit.samples.AllTests" />

<path id="test.classpath">
  <pathelement location="${classes}" />
  <pathelement location="${junit.jar}" />
</path>

<target name="test">
  <junit fork="yes" haltonfailure="yes">
    <test name="${test.class.name}" />
    <formatter type="plain" usefile="false" />
    <classpath refid="test.classpath" />
  </junit>
</target>
</project>



---------- Original Message ----------
 From : Jimmy Han([EMAIL PROTECTED])
  To  : [EMAIL PROTECTED]
 Sent : Wednesday, Jul 16, 2003 07:59 AM
 Subject : junit problem

> I know this has been asked for manu times. I have read these replies in
>the archieve. But I still could not fix the problem. Help is really needed.
>
>I am using Windows2000.
>I installed junit to my d:\junit3.8.1, and created a build.xml files like
>this:
>
>D:\junit3.8.1>type build.xml
><?xml version="1.0"?>
>
><project basedir="." default="test">
>
><property name="classes" value="." />
><property name="test.class.name" value="junit.samples.AllTests" />
>
><path id="test.classpath">
>  <pathelement location="${classes}" />
>  <pathelement location="./junit.jar" />
></path>
>
><target name="test">
>  <junit fork="yes" haltonfailure="yes">
>    <test name="${test.class.name}" />
>    <formatter type="plain" usefile="false" />
>    <classpath refid="test.classpath" />
>  </junit>
></target>
></project>
>
>I copied junit.jar to my %ANT_HOME%\lib directory
>
>D:\junit3.8.1>env | grep ANT
>ANT_HOME=D:\jwsdp-1.2\apache-ant
>
>D:\junit3.8.1>cd \jwsdp-1.2\apache-ant\lib
>
>D:\jwsdp-1.2\apache-ant\lib>dir
> Volume in drive D is DATA
> Volume Serial Number is 60C0-2B06
>
> Directory of D:\jwsdp-1.2\apache-ant\lib
>
>07/14/2003  12:24p      <DIR>          .
>07/14/2003  12:24p      <DIR>          ..
>05/30/2003  05:53a             735,451 ant.jar
>09/04/2002  11:29p             121,070 junit.jar
>05/30/2003  05:54a             424,231 optional.jar
>               3 File(s)      1,280,752 bytes
>
>When I run ant test, I still got that error:
>D:\jwsdp-1.2\apache-ant\lib>cd \junit3.8.1
>
>D:\junit3.8.1>which ant
>d:\jwsdp-1.2\apache-ant\bin/ant.bat
>
>D:\junit3.8.1>ant test
>Buildfile: build.xml
>
>test:
>
>BUILD FAILED
>file:D:/junit3.8.1/build.xml:14: 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
>...
>
>Any idea?
>
>-
>Jimmy
>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
Get your own 30MB free email at http://www.empal.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to