ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aaron Kamienski <>
Subject Re: [POLL] JUnit Users
Date Mon, 16 Jul 2001 20:49:02 GMT
I don't think that changes to ant (i.e., lazy instantiation of all
elements/attributes) are necessary.  I would think that just making 
the task class(es) not dependent on Xalan, such that a failure to find
Xalan results in a failure to load, should be sufficient.

The JUnit task doesn't have this problem.  If JUnit isn't 
available, I don't get a class-not-found exception.  Instead,
I am notified by my target that checks for JUnit availability.
The formatter and batchtest sub-elements don't cause the same
problem that report does...

  <target name="check-junit-avail"
    <fail message="The JUnit testing framework is required for testing.
Ensure that JUnit is available on the CLASSPATH.
  <target name="check_availability">
    <available classname="junit.framework.TestCase"

I would think that lazy (or at least lazier) reference of Xalan
should be possible and that could fix the problem.  It would be
nice if any redesign of the junitreport task fixed this little 
annoyance along the way.

thanks for listening,


Stephane Bailliez wrote:
> > -----Original Message-----
> > From: Aaron Kamienski []
> > I had asked about this previously on the list but got no reply.
> > It seems (to me) to be a problem with the design, so if that's being
> > reworked, there might be hope...
> Ah sorry, I did not see your mail.
> > I would like to be able to only do the report if Xalan is available.
> > I currently can do this as long as I don't include a <report>
> > sub-element like so:
> [...]
> I understand your problem.
> Actually, this is because the build file resolution is done at startup, thus
> if some instantiated classes related to attributes or elements import
> classes that do not exist it will fail. Even if you do not call the task.
> One solution is to do a lazy instantiation in all elements/attributes, but
> it is not that simple in all cases. In your case, if you do not add the
> <report> element it will work fine just due to this behavior.
> --
>  Stephane Bailliez
>  Software Engineer, Paris - France
>  iMediation -
>  Disclaimer: All the opinions expressed above are mine and not those from my
> company.

Aaron Kamienski <>
SNAP2 Corporation

View raw message