Hi Lance,

Your supposition is correct: the reporter methods are invoked as the events 
occur.  It is up to the specific impls to store the params that are passed and 
use them as appropriate.

In your case, you can use them to do the mapping you require.

We aim to support multiple usecases so feel free to contribute your 
implementation, both of the reporter and the runner.  

Do let us know if you run into problems.

Cheers

On 29 Jun 2011, at 18:53, <[email protected]> wrote:

> I'm having a bit of trouble with StoryReporter in that there is no javadoc, I 
> have a couple of questions:
>  
> 1. Will StoryReporter.afterExamples() be called on success and on failure or 
> just on success?
> 2. Is StoryReporter.example(Map<String, String> tableRow) called for every 
> example?
> 3. When StoryReporter.failedOutcomes(String step, OutcomesTable table) is 
> called, how do I go about mapping a failure back to an example?
> 4. When StoryReporter.failed(String step, Throwable cause) is called, how do 
> I go about mapping a failure back to an example?
>  
> I guess that if 2. is true I could store the tableRow and use that for 3. and 
> 4.
>  
> Cheers,
> Lance.
> 
> From: Semmens, Lance 
> Sent: 29 June 2011 17:38
> To: '[email protected]'
> Subject: RE: [jbehave-user] Manually running a single example within a 
> scenario
> 
> I've actually got two objectives and have a solution in mind that will solve 
> both
>  
> 1. I'd like better results in my IDE / CI JUnit report
> 2. I'd like spring's TestExecutionListeners to integrate with JBehave 
> (@DirtiesContext in particular)
>  
> From: Mauro Talevi [mailto:[email protected]] 
> Sent: 29 June 2011 17:33
> To: [email protected]
> Subject: Re: [jbehave-user] Manually running a single example within a 
> scenario
> 
> Well then the best way to write a custom StoryReporter and collect the 
> information as they are executed. 
> 
> On 29/06/2011 18:31, Paul Hammant wrote:
>> 
>> Lance is concerned with result correlation, not invocation I think.  JUnit 
>> must have a way of collecting results for presentation, that (amongst 
>> others) IDEA and Eclipse pick up on and display.
>> 
>> - Paul
>> 
>> On Wed, Jun 29, 2011 at 11:29 AM, Mauro Talevi <[email protected]> 
>> wrote:
>> Hi, 
>> 
>> that is not possible at the moment. The StoryRunner only allows running of 
>> stories, not of single scenarios.  But there are many ways to control the 
>> runner behaviour, and different ways to embed the runner. 
>> 
>> Why don't you raise a jira issue describing the behaviour you'd like to see 
>> and we can see how best to accomodate your requirement? 
>> 
>> Cheers
>> 
>> 
>> On 29/06/2011 17:08, [email protected] wrote:
>>> Hi, 
>>> After discussion on the list I am going to implement my own JUnit test 
>>> runner which runs each example within a scenario one at time.
>>> 
>>> Can anyone provide me with some sample code which will run a single example 
>>> within a scenario? 
>>> Or, can you lead me towards the source code which actually runs the 
>>> scenarios?
>>> 
>>> I can see Story.getScenarios().get(0).getExamplesTable() 
>>> And I can see ExamplesTable.getRow(int row)
>>> 
>>> I would just like the final piece of the puzzle which passes the row 
>>> (Map<String,String>) to the scenario and gets a result.
>>> 
>>> Thanks, 
>>> Lance.
>>> 
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe from this list, please visit:
>>> 
>>>     http://xircles.codehaus.org/manage_email
>> 
>> 
> 
> Visit our website at http://www.ubs.com 
> 
> This message contains confidential information and is intended only 
> for the individual named. If you are not the named addressee you 
> should not disseminate, distribute or copy this e-mail. Please 
> notify the sender immediately by e-mail if you have received this 
> e-mail by mistake and delete this e-mail from your system. 
> 
> E-mails are not encrypted and cannot be guaranteed to be secure or 
> error-free as information could be intercepted, corrupted, lost, 
> destroyed, arrive late or incomplete, or contain viruses. The sender 
> therefore does not accept liability for any errors or omissions in the 
> contents of this message which arise as a result of e-mail transmission. 
> If verification is required please request a hard-copy version. This 
> message is provided for informational purposes and should not be 
> construed as a solicitation or offer to buy or sell any securities 
> or related financial instruments. 
> 
> UBS Limited is a company limited by shares incorporated in the United 
> Kingdom registered in England and Wales with number 2035362. 
> Registered office: 1 Finsbury Avenue, London EC2M 2PP.  UBS Limited 
> is authorised and regulated by the Financial Services Authority. 
> 
> UBS AG is a public company incorporated with limited liability in 
> Switzerland domiciled in the Canton of Basel-City and the Canton of 
> Zurich respectively registered at the Commercial Registry offices in 
> those Cantons with Identification No: CH-270.3.004.646-4 and having 
> respective head offices at Aeschenvorstadt 1, 4051 Basel and 
> Bahnhofstrasse 45, 8001 Zurich, Switzerland.  Registered in the 
> United Kingdom as a foreign company with No: FC021146 and having a 
> UK Establishment registered at Companies House, Cardiff, with No:  
> BR 004507.  The principal office of UK Establishment: 1 Finsbury Avenue, 
> London EC2M 2PP.  In the United Kingdom, UBS AG is authorised and 
> regulated by the Financial Services Authority.
> 
> UBS reserves the right to retain all messages. Messages are protected 
> and accessed only in legally justified cases. 
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
> 
>    http://xircles.codehaus.org/manage_email

Reply via email to