- George
--
Dec. 14 - Agile Richmond in Glen Allen, VA
http://georgedinwiddie.eventbrite.com/
----------------------------------------------------------------------
* George Dinwiddie * http://blog.gdinwiddie.com
Software Development http://www.idiacomputing.com
Consultant and Coach http://www.agilemaryland.org
----------------------------------------------------------------------
Aslak
> - George
>
> --
> Dec. 14 - Agile Richmond in Glen Allen, VA
> http://georgedinwiddie.eventbrite.com/
> ----------------------------------------------------------------------
> * George Dinwiddie * http://blog.gdinwiddie.com
> Software Development http://www.idiacomputing.com
> Consultant and Coach http://www.agilemaryland.org
> ----------------------------------------------------------------------
>
> --
> You received this message because you are subscribed to the Google Groups
> "Cukes" group.
> To post to this group, send email to cu...@googlegroups.com.
> To unsubscribe from this group, send email to
> cukes+un...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/cukes?hl=en.
>
>
Thanks. I looked for something in Java, figuring it should have it when
even lowly C does, but didn't find that.
On 12/10/10 9:51 AM, Robert wrote:
> George,
>
> Not knowing the context behind "at_exit in env.rb", I googled it and
> found a copy on the web. The at_exit shown in my results is as
> follows:
>
> # "after all"
> at_exit do
> browser.close
> end
>
>
> We are also using Cuke4Duke. We have implemented a TestEnvironment
> class that supports the loading (loading property files and starting
> Selenium) and unloading (closing Selenium) of our test environment.
> The 'load' method is invoked within a Before hook, contained in a
> Hooks class.
>
> After reading your post, I was wondering if we might have implemented
> this improperly. Just wondering how you are handling this? Is it
> through the env.rb or some other mechanism?
After reflection, we decided to put the final action into the continuous
integration server rather than at the end of the Cucumber run, so it
would be optional when running manually.
I'm not sure Runtime.addShutdownHook would be a good idea for this sort
of thing, anyway. The javadocs say "Shutdown hooks run at a delicate
time in the life cycle of a virtual machine and should therefore be
coded defensively.... Shutdown hooks should also finish their work
quickly." Probably not the best place to spawn an external process.
A better approach might be to use a snippet of ruby in env.rb to call a
Java method that does what you want. We were about to do that when we
decided to move the behavior to the build process rather than the
acceptance test process. You should be able to use that for shutting
down Selenium.
> George,
>
> Not knowing the context behind "at_exit in env.rb", I googled it and
> found a copy on the web. The at_exit shown in my results is as
> follows:
>
> # "after all"
> at_exit do
> browser.close
> end
>
Just to be clear - Kernel.at_exit is not a cucumber thing. It's in ruby core.