JBehave
  1. JBehave
  2. JBEHAVE-849

Make it easy to pick the output directory for the reports

    Details

    • Type: Improvement Improvement
    • Status: Open Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Number of attachments :
      0

      Description

      As part of my usage of JBehave I need to control where the reports are being written. Unless I missed an obvious API the code I currently use (see code below) is particularly verbose (=and not easy to figure out)=. I think it would be great is there was something on the MostUsefulConfiguration object (or other object) to let the user set the output folder or any other simpler way.

      .useStoryReporterBuilder(
      new StoryReporterBuilder() {
      protected org.jbehave.core.reporters.FilePrintStreamFactory filePrintStreamFactory(String storyPath) {
      return new FilePrintStreamFactory(new StoryLocation(codeLocation(), storyPath), fileConfiguration("")) {
      public File outputDirectory()

      { return new File("c:/dev/tmp/behave"); }

      ;
      };
      };

        Activity

        Hide
        Mauro Talevi added a comment -

        The StoryReporterBuilder exposes the methods withCodeLocation() and withRelativeDirectory() to this end.

        configuration.useStoryReporterBuilder(new StoryReporterBuilder().withCodeLocation("/dev/output").withRelativeDirectory("jbehave"))
        
        Show
        Mauro Talevi added a comment - The StoryReporterBuilder exposes the methods withCodeLocation() and withRelativeDirectory() to this end. configuration.useStoryReporterBuilder( new StoryReporterBuilder().withCodeLocation( "/dev/output" ).withRelativeDirectory( "jbehave" ))

          People

          • Assignee:
            Unassigned
            Reporter:
            Pascal Rapicault
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated: