use of cucumber.runtime.io.ResourceLoader in project cucumber-jvm by cucumber.
the class CucumberFeatureTest method mockFeatureFileResourceForAnyFeaturePath.
private ResourceLoader mockFeatureFileResourceForAnyFeaturePath(String feature) throws IOException {
ResourceLoader resourceLoader = mock(ResourceLoader.class);
Resource resource = mock(Resource.class);
when(resource.getPath()).thenReturn("");
when(resource.getInputStream()).thenReturn(new ByteArrayInputStream(feature.getBytes("UTF-8")));
when(resourceLoader.resources(anyString(), anyString())).thenReturn(singletonList(resource));
return resourceLoader;
}
use of cucumber.runtime.io.ResourceLoader in project cucumber-jvm by cucumber.
the class RuntimeTest method should_pass_if_no_features_are_found.
@Test
public void should_pass_if_no_features_are_found() throws IOException {
ResourceLoader resourceLoader = createResourceLoaderThatFindsNoFeatures();
Runtime runtime = createStrictRuntime(resourceLoader);
runtime.run();
assertEquals(0x0, runtime.exitStatus());
}
use of cucumber.runtime.io.ResourceLoader in project cucumber-jvm by cucumber.
the class RuntimeTest method createResourceLoaderThatFindsNoFeatures.
private ResourceLoader createResourceLoaderThatFindsNoFeatures() {
ResourceLoader resourceLoader = mock(ResourceLoader.class);
when(resourceLoader.resources(anyString(), eq(".feature"))).thenReturn(Collections.<Resource>emptyList());
return resourceLoader;
}
use of cucumber.runtime.io.ResourceLoader in project activityinfo by bedatadriven.
the class TestMain method queueUiTests.
private void queueUiTests() {
ResourceLoader loader = new MultiLoader(getClass().getClassLoader());
RuntimeOptions options = new RuntimeOptions(Arrays.asList("--tags", "@web", "classpath:org/activityinfo/test", "--glue", "org.activityinfo.test.steps.common", "--glue", "org.activityinfo.test.steps.web"));
queueFeatures("ui", loader, options, new WebDriverModule(webDriverType));
queueTestMethods("ui", new WebDriverModule(webDriverType));
}
use of cucumber.runtime.io.ResourceLoader in project page-factory-2 by sbtqa.
the class FragmentCacheUtils method cacheFragmentsToFeatures.
static List<CucumberFeature> cacheFragmentsToFeatures(Class clazz, List<CucumberFeature> features) {
if (PROPERTIES.getFragmentsPath().isEmpty()) {
return features;
} else {
ClassLoader classLoader = clazz.getClassLoader();
ResourceLoader resourceLoader = new MultiLoader(classLoader);
List<CucumberFeature> fragmentsRaw = new FeatureLoader(resourceLoader).load(Collections.singletonList(FeaturePath.parse(PROPERTIES.getFragmentsPath())));
return Stream.concat(features.stream(), fragmentsRaw.stream()).collect(Collectors.toList());
}
}
Aggregations