当前位置: 首页>>代码示例>>Java>>正文


Java AbstractStepsFactory类代码示例

本文整理汇总了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);
}
 
开发者ID:vactowb,项目名称:jbehave-core,代码行数:17,代码来源:GuiceStepsFactoryBehaviour.java

示例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);
}
 
开发者ID:vactowb,项目名称:jbehave-core,代码行数:18,代码来源:GuiceStepsFactoryBehaviour.java

示例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));
		}
	};
}
 
开发者ID:wmaop,项目名称:wm-jbehave,代码行数:16,代码来源:JBehaveRunner.java

示例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        
}
 
开发者ID:vactowb,项目名称:jbehave-core,代码行数:14,代码来源:GuiceStepsFactoryBehaviour.java


注:本文中的org.jbehave.core.steps.AbstractStepsFactory类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。