本文整理汇总了Java中cucumber.runtime.Backend类的典型用法代码示例。如果您正苦于以下问题:Java Backend类的具体用法?Java Backend怎么用?Java Backend使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Backend类属于cucumber.runtime包,在下文中一共展示了Backend类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: closeWebDriverPool
import cucumber.runtime.Backend; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private void closeWebDriverPool() {
try {
Runtime runtime = (Runtime) FieldUtils.readField(this, "runtime", true);
Collection<? extends Backend> backends =
(Collection<? extends Backend>) FieldUtils.readField(runtime, "backends", true);
for (Backend backend : backends) {
if (backend instanceof JavaBackend) {
GuiceFactory factory =
(GuiceFactory) FieldUtils.readField(backend, "objectFactory", true);
WebDriverRegistry webDriverRegistry = factory.getInstance(WebDriverRegistry.class);
webDriverRegistry.shutdown();
}
}
} catch (IllegalAccessException e) {
LOG.error("unable to close web driver pool", e);
}
}
示例2: onCreate
import cucumber.runtime.Backend; //导入依赖的package包/类
@Override
public void onCreate(Bundle arguments) {
Context context = getContext();
Properties properties = new Properties();
String glue = context.getPackageName();
String features = "features";
properties.setProperty("cucumber.options", String.format("-g %s %s", glue, features));
mRuntimeOptions = new RuntimeOptions(properties);
mResourceLoader = new AndroidResourceLoader(context);
List<Backend> backends = new ArrayList<Backend>();
backends.add(new AndroidBackend(this));
mRuntime = new Runtime(mResourceLoader, getLoader(), backends, mRuntimeOptions);
mFormatter = new AndroidFormatter(TAG);
mRuntimeOptions.formatters.clear();
mRuntimeOptions.formatters.add(mFormatter);
super.onCreate(arguments);
}
示例3: setUp
import cucumber.runtime.Backend; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
when(i18n.keywords(GIVEN)).thenReturn(Arrays.asList(GIVEN));
when(scenario.getId()).thenReturn(SCENARIO_ID);
List<Backend> backends = Arrays.asList(backend);
threadLoggedRuntime = new ThreadLoggedRuntime(resourceLoader, classLoader, backends, runtimeOptions, threadExecutionRecorder);
}
示例4: getBackends
import cucumber.runtime.Backend; //导入依赖的package包/类
@Override
public List<Backend> getBackends() {
wasInvoked = true;
ResourceLoader resourceLoader = new MultiLoader(Thread.currentThread().getContextClassLoader());
Backend backend = new JavaBackend(resourceLoader);
return Arrays.asList(backend);
}
示例5: allBackends
import cucumber.runtime.Backend; //导入依赖的package包/类
protected List<Backend> allBackends() throws IOException {
ArrayList<RemoteBackend> remoteBackends = Lists.newArrayList();
for (RemoteBackendProperties remoteBackendProperties : cucumberProperties.getRemoteBackends()) {
remoteBackends.add(remoteBackendProperties.createRemoteBackend());
}
Backend miniumBackend = rhinoEngine.runWithContext(rhinoEngine.new RhinoCallable<Backend, IOException>() {
@Override
protected Backend doCall(Context cx, Scriptable scope) throws IOException {
return new MiniumBackend(resourceLoader, cx, scope);
}
});
return ImmutableList.<Backend> builder().add(miniumBackend).addAll(remoteBackends).build();
}
示例6: ThreadLoggedRuntime
import cucumber.runtime.Backend; //导入依赖的package包/类
public ThreadLoggedRuntime(ResourceLoader resourceLoader, ClassLoader classLoader,
Collection<? extends Backend> backends, RuntimeOptions runtimeOptions,
ThreadExecutionRecorder threadExecutionRecorder) {
super(resourceLoader, classLoader, backends, runtimeOptions);
this.threadExecutionRecorder = threadExecutionRecorder;
}
示例7: register
import cucumber.runtime.Backend; //导入依赖的package包/类
public BackendRegistry register(String name, Backend backend) {
Preconditions.checkState(!backends.containsKey(name), "Backend with name %s already registered", name);
backends.put(name, backend);
return this;
}
示例8: getAll
import cucumber.runtime.Backend; //导入依赖的package包/类
public Map<String, Backend> getAll() {
return new HashMap<String, Backend>(backends);
}
示例9: BackendContext
import cucumber.runtime.Backend; //导入依赖的package包/类
public BackendContext(String backendName, Backend backend) {
this.backendName = backendName;
this.backend = backend;
}
示例10: CucumberRestController
import cucumber.runtime.Backend; //导入依赖的package包/类
public CucumberRestController(Backend backend) {
this(new BackendRegistry().register(DEFAULT_BACKEND, backend));
}
示例11: backendMock
import cucumber.runtime.Backend; //导入依赖的package包/类
@Bean(name = "mockedBackend")
public Backend backendMock() {
return mock(Backend.class);
}
示例12: backend
import cucumber.runtime.Backend; //导入依赖的package包/类
@Bean
public Backend backend() {
return new JavaBackend(resourceLoader());
}
示例13: withBackends
import cucumber.runtime.Backend; //导入依赖的package包/类
public RuntimeBuilder withBackends(Backend ... backends) {
return withBackends(Arrays.asList(backends));
}
示例14: getBackends
import cucumber.runtime.Backend; //导入依赖的package包/类
List<Backend> getBackends();