本文整理汇总了Java中org.jbehave.core.steps.AbstractStepsFactory类的典型用法代码示例。如果您正苦于以下问题:Java AbstractStepsFactory类的具体用法?Java AbstractStepsFactory怎么用?Java AbstractStepsFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AbstractStepsFactory类属于org.jbehave.core.steps包,在下文中一共展示了AbstractStepsFactory类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: assertThatStepsCanBeCreated
import org.jbehave.core.steps.AbstractStepsFactory; //导入依赖的package包/类
@Test
public void assertThatStepsCanBeCreated() throws NoSuchFieldException, IllegalAccessException {
// Given
Injector parent = Guice.createInjector(new AbstractModule() {
@Override
protected void configure() {
bind(FooSteps.class).in(Scopes.SINGLETON);
}
});
AbstractStepsFactory factory = new GuiceStepsFactory(new MostUsefulConfiguration(), parent);
// When
List<CandidateSteps> steps = factory.createCandidateSteps();
// Then
assertFooStepsFound(steps);
}
示例2: assertThatStepsWithStepsWithDependencyCanBeCreated
import org.jbehave.core.steps.AbstractStepsFactory; //导入依赖的package包/类
@Test
public void assertThatStepsWithStepsWithDependencyCanBeCreated() throws NoSuchFieldException, IllegalAccessException {
Injector parent = Guice.createInjector(new AbstractModule() {
@Override
protected void configure() {
bind(Integer.class).toInstance(42);
bind(FooStepsWithDependency.class).in(Scopes.SINGLETON);
}
});
// When
AbstractStepsFactory factory = new GuiceStepsFactory(new MostUsefulConfiguration(), parent);
List<CandidateSteps> steps = factory.createCandidateSteps();
// Then
assertFooStepsFound(steps);
assertEquals(42, (int) ((FooStepsWithDependency) stepsInstance(steps.get(0))).integer);
}
示例3: stepsFactory
import org.jbehave.core.steps.AbstractStepsFactory; //导入依赖的package包/类
@Override
public InjectableStepsFactory stepsFactory() {
return new AbstractStepsFactory(configuration()) {
@Override
public Object createInstanceOfType(Class<?> type) {
return new WmJBehaveSteps();
}
@Override
protected List<Class<?>> stepsTypes() {
return new ArrayList<>(Arrays.asList(WmJBehaveSteps.class));
}
};
}
示例4: assertThatStepsWithMissingDependenciesCannotBeCreated
import org.jbehave.core.steps.AbstractStepsFactory; //导入依赖的package包/类
@Test(expected=CreationException.class)
public void assertThatStepsWithMissingDependenciesCannotBeCreated() throws NoSuchFieldException, IllegalAccessException {
Injector parent = Guice.createInjector(new AbstractModule() {
@Override
protected void configure() {
bind(FooStepsWithDependency.class);
}
});
AbstractStepsFactory factory = new GuiceStepsFactory(new MostUsefulConfiguration(), parent);
// When
factory.createCandidateSteps();
// Then ... expected exception is thrown
}