@AfterStory method is not invoked in the case that a RuntimeException is thrown
-------------------------------------------------------------------------------

                 Key: JBEHAVE-320
                 URL: http://jira.codehaus.org/browse/JBEHAVE-320
             Project: JBehave
          Issue Type: Bug
          Components: Core
    Affects Versions: 3.0
         Environment: JBehave 3.0 - Beta 12   (Windows XP / Linux (Ubuntu 9.10 
and 10.04), IntelliJ, ant)
            Reporter: Chris Kozak
             Fix For: 3.0
         Attachments: GoogleSearchExample.zip

I've attached a stripped-down example to demonstrate the problem.  Notice that 
in the failure case the parameter in the table is lower-cased causing it to 
mis-match the parameter in the scenario which is camel-cased.

My original email for context:
One of the testers accidentally checked-in a partial change list, causing 
JBehave to throw RunningStoriesFailedException and StoryResourceNotFound 
exceptions.  In and of itself, this isn't a big deal.  However, we are calling 
webDriver.close() in @AfterStory (this closes the browser window).  In the case 
of a RuntimeException, I doesn't look like @AfterStory is called, which leaves 
the browser running.  Since our tests need to share a profile (and only one 
instance of the profile may be run at a time), this causes future tests to hang 
until the browser is closed manually.  In a Continuous Integration environment, 
this is non-trivial.

My Question:
In the case that JBehave throws a RuntimeException, is there a way to trap it 
so that we can close down the browser?

Mauro's Response:
OTOH all exceptions (in fact throwables) should be caught.    Could you
create a sample project reproducing problem and attached it a jira issue?

Please try against latest 3.0-beta-12 which has just been cut.



-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to