RHSSO-423 - Added default value for 'log-dir'. Set to ${project.build.dir}/surefire-reports
This commit is contained in:
parent
eebd496c2f
commit
fd25dbcb5c
1 changed files with 15 additions and 4 deletions
|
@ -86,13 +86,24 @@ public class AggregateResultsReporter extends RunListener {
|
||||||
}
|
}
|
||||||
|
|
||||||
private File createReportFile() throws Exception {
|
private File createReportFile() throws Exception {
|
||||||
|
String logDirPath = null;
|
||||||
|
|
||||||
|
try {
|
||||||
PropertiesConfiguration config = new PropertiesConfiguration(System.getProperty("testsuite.constants"));
|
PropertiesConfiguration config = new PropertiesConfiguration(System.getProperty("testsuite.constants"));
|
||||||
config.setThrowExceptionOnMissing(true);
|
config.setThrowExceptionOnMissing(true);
|
||||||
|
logDirPath = config.getString("log-dir");
|
||||||
|
} catch (Exception e) {
|
||||||
|
logDirPath = System.getProperty("project.build.directory");
|
||||||
|
if (logDirPath == null) {
|
||||||
|
throw new RuntimeException("Could not determine the path to the log directory.");
|
||||||
|
}
|
||||||
|
logDirPath += File.separator + "surefire-reports";
|
||||||
|
}
|
||||||
|
|
||||||
final File logDir = new File(config.getString("log-dir"));
|
final File logDir = new File(logDirPath);
|
||||||
logDir.mkdirs();
|
logDir.mkdirs();
|
||||||
|
|
||||||
final File reportFile = new File(logDir, "junit-report.xml").getAbsoluteFile();
|
final File reportFile = new File(logDir, "junit-single-report.xml").getAbsoluteFile();
|
||||||
reportFile.createNewFile();
|
reportFile.createNewFile();
|
||||||
|
|
||||||
return reportFile;
|
return reportFile;
|
||||||
|
|
Loading…
Reference in a new issue