Make test results quieter

Signed-off-by: Andrew DeMaria <lostonamountain@gmail.com>
master
Andrew DeMaria 5 years ago
parent 1a7bb68dc6
commit 85f85fd88c
No known key found for this signature in database
GPG Key ID: 0A3F5E91F8364EDF
  1. 10
      airsonic-main/src/test/java/org/airsonic/player/TestCaseUtils.java
  2. 4
      airsonic-main/src/test/resources/application.properties
  3. 1
      airsonic-main/src/test/resources/logback.xml

@ -4,6 +4,8 @@ import org.airsonic.player.controller.JAXBWriter;
import org.airsonic.player.dao.DaoHelper; import org.airsonic.player.dao.DaoHelper;
import org.airsonic.player.service.MediaScannerService; import org.airsonic.player.service.MediaScannerService;
import org.apache.commons.io.FileUtils; import org.apache.commons.io.FileUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext;
@ -16,6 +18,8 @@ import java.util.stream.Collectors;
public class TestCaseUtils { public class TestCaseUtils {
private static final Logger LOG = LoggerFactory.getLogger(TestCaseUtils.class);
private static File airsonicHomeDirForTest = null; private static File airsonicHomeDirForTest = null;
/** /**
@ -33,7 +37,7 @@ public class TestCaseUtils {
} catch (IOException e) { } catch (IOException e) {
throw new RuntimeException("Error while creating temporary AIRSONIC_HOME directory for tests"); 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(); return airsonicHomeDirForTest.getAbsolutePath();
} }
@ -53,11 +57,11 @@ public class TestCaseUtils {
File airsonicHomeDir = new File(airsonicHomePathForTest()); File airsonicHomeDir = new File(airsonicHomePathForTest());
if (airsonicHomeDir.exists() && airsonicHomeDir.isDirectory()) { if (airsonicHomeDir.exists() && airsonicHomeDir.isDirectory()) {
System.out.println("Delete airsonic home (ie. "+airsonicHomeDir.getAbsolutePath()+")."); LOG.debug("Delete airsonic home (ie. {}).", airsonicHomeDir.getAbsolutePath());
try { try {
FileUtils.deleteDirectory(airsonicHomeDir); FileUtils.deleteDirectory(airsonicHomeDir);
} catch (IOException e) { } catch (IOException e) {
System.out.println("Error while deleting airsonic home."); LOG.warn("Error while deleting airsonic home.");
e.printStackTrace(); e.printStackTrace();
throw e; throw e;
} }

@ -2,8 +2,8 @@ spring.mvc.view.prefix: /WEB-INF/jsp/
spring.mvc.view.suffix: .jsp spring.mvc.view.suffix: .jsp
server.error.includeStacktrace: ALWAYS server.error.includeStacktrace: ALWAYS
logging.level.root=WARN logging.level.root=WARN
logging.level.org.airsonic=INFO logging.level.org.airsonic=WARN
logging.level.liquibase=INFO 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.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 logging.pattern.file=%d{yyyy-MM-dd HH:mm:ss.SSS} %5p --- %-40.40logger{32} : %m%n%wEx
DatabaseConfigType=legacy DatabaseConfigType=legacy

@ -4,5 +4,4 @@
<appender-ref ref="CONSOLE" /> <appender-ref ref="CONSOLE" />
<appender-ref ref="FILE" /> <appender-ref ref="FILE" />
</root> </root>
<logger name="liquibase" level="ERROR" />
</configuration> </configuration>
Loading…
Cancel
Save