當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。