@Override public String getCodeLocation() { return hookDefinition.getLocation(false); }
public HookDefinitionDTO(UUID glueId, long id, HookDefinition hookDefinition) { this.glueId = glueId; this.id = id; this.order = hookDefinition.getOrder(); this.location = hookDefinition.getLocation(false); this.detailedLocation = hookDefinition.getLocation(true); }
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); } } } }