Skip to content

Instantly share code, notes, and snippets.

@jamescarr
Created February 3, 2010 23:56
Show Gist options
  • Save jamescarr/294199 to your computer and use it in GitHub Desktop.
Save jamescarr/294199 to your computer and use it in GitHub Desktop.
import org.jbehave.scenario.PropertyBasedConfiguration;
import org.jbehave.scenario.ScenarioRunner;
import org.jbehave.scenario.parser.ClasspathScenarioDefiner;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations={"classpath:com/foo/bar/place/acceptance-test-context.xml"})
public class PlaceServiceScenario_AT {
private static ScenarioRunner scenario;
private static ClasspathScenarioDefiner definer;
@Autowired
private PlaceServiceSteps placeServiceSteps;
@BeforeClass
public static void beforeClass() {
scenario = new ScenarioRunner();
definer = new ClasspathScenarioDefiner();
}
protected PlaceServiceSteps getPlaceServiceSteps() {
return placeServiceSteps;
}
@Test
public void shouldRetrieveMapsWithNestedShapes() throws Throwable {
runScenario("maps_with_nested_shapes.scenario");
}
@Test
public void shouldRetrieveMapsWithinActiveDates() throws Throwable {
runScenario("maps_by_active_date.scenario");
}
private void runScenario(String scenarioFileName) throws Throwable {
scenario.run(definer.loadScenarioDefinitionsFor("com/foo/bar/place/" +
scenarioFileName), new PropertyBasedConfiguration(),placeServiceSteps);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment