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


Java Cucumber类代码示例

本文整理汇总了Java中cucumber.api.junit.Cucumber的典型用法代码示例。如果您正苦于以下问题:Java Cucumber类的具体用法?Java Cucumber怎么用?Java Cucumber使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Cucumber类属于cucumber.api.junit包,在下文中一共展示了Cucumber类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: CucumberExt

import cucumber.api.junit.Cucumber; //导入依赖的package包/类
/**
 * Constructor called by JUnit.
 *
 * @param clazz the class with the @RunWith annotation.
 * @throws java.io.IOException if there is a problem
 * @throws org.junit.runners.model.InitializationError
 *                             if there is another problem
 */
public CucumberExt(Class clazz) throws InitializationError, IOException {
    super(clazz);
    ClassLoader classLoader = clazz.getClassLoader();
    Assertions.assertNoCucumberAnnotatedMethods(clazz);

    @SuppressWarnings("unchecked")
    RuntimeOptionsFactory runtimeOptionsFactory = new RuntimeOptionsFactory(clazz, new Class[]{CucumberOptions.class, Cucumber.Options.class});
    RuntimeOptions runtimeOptions = runtimeOptionsFactory.create();

    ResourceLoader resourceLoader = createResourceLoader(clazz);
    ClassFinder classFinder = new ResourceLoaderClassFinder(resourceLoader, classLoader);
    runtime = new Runtime(resourceLoader, classFinder, classLoader, runtimeOptions);

    jUnitReporter = new JUnitReporter(runtimeOptions.reporter(classLoader), runtimeOptions.formatter(classLoader), runtimeOptions.isStrict());
    addChildren(runtimeOptions.cucumberFeatures(resourceLoader));
}
 
开发者ID:Arnauld,项目名称:cucumber-contrib,代码行数:25,代码来源:CucumberExt.java

示例2: testRunCucumber

import cucumber.api.junit.Cucumber; //导入依赖的package包/类
/**
 * The entry point to the Cucumber test. Sets up the test case and runs it.
 */
@Test
public void testRunCucumber() {
    try {
        Cucumber cucumber = new Cucumber(this.getClass());
        RunNotifier notifier = new RunNotifier();
        notifier.addFirstListener(new CucumberEventListener());
        GenericListTestSuite.getGlobalDataStorage().put(this.getClass().toString(), this);
        cucumber.run(notifier);
    } catch (InitializationError | IOException e) {
        naTestCase("Cucumber Run Initialization Error: " + e.getMessage());
    }
}
 
开发者ID:epam,项目名称:Gepard,代码行数:16,代码来源:CucumberTestCase.java

示例3: AerialRunner

import cucumber.api.junit.Cucumber; //导入依赖的package包/类
public AerialRunner(Class<?> clazzValue) throws Exception {
    clazz = clazzValue;
    String[] args = AerialMain.toArgs(clazz);
    AerialMain.main(args);
    cucumber = new Cucumber(clazz);
}
 
开发者ID:mkolisnyk,项目名称:aerial,代码行数:7,代码来源:AerialRunner.java


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