public static void createDotStoryFile ( String scenarioName , String srcTestRootFolder , String packagePath , String givenDescription , String whenDescription , String thenDescription ) throws BeastException { String [ ] folders = packagePath . split ( "." ) ; for ( String folder : folders ) { srcTestRootFolder += "/" + folder ; } FileWriter writer = createFileWriter ( createDotStoryName ( scenarioName ) , packagePath , srcTestRootFolder ) ; try { writer . write ( "Scenario: " + scenarioName + "\n" ) ; writer . write ( "Given " + givenDescription + "\n" ) ; writer . write ( "When " + whenDescription + "\n" ) ; writer . write ( "Then " + thenDescription + "\n" ) ; writer . close ( ) ; } catch ( Exception e ) { String message = "Unable to write the .story file for the scenario " + scenarioName ; logger . severe ( message ) ; logger . severe ( e . getMessage ( ) ) ; throw new BeastException ( message , e ) ; } }
Creates the . story file necessary for every Beast Test Case .