private void buildBackendWorlds() { for (Backend backend : backends) { backend.buildWorld(); } }
private void disposeBackendWorlds() { for (Backend backend : backends) { backend.disposeWorld(); } } }
public Runner(EventBus bus, Collection<? extends Backend> backends, RunnerOptions runnerOptions) { this.bus = bus; this.runnerOptions = runnerOptions; this.backends = backends; for (Backend backend : backends) { backend.loadGlue(glue, runnerOptions.getGlue()); } }
public ExtendedRuntime(ResourceLoader resourceLoaderValue, ClassLoader classLoaderValue, Collection<? extends Backend> backendsValue, RuntimeOptions runtimeOptionsValue, StopWatch stopWatchValue, RuntimeGlue optionalGlueValue) { super(resourceLoaderValue, classLoaderValue, backendsValue, runtimeOptionsValue, stopWatchValue, optionalGlueValue); if (backendsValue.isEmpty()) { throw new CucumberException( "No backends were found. Please make sure you have a backend module on your CLASSPATH."); } //this.resourceLoader = resourceLoaderValue; this.classLoader = classLoaderValue; this.backends = backendsValue; this.runtimeOptions = runtimeOptionsValue; this.stopWatch = stopWatchValue; if (optionalGlueValue != null) { this.glue = optionalGlueValue; } else { this.glue = new RuntimeGlue( undefinedStepsTracker, new LocalizedXStreams(classLoaderValue)); } this.stats = new Stats(runtimeOptionsValue.isMonochrome()); for (Backend backend : backends) { backend.loadGlue(glue, runtimeOptions.getGlue()); backend.setUnreportedStepExecutor(this); } }
private void addTestStepsForPickleSteps(List<PickleStepTestStep> testSteps, PickleEvent pickleEvent) { for (PickleStep step : pickleEvent.pickle.getSteps()) { PickleStepDefinitionMatch match; try { match = glue.stepDefinitionMatch(pickleEvent.uri, step); if (match == null) { List<String> snippets = new ArrayList<>(); for (Backend backend : backends) { List<String> snippet = backend.getSnippet(step, "**KEYWORD**", runnerOptions.getSnippetType().getFunctionNameGenerator()); snippets.addAll(snippet); } if (!snippets.isEmpty()) { bus.send(new SnippetsSuggestedEvent(bus.getTime(), pickleEvent.uri, step.getLocations(), snippets)); } match = new UndefinedPickleStepDefinitionMatch(step); } } catch (AmbiguousStepDefinitionsException e) { match = new AmbiguousPickleStepDefinitionsMatch(pickleEvent.uri, step, e); } catch (Throwable t) { match = new FailedPickleStepInstantiationMatch(pickleEvent.uri, step, t); } List<HookTestStep> afterStepHookSteps = getAfterStepHooks(pickleEvent.pickle.getTags()); List<HookTestStep> beforeStepHookSteps = getBeforeStepHooks(pickleEvent.pickle.getTags()); testSteps.add(new PickleStepTestStep(pickleEvent.uri, step, beforeStepHookSteps, afterStepHookSteps, match)); } }
public String getSnippet(StepDTO serializableStep, SnippetType type) { return backend.getSnippet(serializableStep.toStep(), type.getFunctionNameGenerator()); }
public WorldDTO createWorld() { WorldDTO world = new WorldDTO(UUID.randomUUID(), backendName); backend.buildWorld(); worlds.put(world.getUuid(), world); return world; }
public void deleteWorld(UUID uuid) { Preconditions.checkState(worlds.containsKey(uuid), "No world exists with UUID %s", uuid); worlds.remove(uuid); backend.disposeWorld(); }
public GlueDTO createGlue(String ... paths) { SimpleGlue glue = new SimpleGlue(); backend.loadGlue(glue, Arrays.asList(paths)); glues.put(glue.getUuid(), glue); return new GlueDTO(glue); }
public void buildBackendWorlds(Reporter reporter, Set<Tag> tags, Scenario gherkinScenario) { for (Backend backend : backends) { backend.buildWorld(); } undefinedStepsTracker.reset(); skipNextStep = false; scenarioResult = new ScenarioImpl(reporter, tags, gherkinScenario); }
public void disposeBackendWorlds(String scenarioDesignation) { stats.addScenario(scenarioResult.getStatus(), scenarioDesignation); for (Backend backend : backends) { backend.disposeWorld(); } }