JBehave

Allow Steps dependencies to be composable via PicoContainer

Details

  • Type: New Feature New Feature
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 2.4
  • Fix Version/s: 2.5
  • Component/s: Core
  • Labels:
    None
  • Number of attachments :
    0

Description

In acceptance/integration tests is often common to have a lightweight container (Pico, Spring, Guice, etc ...) to configure the tests with.

A container-supported Steps instance should be composable (either via constructor or setter dependency injection) with components configured in the container.

Each container support will be contained in a separate optional module.

We start with Pico support, with other containers to follow.

Activity

Hide
David Ron added a comment -

I created a pretty nice way to break the JBehave Inheritance Hierarchy that isn't framework specific. Instead of inheriting from Scenario, it allows you to delegate to a class that does so. If something like this were integrated directly into JBehave, then framework-specific code would be minimal:

http://blog.davidron.com/2009/12/breaking-jbehave-inheritance-hierarchy.html

My company uses this code to run Jbehave tests inside of a standard spring container. It works with both annotation-driven spring classes and with test classes that extend AbstractTransactionalSpringContextTests.

It also supports finding the steps configuration file by name (string) or class name.

Show
David Ron added a comment - I created a pretty nice way to break the JBehave Inheritance Hierarchy that isn't framework specific. Instead of inheriting from Scenario, it allows you to delegate to a class that does so. If something like this were integrated directly into JBehave, then framework-specific code would be minimal: http://blog.davidron.com/2009/12/breaking-jbehave-inheritance-hierarchy.html My company uses this code to run Jbehave tests inside of a standard spring container. It works with both annotation-driven spring classes and with test classes that extend AbstractTransactionalSpringContextTests. It also supports finding the steps configuration file by name (string) or class name.
Hide
Mauro Talevi added a comment -

Hi David,

creating a scenario wrapper that does not use a hierarchical paradigm may be a useful enhancement but it's a separate concern from the ability to compose steps classes. You may want to create a separate issue for that.

Show
Mauro Talevi added a comment - Hi David, creating a scenario wrapper that does not use a hierarchical paradigm may be a useful enhancement but it's a separate concern from the ability to compose steps classes. You may want to create a separate issue for that.

People

Vote (2)
Watch (3)

Dates

  • Created:
    Updated:
    Resolved: