public Match getOutlineMatch(String location) { return new Match(getOutlineArgs(), location); }
private void before(Map o) { Map m = (Map) o.get("match"); Match match = new Match(arguments(m), location(m)); Map r = (Map) o.get("result"); Result result = new Result(status(r), duration(r), errorMessage(r)); reporter.before(match, result); }
private void after(Map o) { Map m = (Map) o.get("match"); Match match = new Match(arguments(m), location(m)); Map r = (Map) o.get("result"); Result result = new Result(status(r), duration(r), errorMessage(r)); reporter.after(match, result); }
@Override public void match(Match match) { List<Argument> inflatedArguments = new ArrayList<>(); for (Argument argument : match.getArguments()) { String inflatedVal = contextInflater.inflate(argument.getVal()); inflatedArguments.add(new Argument(argument.getOffset(), inflatedVal)); } super.match(new Match(inflatedArguments, match.getLocation())); Map<String, Object> currentStep = getCurrentStep(); if (currentStep != null) { String name = ((String) currentStep.get("name")); String inflatedName = contextInflater.inflate(name); currentStep.put("name", inflatedName); } }
new Match(arguments(m), location(m)).replay(reporter);
private void runHookIfTagsMatch(HookDefinition hook, Reporter reporter, Set<Tag> tags, boolean isBefore) { if (hook.matches(tags)) { String status = Result.PASSED; Throwable error = null; Match match = new Match(Collections.<Argument>emptyList(), hook.getLocation(false)); stopWatch.start(); try { hook.execute(scenarioResult); } catch (Throwable t) { error = t; if (isPending(t)) { status = "pending"; } else { status = Result.FAILED; } addError(t); skipNextStep = true; } finally { long duration = stopWatch.stop(); Result result = new Result(status, duration, error, DUMMY_ARG); addHookToCounterAndResult(result); if (isBefore) { reporter.before(match, result); } else { reporter.after(match, result); } } } }