本文整理汇总了Java中cucumber.runtime.RuntimeOptionsFactory.create方法的典型用法代码示例。如果您正苦于以下问题:Java RuntimeOptionsFactory.create方法的具体用法?Java RuntimeOptionsFactory.create怎么用?Java RuntimeOptionsFactory.create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cucumber.runtime.RuntimeOptionsFactory
的用法示例。
在下文中一共展示了RuntimeOptionsFactory.create方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: CucumberLoadRunner
import cucumber.runtime.RuntimeOptionsFactory; //导入方法依赖的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 CucumberLoadRunner(Class clazz) throws InitializationError, IOException {
super(clazz);
System.setProperty(cukesProperty(CONTEXT_INFLATING_ENABLED), "false");
System.setProperty(cukesProperty(ASSERTIONS_DISABLED), "true");
System.setProperty(cukesProperty(LOADRUNNER_FILTER_BLOCKS_REQUESTS), "true");
filter = SingletonObjectFactory.instance().getInstance(LoadRunnerFilter.class);
ClassLoader classLoader = clazz.getClassLoader();
Assertions.assertNoCucumberAnnotatedMethods(clazz);
RuntimeOptionsFactory runtimeOptionsFactory = new RuntimeOptionsFactory(clazz);
RuntimeOptions runtimeOptions = runtimeOptionsFactory.create();
ResourceLoader resourceLoader = new MultiLoader(classLoader);
runtime = createRuntime(resourceLoader, classLoader, runtimeOptions);
final List<CucumberFeature> cucumberFeatures = runtimeOptions.cucumberFeatures(resourceLoader);
jUnitReporter = new JUnitReporter(runtimeOptions.reporter(classLoader),
runtimeOptions.formatter(classLoader), runtimeOptions.isStrict(), new JUnitOptions(runtimeOptions.getJunitOptions()));
addChildren(cucumberFeatures);
}
示例2: EscCucumber
import cucumber.runtime.RuntimeOptionsFactory; //导入方法依赖的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 EscCucumber(Class<?> clazz) throws InitializationError, IOException {
super(clazz);
ClassLoader classLoader = clazz.getClassLoader();
Assertions.assertNoCucumberAnnotatedMethods(clazz);
final List<String> argList = new ArrayList<String>();
final EscCucumberArgs args = clazz.getAnnotation(EscCucumberArgs.class);
if (args == null) {
argList.add("NONE");
} else {
argList.addAll(EscSpiUtils.asList(args.value()));
}
RuntimeOptionsFactory runtimeOptionsFactory = new RuntimeOptionsFactory(
clazz);
RuntimeOptions runtimeOptions = runtimeOptionsFactory.create();
ResourceLoader resourceLoader = new MultiLoader(classLoader);
ClassFinder classFinder = new ResourceLoaderClassFinder(resourceLoader,
classLoader);
runtime = new Runtime(resourceLoader, classFinder, classLoader,
runtimeOptions);
jUnitReporter = new JUnitReporter(runtimeOptions.reporter(classLoader),
runtimeOptions.formatter(classLoader),
runtimeOptions.isStrict());
for (final String arg : argList) {
addChildren(runtimeOptions.cucumberFeatures(resourceLoader), arg);
}
}
示例3: execute
import cucumber.runtime.RuntimeOptionsFactory; //导入方法依赖的package包/类
public void execute(ClassLoader classLoader, ResultCollector rc) {
ResourceLoader resourceLoader = new MultiLoader(classLoader);
// TODO threadlocal runtime cache using junitTestClass as a key
ClassFinder classFinder = new ResourceLoaderClassFinder(resourceLoader, classLoader);
RuntimeOptionsFactory runtimeOptionsFactory = new RuntimeOptionsFactory(junitTestClass);
RuntimeOptions runtimeOptions = runtimeOptionsFactory.create();
Runtime runtime = new Runtime(resourceLoader, classFinder, classLoader, runtimeOptions);
Reporter reporter = new ReporterAdapter(rc, getDescription());
LOGGER.fine("Executing cucumber \"" + scenario.getVisualName() + "\"");
scenario.run(nullFormatter(), reporter, runtime);
}
示例4: CucumberRunner
import cucumber.runtime.RuntimeOptionsFactory; //导入方法依赖的package包/类
@Test(groups = "cucumber", description = "Runs Cucumber Features")
public void CucumberRunner() throws Throwable {
ClassLoader classLoader = getClass().getClassLoader();
ResourceLoader resourceLoader = new MultiLoader(classLoader);
RuntimeOptionsFactory roFactory = new RuntimeOptionsFactory(getClass());
RuntimeOptions ro = roFactory.create();
ro.getGlue().clear();
ro.getGlue().add("classpath:");
ro.getFeaturePaths().clear();
ro.getFeaturePaths().add(feature);
if (!tags.isEmpty()) {
for (String s : tags.split("--tags")) {
if (!s.trim().isEmpty()) {
ro.getFilters().add(s.trim());
}
}
}
ClassFinder classFinder = new ResourceLoaderClassFinder(resourceLoader, classLoader);
runtime = new cucumber.runtime.Runtime(resourceLoader, classFinder, classLoader, ro);
try {
ReporterNGExt.logBusiness(String.format("Run Feature - %s", feature));
runtime.run();
} catch (IOException ex) {
throw new RuntimeException(ex);
}
if (!runtime.getErrors().isEmpty()) {
ReporterNGExt.logBusiness(runtime.getErrors().toString());
throw new CucumberException(runtime.getErrors().get(0));
}
}
示例5: KarateRuntimeOptions
import cucumber.runtime.RuntimeOptionsFactory; //导入方法依赖的package包/类
public KarateRuntimeOptions(Class clazz) {
classLoader = clazz.getClassLoader();
RuntimeOptionsFactory runtimeOptionsFactory = new RuntimeOptionsFactory(clazz);
runtimeOptions = runtimeOptionsFactory.create();
resourceLoader = new MultiLoader(classLoader);
}