You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by ex...@nokia.com on 2009/01/27 14:27:35 UTC

AntUnit

Hi,

How can I run antunit with custom ant listeners enabled?

Thanks


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


Re: AntUnit

Posted by Stefan Bodewig <bo...@apache.org>.
On 2009-01-28, <Ja...@rzf.fin-nrw.de> wrote:

>> file:///C:/OSS/ant/docs/manual/develop.html#writingowntask

> Because I am sure you dont have access to Stefans computer, here the
> official link ;-)
> http://ant.apache.org/manual/develop.html#writingowntask

Ouch, thanks ;-)

Stefan

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


AW: AntUnit

Posted by Ja...@rzf.fin-nrw.de.
>I mean a class implementing org.apache.tools.ant.BuildListener

You dont add a BuildListener to a JUnit or AntUnit run. You will attach
it to the whole build.
For that use the -logger option of Ant.


Jan

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


Re: AntUnit

Posted by Stefan Bodewig <bo...@apache.org>.
On 2009-01-28, <ex...@nokia.com> wrote:

> The listener needs to know what targets are being executed so having
> the log output is no help.

which test target or any other target as well?

In the former case you could still implement your AntUnit listener, in
the later case we really have a use case that isn't covered at all by
AntUnit right now.

Stefan

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


RE: AntUnit

Posted by ex...@nokia.com.
Hi,

The listener needs to know what targets are being executed so having the log output is no help.

Thanks

> -----Original Message-----
> From: ext Stefan Bodewig [mailto:bodewig@apache.org]
> Sent: 28 January 2009 16:16
> To: user@ant.apache.org
> Subject: Re: AntUnit
>
> On 2009-01-28, <ex...@nokia.com> wrote:
>
> > We are testing something that requires the listener to be
> > running. Listeners don't seem to run when calling antunit
>
> This is true.  The project instance running the AntUnit test target
> doesn't have any BuildListeners attached to it (other than AntUnit's
> own listeners, that is).
>
> This is a use case AntUnit doesn't fully cover.  The dev list (even
> more silent than this user list) may be the better place to discuss
> how AntUnit could be enhanced to help your case.
>
> Does it help your case if you attach a plainlistener with setting
> logLevel to something other than none?  That way the log of the
> project under test gets back to the project running the AntUnit task
> and then to your BuildListener.
>
> Would https://issues.apache.org/bugzilla/show_bug.cgi?id=43582 improve
> the situation in your case?
>
> > or <ant dir="project" target="test"/>.
>
> At least since Ant 1.6.2 this should make the new project inherit the
> listeners of the calling project.
>
> Stefan
>
> ---------------------------------------------------------------------
> 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


Re: AntUnit

Posted by Stefan Bodewig <bo...@apache.org>.
On 2009-01-28, <ex...@nokia.com> wrote:

> We are testing something that requires the listener to be
> running. Listeners don't seem to run when calling antunit

This is true.  The project instance running the AntUnit test target
doesn't have any BuildListeners attached to it (other than AntUnit's
own listeners, that is).

This is a use case AntUnit doesn't fully cover.  The dev list (even
more silent than this user list) may be the better place to discuss
how AntUnit could be enhanced to help your case.

Does it help your case if you attach a plainlistener with setting
logLevel to something other than none?  That way the log of the
project under test gets back to the project running the AntUnit task
and then to your BuildListener.

Would https://issues.apache.org/bugzilla/show_bug.cgi?id=43582 improve
the situation in your case?

> or <ant dir="project" target="test"/>.

At least since Ant 1.6.2 this should make the new project inherit the
listeners of the calling project.

Stefan

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


RE: AntUnit

Posted by ex...@nokia.com.
Hi,

We are testing something that requires the listener to be running. Listeners don't seem to run when calling antunit or <ant dir="project" target="test"/>.

Thanks

