Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Now using SpringStepsFactory. Note that I had to upgrade to Spring 3.…

…1.1 for this
  • Loading branch information...
commit 4edcdfceab91591cad6d34206825bb5607205964 1 parent 4ec8939
@twasink authored
View
10 jbehave-spring-hibernate/pom.xml
@@ -18,7 +18,7 @@
<dependencies>
<dependency>
<groupId>org.jbehave</groupId>
- <artifactId>jbehave-core</artifactId>
+ <artifactId>jbehave-spring</artifactId>
<version>3.6.7</version>
</dependency>
@@ -26,18 +26,18 @@
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
- <version>3.0.6.RELEASE</version>
+ <version>3.1.1.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
- <version>3.0.6.RELEASE</version>
+ <version>3.1.1.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aspects</artifactId>
- <version>3.0.6.RELEASE</version>
+ <version>3.1.1.RELEASE</version>
</dependency>
<dependency>
@@ -80,7 +80,7 @@
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
- <version>3.0.6.RELEASE</version>
+ <version>3.1.1.RELEASE</version>
<scope>compile</scope>
</dependency>
<dependency> <!-- needed to get AOPs around the test cases -->
View
14 ...ve-spring-hibernate/src/main/java/net/twasink/jbehave/spring/stories/FooServiceStory.java
@@ -1,15 +1,16 @@
package net.twasink.jbehave.spring.stories;
-import net.twasink.jbehave.spring.steps.FooServiceSteps;
+import java.util.List;
import org.jbehave.core.configuration.Configuration;
import org.jbehave.core.configuration.MostUsefulConfiguration;
import org.jbehave.core.junit.JUnitStory;
-import org.jbehave.core.steps.InjectableStepsFactory;
-import org.jbehave.core.steps.InstanceStepsFactory;
+import org.jbehave.core.steps.CandidateSteps;
+import org.jbehave.core.steps.spring.SpringStepsFactory;
import org.junit.After;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.ApplicationContext;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@@ -18,7 +19,7 @@
@ContextConfiguration("/testContext.xml")
public class FooServiceStory extends JUnitStory {
@Autowired
- private FooServiceSteps steps;
+ private ApplicationContext context;
@Autowired
private JdbcTemplate jdbc;
@@ -32,8 +33,9 @@ public void cleanData() {
return new MostUsefulConfiguration();
}
- @Override public InjectableStepsFactory stepsFactory() {
- return new InstanceStepsFactory(configuration(), steps);
+ @Override
+ public List<CandidateSteps> candidateSteps() {
+ return new SpringStepsFactory(configuration(), context).createCandidateSteps();
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.