ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Murphy, Tom (T06)" <Thomas.Mur...@ngc.com>
Subject RE: junit problem
Date Thu, 17 Jul 2003 11:20:55 GMT
Don't know if your problem is similar to mine.  (Ant couldn't properly read
my environment variable for some reason, so I renamed it to something else.)
Try running with -debug flag and check that Ant is indeed picking up
ANT_HOME correctly.  Also, it looks like you're building a project inside
the directory where you installed JUnit.  Maybe the build process should
take place in a separate directory.

HTH


-----Original Message-----
From: Jimmy Han [mailto:jhan@cisco.com] 
Sent: Wednesday, July 16, 2003 1:15 PM
To: Ant Users List
Subject: Re: junit problem


I tried your suggestion, it does not work. Thanks anyway.

-
Jimmy

----- Original Message -----
From: "½É¿ì°ï" <startear@empal.com>
To: "Ant Users List" <user@ant.apache.org>
Sent: Tuesday, July 15, 2003 4:34 PM
Subject: Re: junit problem


> 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(jhan@cisco.com)
>   To  : user@ant.apache.org
>  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: user-unsubscribe@ant.apache.org
> >For additional commands, e-mail: user-help@ant.apache.org
>
>
>
>
> ---------------------------------------------------------------------
> Get your own 30MB free email at http://www.empal.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message