nl.hsac.fitnesse.junit.reportmerge.writer.OverviewFileWriter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hsac-fitnesse-fixtures Show documentation
Show all versions of hsac-fitnesse-fixtures Show documentation
Fixtures to assist in testing via FitNesse
package nl.hsac.fitnesse.junit.reportmerge.writer;
import nl.hsac.fitnesse.junit.reportmerge.TestReportHtml;
import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
import java.nio.charset.StandardCharsets;
import java.util.List;
public abstract class OverviewFileWriter {
private final File file;
protected PrintWriter pw;
public OverviewFileWriter(File parentDir, String name) {
file = new File(parentDir, name);
}
public String write(List reports) throws IOException {
pw = new PrintWriter(file, StandardCharsets.UTF_8.name());
try {
writeContent(reports);
} finally {
if (pw != null) {
pw.flush();
pw.close();
}
}
return file.getAbsolutePath();
}
protected abstract void writeContent(List reports) throws IOException;
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy