Skip to content

Instantly share code, notes, and snippets.

@ctataryn
Created February 6, 2012 15:48
Show Gist options
  • Save ctataryn/1752773 to your computer and use it in GitHub Desktop.
Save ctataryn/1752773 to your computer and use it in GitHub Desktop.
jBehave Transaction Problem
@Transactional(readOnly = false, value = "dwTransactionManager")
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = "/integration/test/config/spring/integrationTestBeans.xml")
public class RetrievePlayerInformationStoriesTest {
@Resource
private ApplicationContext context;
private Embedder embedder;
@Before
public void setup() {
// SpringStepsFactory will comb the classpath for POJOs annotated with
// @Given, @When... and add those as steps
embedder = new PlayerStoriesEmbedder();
embedder.useCandidateSteps(new SpringStepsFactory(embedder
.configuration(), context).createCandidateSteps());
}
@Test
public void runStoriesAsPaths() {
List<String> storyPaths = new StoryFinder().findPaths(
codeLocationFromClass(this.getClass()), "**/*.story",
"**/failing_before*.story");
embedder.runStoriesAsPaths(storyPaths);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment