本文整理汇总了Java中org.jbehave.core.annotations.UsingEmbedder类的典型用法代码示例。如果您正苦于以下问题:Java UsingEmbedder类的具体用法?Java UsingEmbedder怎么用?Java UsingEmbedder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
UsingEmbedder类属于org.jbehave.core.annotations包,在下文中一共展示了UsingEmbedder类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: buildEmbedder
import org.jbehave.core.annotations.UsingEmbedder; //导入依赖的package包/类
public Embedder buildEmbedder() {
if (!finder.isAnnotationPresent(UsingEmbedder.class)) {
return new Embedder();
}
boolean batch = control(finder, "batch");
boolean skip = control(finder, "skip");
boolean generateViewAfterStories = control(finder, "generateViewAfterStories");
boolean ignoreFailureInStories = control(finder, "ignoreFailureInStories");
boolean ignoreFailureInView = control(finder, "ignoreFailureInView");
boolean verboseFailures = control(finder, "verboseFailures");
boolean verboseFiltering = control(finder, "verboseFiltering");
long storyTimeoutInSecs = finder.getAnnotatedValue(UsingEmbedder.class, Long.class, "storyTimeoutInSecs");
int threads = finder.getAnnotatedValue(UsingEmbedder.class, Integer.class, "threads");
Embedder embedder = embedder();
embedder.embedderControls().doBatch(batch).doSkip(skip).doGenerateViewAfterStories(generateViewAfterStories)
.doIgnoreFailureInStories(ignoreFailureInStories).doIgnoreFailureInView(ignoreFailureInView)
.doVerboseFailures(verboseFailures).doVerboseFiltering(verboseFiltering).useStoryTimeoutInSecs(storyTimeoutInSecs).useThreads(threads);
Configuration configuration = buildConfiguration();
embedder.useConfiguration(configuration);
boolean useStepsFactory = finder.getAnnotatedValue(UsingEmbedder.class, Boolean.class, "stepsFactory");
if (useStepsFactory) {
embedder.useStepsFactory(buildStepsFactory(configuration));
} else {
embedder.useCandidateSteps(buildCandidateSteps(configuration));
}
List<String> metaFilters = finder.getAnnotatedValues(UsingEmbedder.class, String.class, "metaFilters");
if (!metaFilters.isEmpty()) {
embedder.useMetaFilters(metaFilters);
}
Properties systemProperties = loadProperties(finder.getAnnotatedValue(UsingEmbedder.class, String.class,
"systemProperties"));
if (!systemProperties.isEmpty()) {
embedder.useSystemProperties(systemProperties);
}
return embedder;
}
示例2: embedder
import org.jbehave.core.annotations.UsingEmbedder; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private Embedder embedder() {
return instanceOf(Embedder.class,
(Class<? extends Embedder>) finder.getAnnotatedValue(UsingEmbedder.class, Class.class, "embedder"));
}
示例3: control
import org.jbehave.core.annotations.UsingEmbedder; //导入依赖的package包/类
private boolean control(AnnotationFinder finder, String name) {
return finder.getAnnotatedValue(UsingEmbedder.class, Boolean.class, name);
}