本文整理汇总了Java中gherkin.formatter.Formatter类的典型用法代码示例。如果您正苦于以下问题:Java Formatter类的具体用法?Java Formatter怎么用?Java Formatter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Formatter类属于gherkin.formatter包,在下文中一共展示了Formatter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: tearDownClass
import gherkin.formatter.Formatter; //导入依赖的package包/类
@AfterClass(alwaysRun = true)
public void tearDownClass() throws Exception {
RuntimeOptions ro = runtimeOptions.getRuntimeOptions();
Formatter formatter = ro.formatter(runtimeOptions.getClassLoader());
formatter.done();
formatter.close();
}
示例2: createSingleRerunFile
import gherkin.formatter.Formatter; //导入依赖的package包/类
private Path createSingleRerunFile(List<CucumberFeature> rerunFeatures) throws IOException {
Path rerunPath = Files.createTempFile("parallelCukes", ".rerun");
rerunPath.toFile().deleteOnExit();
PluginFactory pluginFactory = new PluginFactory();
Object rerunFormatter = pluginFactory.create("rerun:" + rerunPath);
RerunFileBuilder rerunFileBuilder = new RerunFileBuilder((Formatter) rerunFormatter, (Reporter) rerunFormatter);
for (CucumberFeature feature : rerunFeatures)
rerunFileBuilder.addFeature(feature);
rerunFileBuilder.close();
return rerunPath;
}
示例3: RerunFileBuilder
import gherkin.formatter.Formatter; //导入依赖的package包/类
public RerunFileBuilder(Formatter formatter, Reporter reporter) {
/*
* Both of these should point to a single concrete formatter instance
* This is passed twice so we can access both of its interfaces methods
* All the cucumber concrete formatters are non-public so can't be used
* directly
*/
this.formatter = formatter;
this.reporter = reporter;
}
示例4: RestJUnitReporter
import gherkin.formatter.Formatter; //导入依赖的package包/类
public RestJUnitReporter(Reporter reporter, Formatter formatter, boolean strict,
RestRuntime runtime) {
super(reporter, formatter, strict);
this.runtime = runtime;
results = new HashMap<String, String>();
features = new HashMap<String, CucumberFeature>();
}
示例5: aroundAddIgnoreTagPointcut
import gherkin.formatter.Formatter; //导入依赖的package包/类
/**
* @param pjp ProceedingJoinPoint
* @param formatter formatter
* @param reporter reporter
* @param runtime runtime
* @throws Throwable exception
*/
@Around(value = "addIgnoreTagPointcutScenario(formatter, reporter, runtime)")
public void aroundAddIgnoreTagPointcut(ProceedingJoinPoint pjp, Formatter formatter, Reporter reporter,
Runtime runtime) throws Throwable {
CucumberScenario scen = (CucumberScenario) pjp.getThis();
Scenario scenario = (Scenario) scen.getGherkinModel();
Class<?> sc = scen.getClass();
Method tt = sc.getSuperclass().getDeclaredMethod("tagsAndInheritedTags");
tt.setAccessible(true);
Set<Tag> tags = (Set<Tag>) tt.invoke(scen);
List<String> tagList = new ArrayList<>();
String scenarioName = scenario.getName();
tagList = tags.stream().map(Tag::getName).collect(Collectors.toList());
ignoreReasons exitReason = manageTags(tagList, scenarioName);
if (exitReason.equals(NOREASON)) {
logger.error("Scenario '" + scenario.getName() + "' failed due to wrong use of the @ignore tag. ");
}
if ((!(exitReason.equals(NOTIGNORED))) && (!(exitReason.equals(NOREASON)))) {
runtime.buildBackendWorlds(reporter, tags, scenario.getName());
formatter.startOfScenarioLifeCycle(scenario);
formatter.endOfScenarioLifeCycle(scenario);
runtime.disposeBackendWorlds();
} else {
pjp.proceed();
}
}
示例6: replay
import gherkin.formatter.Formatter; //导入依赖的package包/类
public void replay(Formatter formatter) {
feature.replay(formatter);
backgroundWrapper.replay(formatter);
for (ScenarioWrapper scenario : scenarios) {
scenario.replay(formatter);
}
}
示例7: write
import gherkin.formatter.Formatter; //导入依赖的package包/类
public void write(FeatureWrapper gherkin) {
Formatter formatter = new PrettyFormatter(writer, true, false);
gherkin.replay(formatter);
formatter.eof();
formatter.close();
}
示例8: replay
import gherkin.formatter.Formatter; //导入依赖的package包/类
public void replay(Formatter formatter) {
scenario.replay(formatter);
scenarioOutline.replay(formatter);
for (Step step : steps) {
step.replay(formatter);
}
examples.replay(formatter);
}
示例9: nullFormatter
import gherkin.formatter.Formatter; //导入依赖的package包/类
private Formatter nullFormatter() {
return (Formatter) Proxy.newProxyInstance(getClass().getClassLoader(), new Class[]{Formatter.class}, new InvocationHandler() {
@Override
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
return null;
}
});
}
示例10: should_run_scenario_and_call_collector_when_ran
import gherkin.formatter.Formatter; //导入依赖的package包/类
@Test
public void should_run_scenario_and_call_collector_when_ran() {
// given
ScenarioTestUnit testUnit = new ScenarioTestUnit(HideFromJUnit.Concombre.class, scenario);
// when
testUnit.execute(getClass().getClassLoader(), resultCollector);
// then
verify(scenario, times(1)).run(any(Formatter.class), any(Reporter.class), any(Runtime.class));
}
示例11: result
import gherkin.formatter.Formatter; //导入依赖的package包/类
@Override
public void result(Result arg0) {
Formatter wrapped = threadAwareWrappedFormatter.getWrapped();
if(wrapped instanceof JSONFormatter) {
((JSONFormatter) wrapped).result(arg0);
}
else {
getWrapped().result(arg0);
}
}
示例12: ThreadAwareFormatter
import gherkin.formatter.Formatter; //导入依赖的package包/类
private ThreadAwareFormatter(final RuntimeOptions runtimeOptions, final ClassLoader classLoader) {
this.runtimeOptions = runtimeOptions;
this.classLoader = classLoader;
wrapped = new ThreadLocal<Formatter>() {
@Override
protected Formatter initialValue() {
Formatter created = FORMATTER_FACTORY.create("json:target/test-results/result_" + Thread.currentThread().getId() + ".json");
known.add(created);
return created;
// Formatter formatter = runtimeOptions.formatter(classLoader);
// return formatter;
}
};
}
示例13: close
import gherkin.formatter.Formatter; //导入依赖的package包/类
@Override
public void close() {
for(Formatter formatter : known) {
formatter.close();
}
}
示例14: KarateHtmlReporter
import gherkin.formatter.Formatter; //导入依赖的package包/类
public KarateHtmlReporter(Reporter reporter, Formatter formatter) {
this.reporter = reporter;
this.formatter = formatter;
NUMBER_FORMAT.applyPattern("0.######");
}
示例15: formatter
import gherkin.formatter.Formatter; //导入依赖的package包/类
public Formatter formatter(ClassLoader classLoader) {
return runtimeOptions.formatter(classLoader);
}