Hi folks. When we designed JBehave 2 we made some assumptions and left some deliberate gaps.
One of the assumptions was that people would run scenarios using JUnit 4. They would then use whichever mocking framework they want - JMock, EasyMock and Mockito being the three obvious ones. It turns out some people who want to use JB2 are constrained to JUnit 3.8 - usually due to corporate constraints - or want to use other test frameworks entirely such as TestNG. Now in JB 2.0.0 we have a concrete class called Scenario which is coupled to JUnit 4. After a bit of investigation it appears that: - it is easy to make it backward compatible to JUnit 3.8 - it is less obvious how to make it play nice with TestNG - there should probably be an interface of which Scenario is an implementation, and it should really be called something like JUnitScenario. In the few weeks it's been released there has been a small-but-rapid take-up of JB2, which means a lot of people have already extended the Scenario base class for their own scenarios. This is a Good Thing :) So I want to kick off a discussion of how to get to JUnitScenario without breaking everyone's scenarios (yet). Perhaps we should have released a 2.0.0-alpha1 to signify things might change before we got to a 2.0.0 final. Never mind - that's how we learn. (I was one of the people who said we didn't need to!) My initial thoughts are: - subclass Scenario to create an abstract JUnitScenario and suggest people use this instead. - deprecate Scenario in 2.1 to discourage anyone from extending it for new scenarios - let the users list know we've deprecated it and to consider moving their scenarios over to JUnitScenario in 2.1 (this shoud be a trivial search/replace). - pull up an abstract base class (AbstractScenario?) that implements an interface (AcceptanceCriteria? RunnableScenario?) that we can use as a basis for a TestNGScenario. Based on our own description of version numbers, there should be no breaking changes in a minor or patch revision, so we can't change Scenario into an interface in the 2.x series. Thoughts? Cheers, Dan
