本文整理汇总了Java中gherkin.formatter.Reporter类的典型用法代码示例。如果您正苦于以下问题:Java Reporter类的具体用法?Java Reporter怎么用?Java Reporter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Reporter类属于gherkin.formatter包,在下文中一共展示了Reporter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: afterStep
import gherkin.formatter.Reporter; //导入依赖的package包/类
private static StepResult afterStep(Reporter reporter, Step step, Match match, Result result, String feature, KarateBackend backend) {
boolean isKarateReporter = reporter instanceof KarateReporter;
CallContext callContext = backend.getCallContext();
if (isKarateReporter) { // report all the things !
KarateReporter karateReporter = (KarateReporter) reporter;
karateReporter.karateStep(step, match, result, callContext);
} else if (!backend.isCalled() && reporter != null) { // can be null for server
reporter.match(match);
reporter.result(result);
}
StepResult stepResult = new StepResult(step, result);
backend.afterStep(feature, stepResult);
return stepResult;
}
示例2: buildBackendWorlds
import gherkin.formatter.Reporter; //导入依赖的package包/类
@Override
public void buildBackendWorlds(Reporter reporter, Set<Tag> tags, Scenario scenario) {
backend.buildWorld();
// tags only work at top-level, this does not apply to 'called' features
CucumberUtils.resolveTagsAndTagValues(backend, tags);
// 'karate.info' also does not apply to 'called' features
CucumberUtils.initScenarioInfo(scenario, backend);
scenarioResult = new CucumberScenarioImpl(reporter, tags, scenario);
}
示例3: createSingleRerunFile
import gherkin.formatter.Reporter; //导入依赖的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;
}
示例4: RerunFileBuilder
import gherkin.formatter.Reporter; //导入依赖的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;
}
示例5: RestJUnitReporter
import gherkin.formatter.Reporter; //导入依赖的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>();
}
示例6: aroundAddIgnoreTagPointcut
import gherkin.formatter.Reporter; //导入依赖的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();
}
}
示例7: execute
import gherkin.formatter.Reporter; //导入依赖的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);
}
示例8: should_run_scenario_and_call_collector_when_ran
import gherkin.formatter.Reporter; //导入依赖的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));
}
示例9: ThreadAwareReporter
import gherkin.formatter.Reporter; //导入依赖的package包/类
private ThreadAwareReporter(ThreadAwareFormatter threadAwareWrappedFormatter,
final ClassLoader classLoader,
final RuntimeOptions runtimeOptions) {
this.threadAwareWrappedFormatter = threadAwareWrappedFormatter;
this.classLoader = classLoader;
this.runtimeOptions = runtimeOptions;
threadLocal = new ThreadLocal<Reporter>() {
@Override
protected Reporter initialValue() {
return runtimeOptions.reporter(classLoader);
}
};
}
示例10: after
import gherkin.formatter.Reporter; //导入依赖的package包/类
@Override
public void after(Match arg0, Result arg1) {
Reporter wrappedReporter = getWrappedReporter();
if(wrappedReporter != null) {
wrappedReporter.after(arg0, arg1);
}
}
示例11: before
import gherkin.formatter.Reporter; //导入依赖的package包/类
@Override
public void before(Match arg0, Result arg1) {
Reporter wrappedReporter = getWrappedReporter();
if(wrappedReporter != null) {
wrappedReporter.before(arg0, arg1);
}
}
示例12: embedding
import gherkin.formatter.Reporter; //导入依赖的package包/类
@Override
public void embedding(String arg0, byte[] arg1) {
Reporter wrappedReporter = getWrappedReporter();
if(wrappedReporter != null) {
wrappedReporter.embedding(arg0, arg1);
}
}
示例13: match
import gherkin.formatter.Reporter; //导入依赖的package包/类
@Override
public void match(Match arg0) {
Reporter wrappedReporter = getWrappedReporter();
if(wrappedReporter != null) {
wrappedReporter.match(arg0);
}
}
示例14: result
import gherkin.formatter.Reporter; //导入依赖的package包/类
@Override
public void result(Result arg0) {
Reporter wrappedReporter = getWrappedReporter();
if(wrappedReporter != null) {
wrappedReporter.result(arg0);
}
}
示例15: write
import gherkin.formatter.Reporter; //导入依赖的package包/类
@Override
public void write(String arg0) {
Reporter wrappedReporter = getWrappedReporter();
if(wrappedReporter != null) {
wrappedReporter.write(arg0);
}
}