Proposed new methods for ITestResult

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Proposed new methods for ITestResult

pmendelson2

I would like to provide an additional hook to allow custom listeners
to manage data on a test by test basis.

Specifically I would like to create
   void ITestResult.setAttribute(String key,Object value)
   Object ITestResult.setAttribute(String key)

These methods are analogous to methods in the ServletRequest world.  A
custom listener can use them to squirrel away information in an early
point of the test life cycle and refer back to it at a later point in
the test life cycle.

Based on my current understanding I think this would be fairly easy to
implement.  Before I do it I would like some feedback on if it fits
with the larger view of how TestNG should work and if there is a
better mechanism to do this (either in production or on the drawing
board)?


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "testng-dev" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/testng-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: Proposed new methods for ITestResult

Hani Suleiman

I definitely like the idea of allow custom data to flow through.  
Wouldn't this be more generic though and useful if it were added to  
ITestContext instead? You could then store test specific information  
as well as easily pass random info from one test to another.

On Feb 26, 2007, at 9:14 AM, Paul wrote:

>
> I would like to provide an additional hook to allow custom listeners
> to manage data on a test by test basis.
>
> Specifically I would like to create
>    void ITestResult.setAttribute(String key,Object value)
>    Object ITestResult.setAttribute(String key)
>
> These methods are analogous to methods in the ServletRequest world.  A
> custom listener can use them to squirrel away information in an early
> point of the test life cycle and refer back to it at a later point in
> the test life cycle.
>
> Based on my current understanding I think this would be fairly easy to
> implement.  Before I do it I would like some feedback on if it fits
> with the larger view of how TestNG should work and if there is a
> better mechanism to do this (either in production or on the drawing
> board)?
>
>
> >


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "testng-dev" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/testng-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: Proposed new methods for ITestResult

Cédric Beust ♔
Agree with both of you.

Paul, would it work for you if these methods were added to ITestContext, as Hani suggested?

--
Cedric


On 2/26/07, Hani Suleiman <[hidden email]> wrote:

I definitely like the idea of allow custom data to flow through.
Wouldn't this be more generic though and useful if it were added to
ITestContext instead? You could then store test specific information
as well as easily pass random info from one test to another.

On Feb 26, 2007, at 9:14 AM, Paul wrote:

>
> I would like to provide an additional hook to allow custom listeners
> to manage data on a test by test basis.
>
> Specifically I would like to create
>    void ITestResult.setAttribute(String key,Object value)
>    Object ITestResult.setAttribute(String key)
>
> These methods are analogous to methods in the ServletRequest world.  A
> custom listener can use them to squirrel away information in an early
> point of the test life cycle and refer back to it at a later point in
> the test life cycle.
>
> Based on my current understanding I think this would be fairly easy to
> implement.  Before I do it I would like some feedback on if it fits
> with the larger view of how TestNG should work and if there is a
> better mechanism to do this (either in production or on the drawing
> board)?
>
>
> >

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "testng-dev" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/testng-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: Proposed new methods for ITestResult

pmendelson2

Where to put it is a good question.  I realize that I have never seen
a UML diagram of how these objects fit together.  I think I can get to
ITestContext from ITestResult as well as the reverse.

The use I have in mind is to log events as they happen into a list in
my Test result and then have my reporter slog through my last at the
end.

I will try to do something this week and see how people like it.

I plan to find the classes that implement the interface by adding the
method and seeing what doesn't compile.

On a tangent, I would like to know if http://testng.org/doc/documentation-main.html
is considered part of the code and what is the procedure / policy for
proposing changes to it?

On Feb 26, 10:51 am, "Cédric Beust ♔ " <[hidden email]> wrote:

> Agree with both of you.
>
> Paul, would it work for you if these methods were added to ITestContext, as
> Hani suggested?
>
> --
> Cedric
>
> On 2/26/07, Hani Suleiman <[hidden email]> wrote:
>
>
>
>
>
> > I definitely like the idea of allow custom data to flow through.
> > Wouldn't this be more generic though and useful if it were added to
> > ITestContext instead? You could then store test specific information
> > as well as easily pass random info from one test to another.
>
> > On Feb 26, 2007, at 9:14 AM, Paul wrote:
>
> > > I would like to provide an additional hook to allow custom listeners
> > > to manage data on a test by test basis.
>
> > > Specifically I would like to create
> > >    void ITestResult.setAttribute(String key,Object value)
> > >    Object ITestResult.setAttribute(String key)
>
> > > These methods are analogous to methods in the ServletRequest world.  A
> > > custom listener can use them to squirrel away information in an early
> > > point of the test life cycle and refer back to it at a later point in
> > > the test life cycle.
>
> > > Based on my current understanding I think this would be fairly easy to
> > > implement.  Before I do it I would like some feedback on if it fits
> > > with the larger view of how TestNG should work and if there is a
> > > better mechanism to do this (either in production or on the drawing
> > > board)?
>
> --
> Cédric


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "testng-dev" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/testng-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: Proposed new methods for ITestResult

Cédric Beust ♔


On 2/26/07, Paul <[hidden email]> wrote:

Where to put it is a good question.  I realize that I have never seen
a UML diagram of how these objects fit together.  I think I can get to
ITestContext from ITestResult as well as the reverse.

The use I have in mind is to log events as they happen into a list in
my Test result and then have my reporter slog through my last at the
end.

I will try to do something this week and see how people like it.

I plan to find the classes that implement the interface by adding the
method and seeing what doesn't compile.

Or you could just use an IDE :-) 

On a tangent, I would like to know if http://testng.org/doc/documentation-main.html
is considered part of the code and what is the procedure / policy for
proposing changes to it?

So far, I've pretty much been the only one modifying it.  I don't mind writing up the documentation, you can just send me a few notes of what I should update and I'll flesh it out and update the web site when we release the next version.

--
Cédric
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "testng-dev" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/testng-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: Proposed new methods for ITestResult

pmendelson2

I just implemented setAttribute and getAttribute method in
ITestContext / TestRunner and it seems to work fairly cleanly.  For
the application of this feature that I am imagining it would be more
useful to implement inside the ITestResult which tracks an individual
thread through a test.  As I peek through the reporter code it seems
like that it is less than trivial for the reporter to match up with.

I need advise on how the setAttribute method can map up the caller
with the right testing invocation (ITestResult) that is being
processed or is that just not the way that TestNG works?

On Feb 26, 1:22 pm, "Cédric Beust ♔ " <[hidden email]> wrote:

> On 2/26/07, Paul <[hidden email]> wrote:
>
>
>
> > Where to put it is a good question.  I realize that I have never seen
> > a UML diagram of how these objects fit together.  I think I can get to
> > ITestContext from ITestResult as well as the reverse.
>
> > The use I have in mind is to log events as they happen into a list in
> > my Test result and then have my reporter slog through my last at the
> > end.
>
> > I will try to do something this week and see how people like it.
>
> > I plan to find the classes that implement the interface by adding the
> > method and seeing what doesn't compile.
>
> Or you could just use an IDE :-)
>
> On a tangent, I would like to know if
>
> >http://testng.org/doc/documentation-main.html
> > is considered part of the code and what is the procedure / policy for
> > proposing changes to it?
>
> So far, I've pretty much been the only one modifying it.  I don't mind
> writing up the documentation, you can just send me a few notes of what I
> should update and I'll flesh it out and update the web site when we release
> the next version.
>
> --
> Cédric


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "testng-dev" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/testng-dev?hl=en
-~----------~----~----~----~------~----~------~--~---