Since Concordion 2.0, specs can contain an example named 'before' which is executed prior to every other example. We also added example listeners, and @BeforeExample and @AfterExample method hooks.
A couple of questions I'd like some opinions on:
--
You received this message because you are subscribed to the Google Groups "concordion-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to concordion-dev+unsubscribe@googlegroups.com.
To post to this group, send email to concordion-dev@googlegroups.com.
Visit this group at https://groups.google.com/group/concordion-dev.
To view this discussion on the web, visit https://groups.google.com/d/msgid/concordion-dev/13e7b783-6be6-02ac-a373-135200a37101%40gmail.com.
For more options, visit https://groups.google.com/d/optout.
My (simplistic) view is that the "before" example in the specification isn't a real example and shouldn't have the listeners triggered. Like how we don't trigger listeners for code annotated @Before in the fixture.Tim
On 30 October 2016 at 09:34, Nigel Charman <nigel.ch...@gmail.com> wrote:
Since Concordion 2.0, specs can contain an example named 'before' which is executed prior to every other example. We also added example listeners, and @BeforeExample and @AfterExample method hooks.
A couple of questions I'd like some opinions on:
Andrew Sumner is raising pull request 225 "to ensure that extensions get beforeExample events in order extensions registered, and afterExample events in reverse order to which they were registered". This alters the behaviour in this area. so keen to hear some opinions.
- Should example listeners and @BeforeExample and @AfterExample method hooks be triggered for the 'before' example? (currently, example listeners are called but method hooks are not)
- If "no" to question 1, should the @BeforeExample method hook for the actual example be called before or after its related 'before' example?
Nigel
--
You received this message because you are subscribed to the Google Groups "concordion-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to concordion-dev+unsubscribe@googlegroups.com.
To post to this group, send email to concord...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "concordion-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to concordion-de...@googlegroups.com.
To post to this group, send email to concord...@googlegroups.com.
Visit this group at https://groups.google.com/group/concordion-dev.
To view this discussion on the web, visit https://groups.google.com/d/msgid/concordion-dev/cb248e01-1491-4bc9-bf7f-068d7ba0038f%40googlegroups.com.
--
Would you check with the 2.1.0-SNAPSHOT please, which has implemented "no" (conditional check for !isBeforeExample around the announceBefore/AfterExample method calls in ExampleCommand#execute())?
If answer were "yes", you would only get "before" as the example name, so I don't know how it would be directed to the right example file anyway? Maybe we'd need additional events in the ExampleListener?
Nigel
My only concern is for the logging extension as this listens for the before/afterExample events and directs the log ouput to the appropriate file. If answer is no then any log output would be directed to the specifications log file rather than to a before example specific log so I guess either way works.--
On Sunday, October 30, 2016 at 9:34:31 AM UTC+13, Nigel Charman wrote:Since Concordion 2.0, specs can contain an example named 'before' which is executed prior to every other example. We also added example listeners, and @BeforeExample and @AfterExample method hooks.
A couple of questions I'd like some opinions on:
Andrew Sumner is raising pull request 225 "to ensure that extensions get beforeExample events in order extensions registered, and afterExample events in reverse order to which they were registered". This alters the behaviour in this area. so keen to hear some opinions.
- Should example listeners and @BeforeExample and @AfterExample method hooks be triggered for the 'before' example? (currently, example listeners are called but method hooks are not)
- If "no" to question 1, should the @BeforeExample method hook for the actual example be called before or after its related 'before' example?
Nigel
You received this message because you are subscribed to the Google Groups "concordion-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to concordion-dev+unsubscribe@googlegroups.com.
To post to this group, send email to concordion-dev@googlegroups.com.
Visit this group at https://groups.google.com/group/concordion-dev.
To view this discussion on the web, visit https://groups.google.com/d/msgid/concordion-dev/cb248e01-1491-4bc9-bf7f-068d7ba0038f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "concordion-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to concordion-dev+unsubscribe@googlegroups.com.
To post to this group, send email to concordion-dev@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/concordion-dev/01a00fd4-eec0-5fd8-a3ad-948ddf0d35c8%40gmail.com.
To post to this group, send email to concord...@googlegroups.com.
Visit this group at https://groups.google.com/group/concordion-dev.
To view this discussion on the web, visit https://groups.google.com/d/msgid/concordion-dev/cb248e01-1491-4bc9-bf7f-068d7ba0038f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "concordion-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to concordion-dev+unsubscribe@googlegroups.com.
To post to this group, send email to concord...@googlegroups.com.
beforeProcessingExample('myExample')Nigel
beforeExample('before', element, resultRecorder)
afterExample('before', element, resultRecorder)
beforeExample('myExample', element, resultRecorder)
afterExample('myExample', element, resultRecorder)
afterProcessingExample('myExample')
Funnily enough, before I read Nigel's reply my suggestion was going to be: perhaps it could be trigger beforeExample (for example) then execute 'before', then execute example?
So this would work very well for the logging extension:
I assume if there is no before example then we'd get this:
Like you say it does seem a bit complex and for the minor inconvenience of having to look in the specification log file for 'before' related logs then I'm not to concerned as I've never actually used a 'before' example yet.
Andrew
I'm sending this again from a different account. Outlook seems to have stopped sending emails from my xtra account and just saves them to draft so sorry if you get it twice.
Funnily enough, before I read Nigel's reply my suggestion was going to be: perhaps it could be trigger beforeExample (for example) then execute 'before', then execute example?
So this would work very well for the logging extension:
beforeProcessingExample('myExample')
beforeExample('before', element, resultRecorder)
afterExample('before', element, resultRecorder)
beforeExample('myExample', element, resultRecorder)
afterExample('myExample', element, resultRecorder)
afterProcessingExample('myExample')
I assume if there is no before example then we'd get this:
beforeProcessingExample('myExample')
beforeExample('myExample', element, resultRecorder)
afterExample('myExample', element, resultRecorder)
afterProcessingExample('myExample')
Like you say Tim, it does seem a bit complex and for the minor inconvenience of having to look in the specification log file for 'before' related logs then I'm not to concerned as I've never actually used a 'before' example yet.
Andrew
From: concord...@googlegroups.com <concord...@googlegroups.com> on behalf of Tim Wright <t...@tfwright.co.nz>
Sent: Sunday, 30 October 2016 6:54 p.m.
To: Nigel Charman
Cc: Andrew; concordion-dev
Subject: Re: [concordion-dev] Re: Listeners and method hooks on 'before' examples
That seems complex.
Andrew: would it be useful for your extensions?
Tim
--Tim021 251 5593
View Tim Wright’s professional profile on LinkedIn. LinkedIn is the world's largest business network, helping professionals like Tim Wright discover inside connections to recommended job candidates, industry experts, and business partners.
--
You received this message because you are subscribed to a topic in the Google Groups "concordion-dev" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/concordion-dev/p98v3g3Vz5U/unsubscribe.
To unsubscribe from this group and all its topics, send an email to concordion-de...@googlegroups.com.
To post to this group, send email to concord...@googlegroups.com.
Visit this group at https://groups.google.com/group/concordion-dev.
To view this discussion on the web, visit https://groups.google.com/d/msgid/concordion-dev/CAJifTyqWjg3KfaY1gbNObmWbQBmDCoeGUtsECLQhR%3DuppQKxAw%40mail.gmail.com.