[testng-dev] Setting XmlSuite/XmlTest properties in listeners

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

[testng-dev] Setting XmlSuite/XmlTest properties in listeners

Pawel Kowalski
Hi TestNg developers,
 
I have question regarding convention/strategy how  properties of XmlSuite/XmlTest should behave when modified in listener.
I see some inconsistency there, let's consider three properties that I'm actually interested in:
  • group-by-instance - when changed in ISuiteListener by invoking appropriate  setter in XmlSuite then new value will be used during the suite execution, for me cool :)
  • preserve-order - when changed in ISuiteListener by invoking appropriate  setter in XmlSuite/XmlTest, the change will be applied partially. New value will be read from test/suite instance when building dynamic graph to execute, but the method interceptor which depends on this property value is memorised as a  member of TestRunner class and created during TestRunner object construction  before listeners are called, so interceptor will never be changed even when the value of property has been changed.
  • configFailurePolicy - this value's change, even when  XmlSuite provides in API setter to do so, will not be taken into consideration during test execution since it is memorised as a member of Invoker class which instance  is created during TestRunner construction before listeners are called
My questions are:
Should each property value be "dynamic" ? Maybe none of them? Or should it depend, how it is now?

Actually I'm interested in first option, everything should be "dynamic" and applied when value is changed in listener.
What do you think, are you OK with this ?
 
Regards,
Paweł Kowalski

--
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: [testng-dev] Setting XmlSuite/XmlTest properties in listeners

Cédric Beust ♔-2
Hi Pawel,

This is a bit of a sticky point: I  never meant for anything to be modifiable from within a listener, but I never took steps against it (e.g. passing immutable contexts) so of course... users went ahead and modified them.

Unsurprisingly, the results from doing that are fairly inconsistent, sometimes the change works and sometimes it doesn't do anything.

Since we've reached that point, I think it's too late to revert course and make everything mutable, so we should probably try to make the mutable case work as often as possible. Doing so might lead you down a rabbit hole,  though, so my suggestion to you is: if you can make certain properties work with little effort, go ahead but if it starts taking you too long and it impacts the core too much, then forget about it.

For these cases, we could consider making sure these values were not altered by a listener and throw an exception if they were, not sure if it's worth it.

-- 
Cédric




On Thu, Jan 19, 2012 at 12:48 PM, Pawel Kowalski <[hidden email]> wrote:
Hi TestNg developers,
 
I have question regarding convention/strategy how  properties of XmlSuite/XmlTest should behave when modified in listener.
I see some inconsistency there, let's consider three properties that I'm actually interested in:
  • group-by-instance - when changed in ISuiteListener by invoking appropriate  setter in XmlSuite then new value will be used during the suite execution, for me cool :)
  • preserve-order - when changed in ISuiteListener by invoking appropriate  setter in XmlSuite/XmlTest, the change will be applied partially. New value will be read from test/suite instance when building dynamic graph to execute, but the method interceptor which depends on this property value is memorised as a  member of TestRunner class and created during TestRunner object construction  before listeners are called, so interceptor will never be changed even when the value of property has been changed.
  • configFailurePolicy - this value's change, even when  XmlSuite provides in API setter to do so, will not be taken into consideration during test execution since it is memorised as a member of Invoker class which instance  is created during TestRunner construction before listeners are called
My questions are:
Should each property value be "dynamic" ? Maybe none of them? Or should it depend, how it is now?

Actually I'm interested in first option, everything should be "dynamic" and applied when value is changed in listener.
What do you think, are you OK with this ?
 
Regards,
Paweł Kowalski

--
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.

--
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: [testng-dev] Setting XmlSuite/XmlTest properties in listeners

Pawel Kowalski
For the cases I mentioned I think it will not be big effort to make them mutable and it shuldn't affect core, I'll see.
In my opinion making some of them mutable would make some users happier but for sure nobody will complain :)
Actually for me as an user it was obvious that a can modify them  since the API allow it, and not working cases considered as a bugs, but now I see that mutability is not a feature but side effect :)
 
Regs,
Pawel

2012/1/19 Cédric Beust ♔ <[hidden email]>
Hi Pawel,

This is a bit of a sticky point: I  never meant for anything to be modifiable from within a listener, but I never took steps against it (e.g. passing immutable contexts) so of course... users went ahead and modified them.

Unsurprisingly, the results from doing that are fairly inconsistent, sometimes the change works and sometimes it doesn't do anything.

Since we've reached that point, I think it's too late to revert course and make everything mutable, so we should probably try to make the mutable case work as often as possible. Doing so might lead you down a rabbit hole,  though, so my suggestion to you is: if you can make certain properties work with little effort, go ahead but if it starts taking you too long and it impacts the core too much, then forget about it.

For these cases, we could consider making sure these values were not altered by a listener and throw an exception if they were, not sure if it's worth it.

-- 
Cédric




On Thu, Jan 19, 2012 at 12:48 PM, Pawel Kowalski <[hidden email]> wrote:
Hi TestNg developers,
 
I have question regarding convention/strategy how  properties of XmlSuite/XmlTest should behave when modified in listener.
I see some inconsistency there, let's consider three properties that I'm actually interested in:
  • group-by-instance - when changed in ISuiteListener by invoking appropriate  setter in XmlSuite then new value will be used during the suite execution, for me cool :)
  • preserve-order - when changed in ISuiteListener by invoking appropriate  setter in XmlSuite/XmlTest, the change will be applied partially. New value will be read from test/suite instance when building dynamic graph to execute, but the method interceptor which depends on this property value is memorised as a  member of TestRunner class and created during TestRunner object construction  before listeners are called, so interceptor will never be changed even when the value of property has been changed.
  • configFailurePolicy - this value's change, even when  XmlSuite provides in API setter to do so, will not be taken into consideration during test execution since it is memorised as a member of Invoker class which instance  is created during TestRunner construction before listeners are called
My questions are:
Should each property value be "dynamic" ? Maybe none of them? Or should it depend, how it is now?

Actually I'm interested in first option, everything should be "dynamic" and applied when value is changed in listener.
What do you think, are you OK with this ?
 
Regards,
Paweł Kowalski

--
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.

--
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.



--
Pozdrawiam,
Paweł Kowalski

--
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.