jbehave/jbehave-core — pull request #24 by ezilocchi (2011-12-09 17:48:58+00:00)
Title: JBEHAVE-563: fixed - Perform a cancellation of those stories that exceed the time out if it is setted.

I found that the call to future.get() (inside the Embedded.waitUntilAllDoneOrFailed() method) waits until the future finishes its work (except if you explicitly set the time out: future.get(long timeout, TimeUnit unit). This is why the future.cancel(true) never cancel that future Thread. Basically when the future.cancel(true) is being called, its thread has already finished its work and it cannot be canceled.

This commit involves:

Embedder:
-Embedded.waitUntilAllDoneOrFailed() modifications to perform a cancellation of the threads when the future.cancel(true) is called.
-Adding an inner wrapper class (StoryRunner) in order to match the stories that are canceled by the embedder to the threads that are running them

EmbedderBehavior:
-Adding some tests in order to cover the new way of cancel a story that is running

StoryRunner:
-Handling the exceptions that involve a story cancellation due to a time out and marking it as canceled

StoryRunnerBehavior:
-Adding a test in order to cover the story cancellation handling

ThreadsStories and ThreadsSteps:
-Little modifications to perform a kind of integration test