/** * Initialization of JavaBackend with {@link FluentObjectFactory} for FluentCucumber tests. * * @return backend with {@link FluentObjectFactory} */ private JavaBackend getBackend(ClassFinder classFinder, RuntimeOptions runtimeOptions, FluentObjectFactory objectFactory) { Reflections reflections = new Reflections(classFinder); TypeRegistryConfigurer typeRegistryConfigurer = reflections.instantiateExactlyOneSubclass(TypeRegistryConfigurer.class, MultiLoader.packageName(runtimeOptions.getGlue()), new Class[0], new Object[0], new DefaultTypeRegistryConfiguration()); return new JavaBackend(objectFactory, classFinder, new TypeRegistry(typeRegistryConfigurer.locale())); }
/** * {@inheritDoc} */ @Override public List<String> getGlue() { return this.ros.getGlue(); }
private static RuntimeOptions loadRuntimeOptions(final Class<?> javaTestClass, final Properties cukespaceConfigurationProperties) { final RuntimeOptions runtimeOptions; if (javaTestClass.getAnnotation(CucumberOptions.class) != null) { // by class setting final RuntimeOptionsFactory runtimeOptionsFactory = new RuntimeOptionsFactory(javaTestClass); runtimeOptions = runtimeOptionsFactory.create(); cleanClasspathList(runtimeOptions.getGlue()); cleanClasspathList(runtimeOptions.getFeaturePaths()); } else if (cukespaceConfigurationProperties.containsKey(CucumberConfiguration.OPTIONS)) { // arquillian setting runtimeOptions = new RuntimeOptions(new Env("cucumber-jvm"), asList((cukespaceConfigurationProperties.getProperty(CucumberConfiguration.OPTIONS, "--strict") + " --strict").split(" "))); } else { // default runtimeOptions = new RuntimeOptions(new Env("cucumber-jvm"), asList("--strict", "--plugin", "pretty", areColorsNotAvailable(cukespaceConfigurationProperties))); } return runtimeOptions; }
runtimeOptions.addPlugin(formatObj); runtimeOptions.getGlue().addAll(stepdefinitionList); cucumberFeatures = CucumberFeature.load(resourceLoader, featurePaths, filters);
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); } }
/** * Initialization of JavaBackend with {@link FluentObjectFactory} for FluentCucumber tests. * * @return backend with {@link FluentObjectFactory} */ private JavaBackend getBackend(ClassFinder classFinder, RuntimeOptions runtimeOptions, FluentObjectFactory objectFactory) { Reflections reflections = new Reflections(classFinder); TypeRegistryConfigurer typeRegistryConfigurer = reflections.instantiateExactlyOneSubclass(TypeRegistryConfigurer.class, MultiLoader.packageName(runtimeOptions.getGlue()), new Class[0], new Object[0], new DefaultTypeRegistryConfiguration()); return new JavaBackend(objectFactory, classFinder, new TypeRegistry(typeRegistryConfigurer.locale())); }