You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by ma...@apache.org on 2017/08/26 20:53:59 UTC
[41/50] logging-log4j2 git commit: Fix system property resets in unit
test
Fix system property resets in unit test
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/3efa9d41
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/3efa9d41
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/3efa9d41
Branch: refs/heads/LOG4J2-1431
Commit: 3efa9d41eaeb118bd5de28613d32e99cbfe0de01
Parents: bf06bb2
Author: Matt Sicker <ma...@spr.com>
Authored: Sat Aug 26 14:26:42 2017 -0500
Committer: Matt Sicker <ma...@spr.com>
Committed: Sat Aug 26 15:50:56 2017 -0500
----------------------------------------------------------------------
.../logging/log4j/core/util/ClockFactoryTest.java | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/3efa9d41/log4j-core/src/test/java/org/apache/logging/log4j/core/util/ClockFactoryTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/util/ClockFactoryTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/util/ClockFactoryTest.java
index c9b3b91..309cc77 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/util/ClockFactoryTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/util/ClockFactoryTest.java
@@ -16,16 +16,16 @@
*/
package org.apache.logging.log4j.core.util;
-import static org.junit.Assert.assertSame;
-
import java.lang.reflect.Field;
import org.apache.commons.lang3.reflect.FieldUtils;
import org.apache.logging.log4j.core.async.AsyncLogger;
import org.apache.logging.log4j.core.impl.Log4jLogEvent;
-import org.junit.AfterClass;
+import org.junit.Before;
import org.junit.Test;
+import static org.junit.Assert.*;
+
public class ClockFactoryTest {
public static void resetClocks() throws IllegalAccessException {
@@ -40,11 +40,11 @@ public class ClockFactoryTest {
FieldUtils.writeStaticField(field, ClockFactory.getClock(), false);
}
- @AfterClass
- public static void afterClass() throws IllegalAccessException {
+ @Before
+ public void setUp() throws Exception {
resetClocks();
}
-
+
@Test
public void testDefaultIsSystemClock() {
System.clearProperty(ClockFactory.PROPERTY_NAME);