ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From KC Baltz <KBa...@responsenetworks.com>
Subject RE: JunitTask and classpath
Date Fri, 23 Mar 2001 21:03:26 GMT
Just yesterday, I did exactly what you describe, using JWhich from that
Javatip.  I found a couple of things useful.

1) Try calling JWhich from inside you build.xml using a <java> task.  Use
the classpath you are using for your junit task and make the <arg> the
resource you are trying to locate.  Also play around with fork="yes|no" to
see the effect it has.

2) Embed a call to JWhich in the constructor of your test and have it try to
locate this resource.

K.C.

> -----Original Message-----
> From: Danil Suits [mailto:DSuits@kana.com]
> Sent: Friday, March 23, 2001 11:55 AM
> To: 'ant-user@jakarta.apache.org'
> Subject: JunitTask and classpath
> 
> 
> 
> Objective: to be able to report which resource was used to 
> load a particular
> class when a testcase failed.
> 
> http://www.javaworld.com/javaworld/javatips/jw-javatip105.html
> gave me the hints that I needed to get the general idea of 
> how to identify
> the resource used to load a file.
> 
> This is working, up to a point.  I can find some classes, but 
> not those that
> I am interested in.  My current hypothesis is that 
> getResource is tracking
> down those classes which are available via
> System.getProperty("java.class.path"), but not those which were made
> available via the nested <classpath> element.
> 
> [Clarification: the classes are available - the test itself 
> runs as I expect
> it too - I'm simply unable to extract the information I want from it].
> 
> Any suggestions on how to find which class/jar file is providing the
> implementation of a class within the running TestCase (preferred are
> solutions which will still work when the test is running 
> outside of the
> junit task).
> 
> Danil
> 

Mime
View raw message