Repository: logging-log4j2 Updated Branches: refs/heads/master 1bd864729 -> 34c00ef8b
This test does not clean up after itself. Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/34c00ef8 Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/34c00ef8 Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/34c00ef8 Branch: refs/heads/master Commit: 34c00ef8b4ef78e65aec4df34c9c5944fef55c07 Parents: 1bd8647 Author: Gary Gregory <[email protected]> Authored: Sun Nov 23 00:17:00 2014 -0500 Committer: Gary Gregory <[email protected]> Committed: Sun Nov 23 00:17:00 2014 -0500 ---------------------------------------------------------------------- .../org/apache/logging/log4j/jul/ApiLoggerTest.java | 14 +++++++++++--- .../logging/log4j/jul/CallerInformationTest.java | 6 ++++++ 2 files changed, 17 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/34c00ef8/log4j-jul/src/test/java/org/apache/logging/log4j/jul/ApiLoggerTest.java ---------------------------------------------------------------------- diff --git a/log4j-jul/src/test/java/org/apache/logging/log4j/jul/ApiLoggerTest.java b/log4j-jul/src/test/java/org/apache/logging/log4j/jul/ApiLoggerTest.java index 7ad1470..22ae355 100644 --- a/log4j-jul/src/test/java/org/apache/logging/log4j/jul/ApiLoggerTest.java +++ b/log4j-jul/src/test/java/org/apache/logging/log4j/jul/ApiLoggerTest.java @@ -17,17 +17,19 @@ package org.apache.logging.log4j.jul; +import static org.hamcrest.Matchers.equalTo; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertThat; + import java.util.logging.Logger; import org.apache.logging.log4j.test.appender.ListAppender; import org.junit.After; +import org.junit.AfterClass; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; -import static org.hamcrest.Matchers.equalTo; -import static org.junit.Assert.*; - public class ApiLoggerTest extends AbstractLoggerTest { @BeforeClass @@ -36,6 +38,12 @@ public class ApiLoggerTest extends AbstractLoggerTest { System.setProperty(Constants.LOGGER_ADAPTOR_PROPERTY, ApiLoggerAdapter.class.getName()); } + @AfterClass + public static void tearDownClass() { + System.clearProperty("java.util.logging.manager"); + System.clearProperty(Constants.LOGGER_ADAPTOR_PROPERTY); + } + @Before public void setUp() throws Exception { logger = Logger.getLogger(LOGGER_NAME); http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/34c00ef8/log4j-jul/src/test/java/org/apache/logging/log4j/jul/CallerInformationTest.java ---------------------------------------------------------------------- diff --git a/log4j-jul/src/test/java/org/apache/logging/log4j/jul/CallerInformationTest.java b/log4j-jul/src/test/java/org/apache/logging/log4j/jul/CallerInformationTest.java index a2b6cf3..04fe136 100644 --- a/log4j-jul/src/test/java/org/apache/logging/log4j/jul/CallerInformationTest.java +++ b/log4j-jul/src/test/java/org/apache/logging/log4j/jul/CallerInformationTest.java @@ -21,6 +21,7 @@ import java.util.logging.Logger; import org.apache.logging.log4j.junit.InitialLoggerContext; import org.apache.logging.log4j.test.appender.ListAppender; +import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Rule; import org.junit.Test; @@ -40,6 +41,11 @@ public class CallerInformationTest { System.setProperty("java.util.logging.manager", LogManager.class.getName()); } + @AfterClass + public static void tearDownClass() { + System.clearProperty("java.util.logging.manager"); + } + @Test public void testClassLogger() throws Exception { final ListAppender app = ctx.getListAppender("Class").clear();
