ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lothar Krenzien <>
Subject Re: running junit from ant
Date Mon, 16 Jan 2006 16:39:55 GMT

> > I can't believe it because the test target depends on the compile
> > target and I included the output dir (where the compiler stores the
> > classes) in my classpath. In the debug output I can see that the
> > classes are really included.
> > 
> >     [junit] '-classpath' ...
> >     W:\deployment\web\WEB-INF\classes\sr2\test\imports\TestImportAlarm.class
> >     ... 
> The classes are not supposed to be on the classpath, the root of the
> class hierarchy is.  So if your class is not inside of a package,
> W:\deployment\web\WEB-INF\classes\sr2\test\imports must be on the
> classpath, not the class file.
> Stefan

It was just a line from the ant debug output. In fact I have included the root of my classes
in the classpath. So my classpath actually looks like:

	<path id="class.path">
		<pathelement path="${java.class.path}"/>
		<fileset file="${tomcat.dir}/bin/bootstrap.jar"/>
		<fileset dir="${ant.dir}/lib"> 
			<include name="*.jar"/>			
		<fileset dir="${tomcat.dir}/server/lib"> 
			<include name="*.jar"/>			
		<fileset dir="${tomcat.dir}/common/lib">
			<include name="*.jar"/>
		<fileset dir="${web.dir}/WEB-INF/lib">
			<include name="*.jar"/>
		<fileset dir="conf/tomcat/common/lib">
			<include name="*.jar"/>
		<fileset dir="${out.dir}/web/WEB-INF/classes">
			<include name="**/*.class"/>

And as I said earlier I tried also using the package name and even only the classname as test
But I have notified that I have two junit.jars in the above classpath. One in the ANT/lib
dir (so that Ant knows of the junit task) and one in the project classpath (WEB-INF/lib) .
Could that cause any problems ? Additionally I've now found a good book about Junit and Ant.
Maybe I can get working it now  ;).


XXL-Speicher, PC-Virenschutz, Spartarife & mehr: Nur im WEB.DE Club!		
Jetzt gratis testen!

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message