From 85f85fd88caac06ffe2628b86c130767eff946ff Mon Sep 17 00:00:00 2001 From: Andrew DeMaria Date: Sun, 6 Oct 2019 19:20:05 -0600 Subject: [PATCH] Make test results quieter Signed-off-by: Andrew DeMaria --- .../test/java/org/airsonic/player/TestCaseUtils.java | 10 +++++++--- .../src/test/resources/application.properties | 4 ++-- airsonic-main/src/test/resources/logback.xml | 1 - 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/airsonic-main/src/test/java/org/airsonic/player/TestCaseUtils.java b/airsonic-main/src/test/java/org/airsonic/player/TestCaseUtils.java index 6e530521..9548b0e2 100644 --- a/airsonic-main/src/test/java/org/airsonic/player/TestCaseUtils.java +++ b/airsonic-main/src/test/java/org/airsonic/player/TestCaseUtils.java @@ -4,6 +4,8 @@ import org.airsonic.player.controller.JAXBWriter; import org.airsonic.player.dao.DaoHelper; import org.airsonic.player.service.MediaScannerService; import org.apache.commons.io.FileUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; @@ -16,6 +18,8 @@ import java.util.stream.Collectors; public class TestCaseUtils { + private static final Logger LOG = LoggerFactory.getLogger(TestCaseUtils.class); + private static File airsonicHomeDirForTest = null; /** @@ -33,7 +37,7 @@ public class TestCaseUtils { } catch (IOException e) { throw new RuntimeException("Error while creating temporary AIRSONIC_HOME directory for tests"); } - System.out.println("AIRSONIC_HOME directory will be "+airsonicHomeDirForTest.getAbsolutePath()); + LOG.info("AIRSONIC_HOME directory will be {}", airsonicHomeDirForTest.getAbsolutePath()); } return airsonicHomeDirForTest.getAbsolutePath(); } @@ -53,11 +57,11 @@ public class TestCaseUtils { File airsonicHomeDir = new File(airsonicHomePathForTest()); if (airsonicHomeDir.exists() && airsonicHomeDir.isDirectory()) { - System.out.println("Delete airsonic home (ie. "+airsonicHomeDir.getAbsolutePath()+")."); + LOG.debug("Delete airsonic home (ie. {}).", airsonicHomeDir.getAbsolutePath()); try { FileUtils.deleteDirectory(airsonicHomeDir); } catch (IOException e) { - System.out.println("Error while deleting airsonic home."); + LOG.warn("Error while deleting airsonic home."); e.printStackTrace(); throw e; } diff --git a/airsonic-main/src/test/resources/application.properties b/airsonic-main/src/test/resources/application.properties index 6d6640b1..7899af1b 100644 --- a/airsonic-main/src/test/resources/application.properties +++ b/airsonic-main/src/test/resources/application.properties @@ -2,8 +2,8 @@ spring.mvc.view.prefix: /WEB-INF/jsp/ spring.mvc.view.suffix: .jsp server.error.includeStacktrace: ALWAYS logging.level.root=WARN -logging.level.org.airsonic=INFO -logging.level.liquibase=INFO +logging.level.org.airsonic=WARN +logging.level.liquibase=WARN logging.pattern.console=%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(%5p){green} %clr(---){faint} %clr(%-40.40logger{32}){blue} %clr(:){faint} %m%n%wEx logging.pattern.file=%d{yyyy-MM-dd HH:mm:ss.SSS} %5p --- %-40.40logger{32} : %m%n%wEx DatabaseConfigType=legacy diff --git a/airsonic-main/src/test/resources/logback.xml b/airsonic-main/src/test/resources/logback.xml index fcce9982..6fae2140 100644 --- a/airsonic-main/src/test/resources/logback.xml +++ b/airsonic-main/src/test/resources/logback.xml @@ -4,5 +4,4 @@ - \ No newline at end of file