Search in sources :

Example 1 with FilePathResolver

use of org.jbehave.core.reporters.FilePrintStreamFactory.FilePathResolver in project jbehave-core by jbehave.

the class FilePrintStreamFactoryBehaviour method shouldResolveOutputNameFromStoryLocationWithSimpleNameResolver.

@Test
public void shouldResolveOutputNameFromStoryLocationWithSimpleNameResolver() {
    FilePathResolver resolver = new ResolveToSimpleName();
    assertThatOutputNameIs("org/jbehave/examples/trader/stories/my_given.story", "my_given.ext", resolver);
    assertThatOutputNameIs("/org/jbehave/examples/trader/stories/my_given.story", "my_given.ext", resolver);
    assertThatOutputNameIs("my_given.story", "my_given.ext", resolver);
    assertThatOutputNameIs("my_given", "my_given.ext", resolver);
}
Also used : FilePathResolver(org.jbehave.core.reporters.FilePrintStreamFactory.FilePathResolver) ResolveToSimpleName(org.jbehave.core.reporters.FilePrintStreamFactory.ResolveToSimpleName) Test(org.junit.Test)

Example 2 with FilePathResolver

use of org.jbehave.core.reporters.FilePrintStreamFactory.FilePathResolver in project jbehave-core by jbehave.

the class SpringStoryReporterBuilderBehaviour method shouldAllowUseOfGettersAndSetters.

@Test
public void shouldAllowUseOfGettersAndSetters() {
    SpringStoryReporterBuilder builder = new SpringStoryReporterBuilder();
    URL codeLocation = CodeLocations.codeLocationFromClass(this.getClass());
    builder.setCodeLocation(codeLocation);
    assertThat(builder.getCodeLocation(), equalTo(codeLocation));
    List<Format> formats = asList(Format.CONSOLE, Format.HTML);
    builder.setFormats(formats);
    assertThat(builder.getFormats(), equalTo(formats));
    Keywords keywords = new LocalizedKeywords();
    builder.setKeywords(keywords);
    assertThat(builder.getKeywords(), equalTo(keywords));
    String relativeDirectory = "reports";
    builder.setRelativeDirectory(relativeDirectory);
    assertThat(builder.getRelativeDirectory(), equalTo(relativeDirectory));
    assertThat(builder.getOutputDirectory(), endsWith(relativeDirectory));
    Properties viewResources = new Properties();
    builder.setViewResources(viewResources);
    assertThat(builder.getViewResources(), equalTo(viewResources));
    boolean reportFailureTrace = true;
    builder.setReportFailureTrace(reportFailureTrace);
    assertThat(builder.isReportFailureTrace(), equalTo(reportFailureTrace));
    FilePathResolver pathResolver = new FileConfiguration().getPathResolver();
    builder.setPathResolver(pathResolver);
    assertThat(builder.getPathResolver(), equalTo(pathResolver));
}
Also used : FileConfiguration(org.jbehave.core.reporters.FilePrintStreamFactory.FileConfiguration) FilePathResolver(org.jbehave.core.reporters.FilePrintStreamFactory.FilePathResolver) Format(org.jbehave.core.reporters.Format) Keywords(org.jbehave.core.configuration.Keywords) LocalizedKeywords(org.jbehave.core.i18n.LocalizedKeywords) LocalizedKeywords(org.jbehave.core.i18n.LocalizedKeywords) Properties(java.util.Properties) URL(java.net.URL) Test(org.junit.Test)

Aggregations

FilePathResolver (org.jbehave.core.reporters.FilePrintStreamFactory.FilePathResolver)2 Test (org.junit.Test)2 URL (java.net.URL)1 Properties (java.util.Properties)1 Keywords (org.jbehave.core.configuration.Keywords)1 LocalizedKeywords (org.jbehave.core.i18n.LocalizedKeywords)1 FileConfiguration (org.jbehave.core.reporters.FilePrintStreamFactory.FileConfiguration)1 ResolveToSimpleName (org.jbehave.core.reporters.FilePrintStreamFactory.ResolveToSimpleName)1 Format (org.jbehave.core.reporters.Format)1