You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by "Igor A. Deruga" <in...@hotbox.ru> on 2004/11/13 12:50:25 UTC

Ant+JUnit

I know that this question has been asked hundreds times, but I can't find a 
single document on it... Maybe you can redirect me?

I'm using Eclipse+Ant. I've added these lines into build.xml:
//----------------------------------XML-------------------------------
	<target name="test" description="Launch JUnit tests" depends="compile">
		<junit>
			<test name="src.server.test.impl.IMServerImplTest"/>
		</junit>
	</target>

When I try to run the target "test", it says: 
//----------------------------------End of XML-------------------------------
compile:
test:
BUILD FAILED: /home/ingvarr/bin/eclipse/workspace/openim/build.xml:39: Could 
not create task or type of type: junit.

Ant could not find the task or a class this task relies upon.
//----------------------------------End of Log-------------------------------

Do I need to specify any classpath elements to run this particular tasks? All 
the other tasks that I've used (javac, jar, mkdir) are working fine. 

Any ideas on this problem?

Sincerely
	Igor

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


Re: Ant+JUnit

Posted by Martijn Kruithof <jm...@kruithof.xs4all.nl>.
Igor A. Deruga wrote:

>I know that this question has been asked hundreds times, but I can't find a 
>single document on it... Maybe you can redirect me?
>
>I'm using Eclipse+Ant. I've added these lines into build.xml:
>//----------------------------------XML-------------------------------
>	<target name="test" description="Launch JUnit tests" depends="compile">
>		<junit>
>			<test name="src.server.test.impl.IMServerImplTest"/>
>		</junit>
>	</target>
>
>When I try to run the target "test", it says: 
>//----------------------------------End of XML-------------------------------
>compile:
>test:
>BUILD FAILED: /home/ingvarr/bin/eclipse/workspace/openim/build.xml:39: Could 
>not create task or type of type: junit.
>
>Ant could not find the task or a class this task relies upon.
>//----------------------------------End of Log-------------------------------
>
>Do I need to specify any classpath elements to run this particular tasks? All 
>the other tasks that I've used (javac, jar, mkdir) are working fine. 
>
>Any ideas on this problem?
>
>Sincerely
>	Igor
>  
>
Yes, you need to specify the junit.jar on your classpath, or you can put 
it in ants lib dir.
See also:
http://ant.apache.org/manual/install.html#optionalTasks

Kind regards, Martijn

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