From fd25dbcb5c93399556d1db55c9f0865a606f6b29 Mon Sep 17 00:00:00 2001 From: Marek Baluch Date: Tue, 6 Sep 2016 18:16:08 +0200 Subject: [PATCH] RHSSO-423 - Added default value for 'log-dir'. Set to ${project.build.dir}/surefire-reports --- .../util/junit/AggregateResultsReporter.java | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/testsuite/integration-arquillian/test-utils/src/main/java/org/keycloak/testsuite/util/junit/AggregateResultsReporter.java b/testsuite/integration-arquillian/test-utils/src/main/java/org/keycloak/testsuite/util/junit/AggregateResultsReporter.java index a0809c126c..2b1bf6ce04 100644 --- a/testsuite/integration-arquillian/test-utils/src/main/java/org/keycloak/testsuite/util/junit/AggregateResultsReporter.java +++ b/testsuite/integration-arquillian/test-utils/src/main/java/org/keycloak/testsuite/util/junit/AggregateResultsReporter.java @@ -86,13 +86,24 @@ public class AggregateResultsReporter extends RunListener { } private File createReportFile() throws Exception { - PropertiesConfiguration config = new PropertiesConfiguration(System.getProperty("testsuite.constants")); - config.setThrowExceptionOnMissing(true); + String logDirPath = null; - final File logDir = new File(config.getString("log-dir")); + try { + PropertiesConfiguration config = new PropertiesConfiguration(System.getProperty("testsuite.constants")); + 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(logDirPath); 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(); return reportFile;