本文整理汇总了Java中gherkin.formatter.model.Match类的典型用法代码示例。如果您正苦于以下问题:Java Match类的具体用法?Java Match怎么用?Java Match使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Match类属于gherkin.formatter.model包,在下文中一共展示了Match类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: fireFixtureStep
import gherkin.formatter.model.Match; //导入依赖的package包/类
protected void fireFixtureStep(final Match match, final Result result, final boolean isBefore) {
final String uuid = Utils.md5(match.getLocation());
final StepResult stepResult = new StepResult()
.withName(match.getLocation())
.withStatus(Status.fromValue(result.getStatus()))
.withStart(System.currentTimeMillis() - result.getDuration())
.withStop(System.currentTimeMillis());
if (FAILED.equals(result.getStatus())) {
final StatusDetails statusDetails = ResultsUtils.getStatusDetails(result.getError()).get();
stepResult.withStatusDetails(statusDetails);
if (isBefore) {
final TagParser tagParser = new TagParser(feature, scenario);
statusDetails
.withMessage("Before is failed: " + result.getError().getLocalizedMessage())
.withFlaky(tagParser.isFlaky())
.withMuted(tagParser.isMuted())
.withKnown(tagParser.isKnown());
lifecycle.updateTestCase(scenario.getId(), scenarioResult ->
scenarioResult.withStatus(Status.SKIPPED)
.withStatusDetails(statusDetails));
}
}
lifecycle.startStep(scenario.getId(), uuid, stepResult);
lifecycle.stopStep(uuid);
}
示例2: afterStep
import gherkin.formatter.model.Match; //导入依赖的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;
}
示例3: karateStepProceed
import gherkin.formatter.model.Match; //导入依赖的package包/类
@Override
public void karateStepProceed(Step step, Match match, Result result, CallContext callContext) {
String log = logAppender.collect();
// step should be first
int prevDepth = prevStep == null ? 0 : prevStep.getCallContext().callDepth;
int currDepth = callContext.callDepth;
prevStep = new ReportStep(step, match, result, log, callContext);
if (currDepth > prevDepth) { // called
List<ReportStep> temp = new ArrayList();
temp.add(prevStep);
callStack.push(temp);
} else {
if (currDepth < prevDepth) { // callBegin return
for (ReportStep s : callStack.pop()) {
prevStep.addCalled(s);
}
}
if (callStack.isEmpty()) {
steps.add(prevStep);
} else {
callStack.peek().add(prevStep);
}
}
// just pass on to downstream
formatter.step(step);
reporter.match(match);
reporter.result(result);
}
示例4: karateStepProceed
import gherkin.formatter.model.Match; //导入依赖的package包/类
@Override
public void karateStepProceed(Step step, Match match, Result result, CallContext callContext) {
junit.step(step);
json.step(step);
// step has to happen first !
match(match);
result(result);
}
示例5: ReportStep
import gherkin.formatter.model.Match; //导入依赖的package包/类
public ReportStep(Step step, Match match, Result result, String log, CallContext callContext) {
this.step = step;
this.match = match;
this.result = result;
this.log = log;
this.callContext = callContext;
}
示例6: hookFinished
import gherkin.formatter.model.Match; //导入依赖的package包/类
@Override
protected void hookFinished(Match match, Result result, Boolean isBefore) {
reportResult(result, (isBefore ? "Before" : "After") + " hook: " + match.getLocation());
if (result.getStatus().equals("failed")) {
hookStatus = Statuses.FAILED;
}
}
示例7: after
import gherkin.formatter.model.Match; //导入依赖的package包/类
@Override
public void after(Match arg0, Result arg1) {
Reporter wrappedReporter = getWrappedReporter();
if(wrappedReporter != null) {
wrappedReporter.after(arg0, arg1);
}
}
示例8: before
import gherkin.formatter.model.Match; //导入依赖的package包/类
@Override
public void before(Match arg0, Result arg1) {
Reporter wrappedReporter = getWrappedReporter();
if(wrappedReporter != null) {
wrappedReporter.before(arg0, arg1);
}
}
示例9: match
import gherkin.formatter.model.Match; //导入依赖的package包/类
@Override
public void match(Match arg0) {
Reporter wrappedReporter = getWrappedReporter();
if(wrappedReporter != null) {
wrappedReporter.match(arg0);
}
}
示例10: after
import gherkin.formatter.model.Match; //导入依赖的package包/类
@Override
public void after(final Match match, final Result result) {
Map<String, Object> model = new HashMap<String, Object>();
model.put("match", match);
model.put("matchAsMap", match.toMap());
model.put("result", result);
model.put("resultAsMap", result.toMap());
logIfHasOutcome(makeString("after", model));
}
示例11: before
import gherkin.formatter.model.Match; //导入依赖的package包/类
@Override
public void before(final Match match, final Result result) {
Map<String, Object> model = new HashMap<String, Object>();
model.put("match", match);
model.put("matchAsMatch", match.toMap());
model.put("result", result);
model.put("resultAsMatch", result.toMap());
logIfHasOutcome(makeString("before", model));
}
示例12: before
import gherkin.formatter.model.Match; //导入依赖的package包/类
@Override
public void before(final Match match, final Result result) {
new StepUtils(currentFeature, currentScenario).fireFixtureStep(match, result, true);
}
示例13: after
import gherkin.formatter.model.Match; //导入依赖的package包/类
@Override
public void after(final Match match, final Result result) {
new StepUtils(currentFeature, currentScenario).fireFixtureStep(match, result, false);
}
示例14: before
import gherkin.formatter.model.Match; //导入依赖的package包/类
@Override
public void before(Match match, Result result) {
junit.before(match, result);
json.before(match, result);
}
示例15: after
import gherkin.formatter.model.Match; //导入依赖的package包/类
@Override
public void after(Match match, Result result) {
junit.after(match, result);
json.after(match, result);
}