Search in sources :

Example 1 with LoadFromURL

use of org.jbehave.core.io.LoadFromURL in project jbehave-core by jbehave.

the class CoreStoriesUsingURLs method configuration.

@Override
public Configuration configuration() {
    Configuration configuration = super.configuration();
    StoryReporterBuilder builder = configuration.storyReporterBuilder();
    builder.withPathResolver(new ResolveToSimpleName());
    return configuration.useStoryLoader(new LoadFromURL());
}
Also used : StoryReporterBuilder(org.jbehave.core.reporters.StoryReporterBuilder) LoadFromURL(org.jbehave.core.io.LoadFromURL) Configuration(org.jbehave.core.configuration.Configuration) ResolveToSimpleName(org.jbehave.core.reporters.FilePrintStreamFactory.ResolveToSimpleName)

Example 2 with LoadFromURL

use of org.jbehave.core.io.LoadFromURL in project jbehave-core by jbehave.

the class OdtLoaderBehaviour method shouldLoadOdtResourceFromURL.

@Test
public void shouldLoadOdtResourceFromURL() {
    String location = CodeLocations.codeLocationFromClass(this.getClass()).toString();
    String resourceFromOdtWithTable = new LoadOdtFromURL().loadResourceAsText(location + "org/jbehave/core/io/odf/stories/a_story.odt");
    String resourceFromTxt = new LoadFromURL().loadResourceAsText(location + "org/jbehave/core/io/odf/stories/a_story.txt");
    assertThatOutputIs(resourceFromOdtWithTable.trim(), resourceFromTxt.trim());
}
Also used : LoadFromURL(org.jbehave.core.io.LoadFromURL) Test(org.junit.Test)

Example 3 with LoadFromURL

use of org.jbehave.core.io.LoadFromURL in project jbehave-core by jbehave.

the class ConfigurationProducer method getConfiguration.

@Produces
@WeldConfiguration
Configuration getConfiguration() {
    Properties viewResources = new Properties();
    viewResources.setProperty("index", "my-reports-index.ftl");
    viewResources.setProperty("decorateNonHtml", "true");
    TableTransformers tableTransformers = new TableTransformers();
    LoadFromURL resourceLoader = new LoadFromURL();
    return new MostUsefulConfiguration().useStoryControls(new StoryControls().doDryRun(true).doSkipScenariosAfterFailure(true)).useFailureStrategy(new SilentlyAbsorbingFailure()).useStoryLoader(resourceLoader).useStepPatternParser(new RegexPrefixCapturingPatternParser("MyPrefix")).useStoryReporterBuilder(new StoryReporterBuilder().withDefaultFormats().withFormats(CONSOLE, HTML, TXT, XML).withKeywords(new LocalizedKeywords(Locale.ITALIAN)).withRelativeDirectory("my-output-directory").withViewResources(viewResources).withFailureTrace(true)).useParameterConverters(new ParameterConverters(resourceLoader, tableTransformers).addConverters(new CustomConverter(), new MyDateConverter())).useTableTransformers(tableTransformers);
}
Also used : SilentlyAbsorbingFailure(org.jbehave.core.failures.SilentlyAbsorbingFailure) RegexPrefixCapturingPatternParser(org.jbehave.core.parsers.RegexPrefixCapturingPatternParser) StoryReporterBuilder(org.jbehave.core.reporters.StoryReporterBuilder) LoadFromURL(org.jbehave.core.io.LoadFromURL) MostUsefulConfiguration(org.jbehave.core.configuration.MostUsefulConfiguration) ParameterConverters(org.jbehave.core.steps.ParameterConverters) LocalizedKeywords(org.jbehave.core.i18n.LocalizedKeywords) StoryControls(org.jbehave.core.embedder.StoryControls) Properties(java.util.Properties) TableTransformers(org.jbehave.core.model.TableTransformers) Produces(javax.enterprise.inject.Produces) WeldConfiguration(org.jbehave.core.annotations.weld.WeldConfiguration)

Aggregations

LoadFromURL (org.jbehave.core.io.LoadFromURL)3 StoryReporterBuilder (org.jbehave.core.reporters.StoryReporterBuilder)2 Properties (java.util.Properties)1 Produces (javax.enterprise.inject.Produces)1 WeldConfiguration (org.jbehave.core.annotations.weld.WeldConfiguration)1 Configuration (org.jbehave.core.configuration.Configuration)1 MostUsefulConfiguration (org.jbehave.core.configuration.MostUsefulConfiguration)1 StoryControls (org.jbehave.core.embedder.StoryControls)1 SilentlyAbsorbingFailure (org.jbehave.core.failures.SilentlyAbsorbingFailure)1 LocalizedKeywords (org.jbehave.core.i18n.LocalizedKeywords)1 TableTransformers (org.jbehave.core.model.TableTransformers)1 RegexPrefixCapturingPatternParser (org.jbehave.core.parsers.RegexPrefixCapturingPatternParser)1 ResolveToSimpleName (org.jbehave.core.reporters.FilePrintStreamFactory.ResolveToSimpleName)1 ParameterConverters (org.jbehave.core.steps.ParameterConverters)1 Test (org.junit.Test)1