diff options
Diffstat (limited to 'jdisc_core_test/integration_test/src/test/java/com/yahoo/jdisc/core/OsgiLogManagerIntegrationTest.java')
-rw-r--r-- | jdisc_core_test/integration_test/src/test/java/com/yahoo/jdisc/core/OsgiLogManagerIntegrationTest.java | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/jdisc_core_test/integration_test/src/test/java/com/yahoo/jdisc/core/OsgiLogManagerIntegrationTest.java b/jdisc_core_test/integration_test/src/test/java/com/yahoo/jdisc/core/OsgiLogManagerIntegrationTest.java new file mode 100644 index 00000000000..f6f717df7fa --- /dev/null +++ b/jdisc_core_test/integration_test/src/test/java/com/yahoo/jdisc/core/OsgiLogManagerIntegrationTest.java @@ -0,0 +1,30 @@ +// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +package com.yahoo.jdisc.core; + +import org.junit.Test; +import org.mockito.Mockito; +import org.osgi.framework.BundleContext; + +import java.util.logging.Level; +import java.util.logging.Logger; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; + + +/** + * @author <a href="mailto:simon@yahoo-inc.com">Simon Thoresen Hult</a> + */ +public class OsgiLogManagerIntegrationTest { + + @Test + public void requireThatRootLoggerLevelIsNotModifiedIfLoggerConfigIsGiven() { + Logger logger = Logger.getLogger(""); + logger.setLevel(Level.WARNING); + + OsgiLogManager.newInstance().install(Mockito.mock(BundleContext.class)); + + assertNotNull(System.getProperty("java.util.logging.config.file")); + assertEquals(Level.WARNING, logger.getLevel()); + } +} |