protected String tryCreateNewBaseline(String actual) throws IOException {
  File file=new File(File.separator + DIRECTORY_TO_COPY_NEW_BASELINE + File.separator+ getSubDirectoryPathForNewBaseline()+ File.separator+ baselineFileName());
  Files.createParentDirs(file);
  Files.write(actual,file,Charset.defaultCharset());
  return file.toString();
}

protected String tryCreateNewBaseline ( String actual ) throws IOException { File file = new File ( File . separator + DIRECTORY_TO_COPY_NEW_BASELINE + File . separator + getSubDirectoryPathForNewBaseline ( ) + File . separator + baselineFileName ( ) ) ; Files . createParentDirs ( file ) ; Files . write ( actual , file , Charset . defaultCharset ( ) ) ; return file . toString ( ) ; }
creates a baseline file that will need to be used to make the current test pass . < p > if the test is failing for a valid reason ( e . g . developer changed some of the output text ) , then this file provides a convenient way for the developer to overwrite the old baseline and keep the test passing . < p > the created file is stored under / tmp or location specified by the environment variable directory_to_copy_new_baseline . information where the file is stored is returned as a string . < p > the directory structure of the package where the baseline file belongs can be retained by setting environment variable retain_directory_tree_for_baseline_output to true . if this variable is not set , the new baseline file is dropped inside a folder name { package name } _testdata < p > this method might be overridden to provide a different way to store a new baseline .
