Details
Description
Currently, a JBehave test scenario require inheriting from the base Scenario class. Certain other test frameworks may also require inheritance, but multiple inheritance is not allowed in Java. For this reason, configuration of a delegate Scenario may be preferred. I created a blog entry with the necessary code to accomplish this:
http://blog.davidron.com/2009/12/breaking-jbehave-inheritance-hierarchy.html
Activity

Field | Original Value | New Value |
---|---|---|
Summary | Should be able to use Jbehave without inheriting from a base class | Should be able to use JBehave without inheriting from a base class |
Fix Version/s | 3.0 [ 16302 ] |

Assignee | Mauro Talevi [ maurotalevi ] |

Status | Open [ 1 ] | In Progress [ 3 ] |

Comment |
[ There is now a RunnableStoryDelegator (which JUnitStory extends) that can be used to compose the instance of RunnableStory without inheritance. ] |

Status | In Progress [ 3 ] | Resolved [ 5 ] |
Resolution | Fixed [ 1 ] |
Look at org.jbehave.examples.trader.spring.SpringTraderRunner in the trader example.
It shows how with new embeddable architecture (
JBEHAVE-267), users can leverage any framework to run stories.In particular, the example above uses Spring JUnit4 Class Runner.