> -----Original Message-----
> From: ext Stefan Bodewig [mailto:bodewig@apache.org]
> Sent: 28 January 2009 13:29
> To: user@ant.apache.org
> Subject: Re: AntUnit
>
> On 2009-01-28, <ex...@nokia.com> wrote:
>
> > I mean a class implementing org.apache.tools.ant.BuildListener
>
> you don't, like <junit> <antunit> has a different listener concept of
> its own.
>
> What are you trying to do that doesn't work as you'd want it to?
>
> Stefan
>
> ---------------------------------------------------------------------
> 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


Re: AntUnit

Posted by Stefan Bodewig <bo...@apache.org>.
On 2009-01-28, <ex...@nokia.com> wrote:

> I mean a class implementing org.apache.tools.ant.BuildListener

you don't, like <junit> <antunit> has a different listener concept of
its own.

What are you trying to do that doesn't work as you'd want it to?

Stefan

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


RE: AntUnit

Posted by ex...@nokia.com.
Hi,

I mean a class implementing org.apache.tools.ant.BuildListener

Thanks

> -----Original Message-----
> From: ext Jan.Materne@rzf.fin-nrw.de [mailto:Jan.Materne@rzf.fin-nrw.de]
> Sent: 28 January 2009 12:22
> To: user@ant.apache.org
> Subject: AW: AntUnit
>
> >> How can I run antunit with custom ant listeners enabled?
> >
> >A "custom Ant listener" is a class implementing
> >org.apache.ant.antunit.AntUnitListener?
> >
> >If so, use <typedef> to give a symbolic name to your custom listener,
> >say
> >
> ><typedef name="customListener"
> >         classname="my.custom.Listener"/>
> >
> >and maybe throw in classpath attributes and an uri.
> >
> >After that, you attach it to AntUnit via
> >
> ><au:antunit ...>
> >  <customListener/>
> ></au:antunit>
> >
> >If your custom listener needs configuration you can use setter and add
> >methods and ant will translate them into attributes and nested
> >elements just like it does for any other task and type, see
> >file:///C:/OSS/ant/docs/manual/develop.html#writingowntask
>
>
> Because I am sure you dont have access to Stefans computer, here the
> official link ;-)
> http://ant.apache.org/manual/develop.html#writingowntask
>
>
> Jan
>
> ---------------------------------------------------------------------
> 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


AW: AntUnit

Posted by Ja...@rzf.fin-nrw.de.
>> How can I run antunit with custom ant listeners enabled?
>
>A "custom Ant listener" is a class implementing
>org.apache.ant.antunit.AntUnitListener?
>
>If so, use <typedef> to give a symbolic name to your custom listener,
>say
>
><typedef name="customListener"
>         classname="my.custom.Listener"/>
>
>and maybe throw in classpath attributes and an uri.
>
>After that, you attach it to AntUnit via
>
><au:antunit ...>
>  <customListener/>
></au:antunit>
>
>If your custom listener needs configuration you can use setter and add
>methods and ant will translate them into attributes and nested
>elements just like it does for any other task and type, see
>file:///C:/OSS/ant/docs/manual/develop.html#writingowntask


Because I am sure you dont have access to Stefans computer, here the
official link ;-)
http://ant.apache.org/manual/develop.html#writingowntask


Jan

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


Re: AntUnit

Posted by Stefan Bodewig <bo...@apache.org>.
On 2009-01-27, <ex...@nokia.com> wrote:

> How can I run antunit with custom ant listeners enabled?

A "custom Ant listener" is a class implementing
org.apache.ant.antunit.AntUnitListener?

If so, use <typedef> to give a symbolic name to your custom listener,
say

<typedef name="customListener"
         classname="my.custom.Listener"/>

and maybe throw in classpath attributes and an uri.

After that, you attach it to AntUnit via

<au:antunit ...>
  <customListener/>
</au:antunit>

If your custom listener needs configuration you can use setter and add
methods and ant will translate them into attributes and nested
elements just like it does for any other task and type, see
file:///C:/OSS/ant/docs/manual/develop.html#writingowntask

Stefan

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