From 28c1034fd71e96501cbb469d874dc43a5a749f4a Mon Sep 17 00:00:00 2001 From: Yuriy Artamonov Date: Fri, 18 Nov 2016 15:19:46 +0400 Subject: [PATCH] PL-8228 Ability to change logging options for tests using command line parameters --- .../cuba/client/testsupport/CubaClientTestCase.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/modules/client/test/com/haulmont/cuba/client/testsupport/CubaClientTestCase.java b/modules/client/test/com/haulmont/cuba/client/testsupport/CubaClientTestCase.java index 99bf6cd11e..f2204e041e 100644 --- a/modules/client/test/com/haulmont/cuba/client/testsupport/CubaClientTestCase.java +++ b/modules/client/test/com/haulmont/cuba/client/testsupport/CubaClientTestCase.java @@ -23,6 +23,7 @@ import com.haulmont.cuba.core.global.*; import com.haulmont.cuba.core.sys.AppContext; import mockit.Mocked; import mockit.NonStrictExpectations; +import org.apache.commons.lang.StringUtils; import java.util.ArrayList; import java.util.List; @@ -71,6 +72,13 @@ public class CubaClientTestCase { protected TestMessageTools messageTools; + public CubaClientTestCase() { + String property = System.getProperty("logback.configurationFile"); + if (StringUtils.isBlank(property)) { + System.setProperty("logback.configurationFile", "test-logback.xml"); + } + } + /** * Add entities package to build metadata from. Should be invoked by concrete test classes in their @Before method. * @param pack package FQN, e.g. com.haulmont.cuba.core.entity