use of cucumber.runtime.java.JavaBackend in project cucumber-jvm by cucumber.
the class CucumberExecutor method createBackends.
private Collection<? extends Backend> createBackends() {
final ObjectFactory delegateObjectFactory = ObjectFactoryLoader.loadObjectFactory(classFinder, Env.INSTANCE.get(ObjectFactory.class.getName()));
final AndroidObjectFactory objectFactory = new AndroidObjectFactory(delegateObjectFactory, instrumentation);
final List<Backend> backends = new ArrayList<Backend>();
backends.add(new JavaBackend(objectFactory, classFinder));
return backends;
}
use of cucumber.runtime.java.JavaBackend in project cucumber-jvm by cucumber.
the class CalculatorTest method cucumber.
@Test
public void cucumber() throws Exception {
assertNotNull(injector);
assertNotNull(bundleContext);
final ResourceLoader resourceLoader = new FileResourceLoader();
final ClassLoader classLoader = Runtime.class.getClassLoader();
final ObjectFactory objectFactory = new PaxExamObjectFactory(injector);
final ClassFinder classFinder = new OsgiClassFinder(bundleContext);
final Backend backend = new JavaBackend(objectFactory, classFinder);
final RuntimeOptionsFactory runtimeOptionsFactory = new RuntimeOptionsFactory(getClass());
final RuntimeOptions runtimeOptions = runtimeOptionsFactory.create();
final Runtime runtime = new Runtime(resourceLoader, classLoader, Collections.singleton(backend), runtimeOptions);
runtime.run();
if (!runtime.getErrors().isEmpty()) {
throw new CucumberException(runtime.getErrors().get(0));
} else if (runtime.exitStatus() != 0x00) {
throw new CucumberException("There are pending or undefined steps.");
}
assertEquals(runtime.getErrors().size(), 0);
}
use of cucumber.runtime.java.JavaBackend in project activityinfo by bedatadriven.
the class ScenarioTestCase method createCucumberRuntime.
private Runtime createCucumberRuntime() {
List<Module> moduleList = new ArrayList<>();
moduleList.add(new ScenarioModule(new SequentialScenarioScope()));
moduleList.addAll(testConditions.getModules());
Injector injector = Guice.createInjector(moduleList);
ClassLoader classLoader = getClass().getClassLoader();
ResourceLoader resourceLoader = new MultiLoader(classLoader);
ClassFinder classFinder = new ResourceLoaderClassFinder(resourceLoader, classLoader);
JavaBackend backend = new JavaBackend(new GuiceObjectFactory(injector), classFinder);
return new Runtime(resourceLoader, classLoader, Collections.singleton(backend), options);
}
Aggregations