You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by gg...@apache.org on 2015/09/10 01:38:34 UTC
[1/3] logging-log4j2 git commit: Format nit.
Repository: logging-log4j2
Updated Branches:
refs/heads/master dd082fa53 -> 939b5884e
Format nit.
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/eb7be5a6
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/eb7be5a6
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/eb7be5a6
Branch: refs/heads/master
Commit: eb7be5a6b07c4180b6c005b459e7554906d878ff
Parents: dd082fa
Author: ggregory <gg...@apache.org>
Authored: Wed Sep 9 16:25:06 2015 -0700
Committer: ggregory <gg...@apache.org>
Committed: Wed Sep 9 16:25:06 2015 -0700
----------------------------------------------------------------------
.../org/apache/logging/log4j/io/LoggerPrintWriterJdbcH2Test.java | 1 +
1 file changed, 1 insertion(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/eb7be5a6/log4j-iostreams/src/test/java/org/apache/logging/log4j/io/LoggerPrintWriterJdbcH2Test.java
----------------------------------------------------------------------
diff --git a/log4j-iostreams/src/test/java/org/apache/logging/log4j/io/LoggerPrintWriterJdbcH2Test.java b/log4j-iostreams/src/test/java/org/apache/logging/log4j/io/LoggerPrintWriterJdbcH2Test.java
index a7c6d0e..712ec62 100644
--- a/log4j-iostreams/src/test/java/org/apache/logging/log4j/io/LoggerPrintWriterJdbcH2Test.java
+++ b/log4j-iostreams/src/test/java/org/apache/logging/log4j/io/LoggerPrintWriterJdbcH2Test.java
@@ -33,6 +33,7 @@ import org.junit.Ignore;
import org.junit.Test;
public class LoggerPrintWriterJdbcH2Test {
+
@ClassRule
public static LoggerContextRule context = new LoggerContextRule("log4j2-jdbc-driver-manager.xml");
[2/3] logging-log4j2 git commit: Format nit.
Posted by gg...@apache.org.
Format nit.
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/c5b441f0
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/c5b441f0
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/c5b441f0
Branch: refs/heads/master
Commit: c5b441f08d107de6cfec2d8ce659d8a2038ce955
Parents: eb7be5a
Author: ggregory <gg...@apache.org>
Authored: Wed Sep 9 16:36:47 2015 -0700
Committer: ggregory <gg...@apache.org>
Committed: Wed Sep 9 16:36:47 2015 -0700
----------------------------------------------------------------------
.../src/test/java/org/apache/logging/slf4j/SerializeTest.java | 1 -
1 file changed, 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/c5b441f0/log4j-slf4j-impl/src/test/java/org/apache/logging/slf4j/SerializeTest.java
----------------------------------------------------------------------
diff --git a/log4j-slf4j-impl/src/test/java/org/apache/logging/slf4j/SerializeTest.java b/log4j-slf4j-impl/src/test/java/org/apache/logging/slf4j/SerializeTest.java
index cf93499..746731b 100644
--- a/log4j-slf4j-impl/src/test/java/org/apache/logging/slf4j/SerializeTest.java
+++ b/log4j-slf4j-impl/src/test/java/org/apache/logging/slf4j/SerializeTest.java
@@ -32,7 +32,6 @@ import static org.junit.Assert.*;
*/
public class SerializeTest {
-
private static final String CONFIG = "log4j-test1.xml";
@ClassRule
[3/3] logging-log4j2 git commit: Replace some uses of
LoggerContextRule from @Rule to @ClassRule.
Posted by gg...@apache.org.
Replace some uses of LoggerContextRule from @Rule to @ClassRule.
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/939b5884
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/939b5884
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/939b5884
Branch: refs/heads/master
Commit: 939b5884ebd27ddab039ade750930d37afe1a496
Parents: c5b441f
Author: ggregory <gg...@apache.org>
Authored: Wed Sep 9 16:38:30 2015 -0700
Committer: ggregory <gg...@apache.org>
Committed: Wed Sep 9 16:38:30 2015 -0700
----------------------------------------------------------------------
.../org/apache/log4j/CallerInformationTest.java | 10 +++++-----
.../appender/AsyncAppenderNoLocationTest.java | 5 +++--
.../core/appender/FailoverAppenderTest.java | 5 +++--
.../appender/rewrite/RewriteAppenderTest.java | 13 ++++++++-----
.../rolling/RollingAppenderTimeAndSizeTest.java | 20 +++++++++++---------
...RandomAccessFileManagerHeaderFooterTest.java | 12 +++++++-----
.../routing/RoutingAppenderWithJndiTest.java | 11 ++++++-----
.../log4j/core/async/AsyncRootReloadTest.java | 6 +++---
.../layout/PatternLayoutMainMapLookupTest.java | 6 +++---
.../apache/logging/log4j/io/IoBuilderTest.java | 18 +++++++++---------
.../log4j/jcl/CallerInformationTest.java | 10 +++++-----
.../apache/logging/log4j/jcl/LoggerTest.java | 5 +++--
.../logging/slf4j/CallerInformationTest.java | 10 +++++-----
13 files changed, 71 insertions(+), 60 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/939b5884/log4j-1.2-api/src/test/java/org/apache/log4j/CallerInformationTest.java
----------------------------------------------------------------------
diff --git a/log4j-1.2-api/src/test/java/org/apache/log4j/CallerInformationTest.java b/log4j-1.2-api/src/test/java/org/apache/log4j/CallerInformationTest.java
index 80cea0a..a5b3090 100644
--- a/log4j-1.2-api/src/test/java/org/apache/log4j/CallerInformationTest.java
+++ b/log4j-1.2-api/src/test/java/org/apache/log4j/CallerInformationTest.java
@@ -16,22 +16,22 @@
*/
package org.apache.log4j;
+import static org.junit.Assert.assertEquals;
+
import java.util.List;
import org.apache.logging.log4j.junit.LoggerContextRule;
import org.apache.logging.log4j.test.appender.ListAppender;
-import org.junit.Rule;
+import org.junit.ClassRule;
import org.junit.Test;
-import static org.junit.Assert.assertEquals;
-
public class CallerInformationTest {
// config from log4j-core test-jar
private static final String CONFIG = "log4j2-calling-class.xml";
- @Rule
- public final LoggerContextRule ctx = new LoggerContextRule(CONFIG);
+ @ClassRule
+ public static final LoggerContextRule ctx = new LoggerContextRule(CONFIG);
@Test
public void testClassLogger() throws Exception {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/939b5884/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/AsyncAppenderNoLocationTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/AsyncAppenderNoLocationTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/AsyncAppenderNoLocationTest.java
index 32fd93d..1f6ac95 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/AsyncAppenderNoLocationTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/AsyncAppenderNoLocationTest.java
@@ -24,6 +24,7 @@ import org.apache.logging.log4j.junit.LoggerContextRule;
import org.apache.logging.log4j.test.appender.ListAppender;
import org.junit.After;
import org.junit.Before;
+import org.junit.ClassRule;
import org.junit.Rule;
import org.junit.Test;
@@ -35,8 +36,8 @@ import static org.junit.Assert.*;
public class AsyncAppenderNoLocationTest {
private ListAppender app;
- @Rule
- public LoggerContextRule init = new LoggerContextRule("log4j-asynch-no-location.xml");
+ @ClassRule
+ public static LoggerContextRule init = new LoggerContextRule("log4j-asynch-no-location.xml");
@Before
public void setUp() throws Exception {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/939b5884/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/FailoverAppenderTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/FailoverAppenderTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/FailoverAppenderTest.java
index 2cbc2df..938839c 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/FailoverAppenderTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/FailoverAppenderTest.java
@@ -25,6 +25,7 @@ import org.apache.logging.log4j.test.appender.FailOnceAppender;
import org.apache.logging.log4j.test.appender.ListAppender;
import org.junit.After;
import org.junit.Before;
+import org.junit.ClassRule;
import org.junit.Rule;
import org.junit.Test;
@@ -39,8 +40,8 @@ public class FailoverAppenderTest {
private Logger logger;
private Logger onceLogger;
- @Rule
- public LoggerContextRule init = new LoggerContextRule("log4j-failover.xml");
+ @ClassRule
+ public static LoggerContextRule init = new LoggerContextRule("log4j-failover.xml");
@Before
public void setUp() throws Exception {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/939b5884/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rewrite/RewriteAppenderTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rewrite/RewriteAppenderTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rewrite/RewriteAppenderTest.java
index 518ca87..dc41148 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rewrite/RewriteAppenderTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rewrite/RewriteAppenderTest.java
@@ -16,6 +16,11 @@
*/
package org.apache.logging.log4j.core.appender.rewrite;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
import java.util.List;
import java.util.Map;
@@ -30,11 +35,9 @@ import org.apache.logging.log4j.message.StructuredDataMessage;
import org.apache.logging.log4j.test.appender.ListAppender;
import org.junit.After;
import org.junit.Before;
-import org.junit.Rule;
+import org.junit.ClassRule;
import org.junit.Test;
-import static org.junit.Assert.*;
-
/**
*
*/
@@ -42,8 +45,8 @@ public class RewriteAppenderTest {
private ListAppender app;
private ListAppender app2;
- @Rule
- public LoggerContextRule init = new LoggerContextRule("log4j-rewrite.xml");
+ @ClassRule
+ public static LoggerContextRule init = new LoggerContextRule("log4j-rewrite.xml");
@Before
public void setUp() throws Exception {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/939b5884/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingAppenderTimeAndSizeTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingAppenderTimeAndSizeTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingAppenderTimeAndSizeTest.java
index efa11d5..1b1ff67 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingAppenderTimeAndSizeTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingAppenderTimeAndSizeTest.java
@@ -16,21 +16,23 @@
*/
package org.apache.logging.log4j.core.appender.rolling;
+import static org.apache.logging.log4j.hamcrest.Descriptors.that;
+import static org.apache.logging.log4j.hamcrest.FileMatchers.hasName;
+import static org.hamcrest.Matchers.endsWith;
+import static org.hamcrest.Matchers.hasItemInArray;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.assertTrue;
+
import java.io.File;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.junit.LoggerContextRule;
import org.junit.After;
import org.junit.Before;
-import org.junit.Rule;
+import org.junit.ClassRule;
import org.junit.Test;
-import static org.apache.logging.log4j.hamcrest.FileMatchers.hasName;
-import static org.apache.logging.log4j.hamcrest.Descriptors.that;
-import static org.hamcrest.Matchers.endsWith;
-import static org.hamcrest.Matchers.hasItemInArray;
-import static org.junit.Assert.*;
-
/**
*
*/
@@ -38,8 +40,8 @@ public class RollingAppenderTimeAndSizeTest {
private static final String DIR = "target/rolling3/test";
- @Rule
- public LoggerContextRule init = new LoggerContextRule("log4j-rolling3.xml");
+ @ClassRule
+ public static LoggerContextRule init = new LoggerContextRule("log4j-rolling3.xml");
private Logger logger;
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/939b5884/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingRandomAccessFileManagerHeaderFooterTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingRandomAccessFileManagerHeaderFooterTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingRandomAccessFileManagerHeaderFooterTest.java
index f789e4a..eab2731 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingRandomAccessFileManagerHeaderFooterTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingRandomAccessFileManagerHeaderFooterTest.java
@@ -16,6 +16,10 @@
*/
package org.apache.logging.log4j.core.appender.rolling;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
import java.io.File;
import java.io.FileInputStream;
import java.nio.charset.Charset;
@@ -26,11 +30,9 @@ import org.apache.logging.log4j.core.util.Closer;
import org.apache.logging.log4j.junit.LoggerContextRule;
import org.junit.After;
import org.junit.Before;
-import org.junit.Rule;
+import org.junit.ClassRule;
import org.junit.Test;
-import static org.junit.Assert.*;
-
/**
*
*/
@@ -39,8 +41,8 @@ public class RollingRandomAccessFileManagerHeaderFooterTest {
private static final String DIR = "target/RollingRandomAccessFileAppenderHeaderFooterTest/";
private static final String LOGFILE = "target/RollingRandomAccessFileAppenderHeaderFooterTest.log";
- @Rule
- public LoggerContextRule init = new LoggerContextRule("RollingRandomAccessFileAppenderHeaderFooterTest.xml");
+ @ClassRule
+ public static LoggerContextRule init = new LoggerContextRule("RollingRandomAccessFileAppenderHeaderFooterTest.xml");
private Logger logger;
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/939b5884/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/routing/RoutingAppenderWithJndiTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/routing/RoutingAppenderWithJndiTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/routing/RoutingAppenderWithJndiTest.java
index 240041b..8716e34 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/routing/RoutingAppenderWithJndiTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/routing/RoutingAppenderWithJndiTest.java
@@ -16,6 +16,9 @@
*/
package org.apache.logging.log4j.core.appender.routing;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
import java.io.File;
import javax.naming.Context;
@@ -28,12 +31,10 @@ import org.apache.logging.log4j.message.StructuredDataMessage;
import org.apache.logging.log4j.test.appender.ListAppender;
import org.junit.After;
import org.junit.Before;
-import org.junit.Rule;
+import org.junit.ClassRule;
import org.junit.Test;
import org.mockejb.jndi.MockContextFactory;
-import static org.junit.Assert.*;
-
/**
* RoutingAppenderWithJndiTest
*/
@@ -43,8 +44,8 @@ public class RoutingAppenderWithJndiTest {
private ListAppender listAppender1;
private ListAppender listAppender2;
- @Rule
- public LoggerContextRule init = new LoggerContextRule("log4j-routing-by-jndi.xml");
+ @ClassRule
+ public static LoggerContextRule init = new LoggerContextRule("log4j-routing-by-jndi.xml");
@Before
public void before() throws NamingException {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/939b5884/log4j-core/src/test/java/org/apache/logging/log4j/core/async/AsyncRootReloadTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/async/AsyncRootReloadTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/async/AsyncRootReloadTest.java
index 54e517a..247ee70 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/async/AsyncRootReloadTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/async/AsyncRootReloadTest.java
@@ -25,7 +25,7 @@ import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.core.util.FileUtils;
import org.apache.logging.log4j.junit.CleanFiles;
import org.apache.logging.log4j.junit.LoggerContextRule;
-import org.junit.Rule;
+import org.junit.ClassRule;
import org.junit.Test;
import org.junit.rules.RuleChain;
@@ -39,8 +39,8 @@ public class AsyncRootReloadTest {
private static final String LOG = "target/" + ISSUE + ".log";
private static final String RESOURCE = "classpath:" + ISSUE_CONFIG;
- @Rule
- public RuleChain rules = RuleChain.outerRule(new CleanFiles(LOG)).around(new LoggerContextRule(RESOURCE));
+ @ClassRule
+ public static RuleChain rules = RuleChain.outerRule(new CleanFiles(LOG)).around(new LoggerContextRule(RESOURCE));
@Test
public void testLog4j2_807() throws InterruptedException, URISyntaxException {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/939b5884/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/PatternLayoutMainMapLookupTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/PatternLayoutMainMapLookupTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/PatternLayoutMainMapLookupTest.java
index 3a87cf1..b476097 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/PatternLayoutMainMapLookupTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/PatternLayoutMainMapLookupTest.java
@@ -25,7 +25,7 @@ import org.apache.logging.log4j.core.lookup.MainMapLookup;
import org.apache.logging.log4j.junit.LoggerContextRule;
import org.apache.logging.log4j.test.appender.ListAppender;
import org.junit.Assert;
-import org.junit.Rule;
+import org.junit.ClassRule;
import org.junit.Test;
/**
@@ -38,8 +38,8 @@ public class PatternLayoutMainMapLookupTest {
MainMapLookup.setMainArguments("value0", "value1", "value2");
}
- @Rule
- public LoggerContextRule context = new LoggerContextRule("log4j2-962.xml");
+ @ClassRule
+ public static LoggerContextRule context = new LoggerContextRule("log4j2-962.xml");
@Test
public void testFileName() {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/939b5884/log4j-iostreams/src/test/java/org/apache/logging/log4j/io/IoBuilderTest.java
----------------------------------------------------------------------
diff --git a/log4j-iostreams/src/test/java/org/apache/logging/log4j/io/IoBuilderTest.java b/log4j-iostreams/src/test/java/org/apache/logging/log4j/io/IoBuilderTest.java
index 9205355..d8b72fd 100644
--- a/log4j-iostreams/src/test/java/org/apache/logging/log4j/io/IoBuilderTest.java
+++ b/log4j-iostreams/src/test/java/org/apache/logging/log4j/io/IoBuilderTest.java
@@ -16,24 +16,24 @@
*/
package org.apache.logging.log4j.io;
+import static org.hamcrest.Matchers.empty;
+import static org.hamcrest.Matchers.hasSize;
+import static org.hamcrest.Matchers.not;
+import static org.hamcrest.Matchers.startsWith;
+import static org.junit.Assert.assertThat;
+
import java.io.PrintStream;
import java.util.List;
import org.apache.logging.log4j.junit.LoggerContextRule;
import org.apache.logging.log4j.test.appender.ListAppender;
-import org.junit.Rule;
+import org.junit.ClassRule;
import org.junit.Test;
-import static org.hamcrest.Matchers.empty;
-import static org.hamcrest.Matchers.hasSize;
-import static org.hamcrest.Matchers.not;
-import static org.hamcrest.Matchers.startsWith;
-import static org.junit.Assert.*;
-
public class IoBuilderTest {
- @Rule
- public LoggerContextRule context = new LoggerContextRule("log4j2-streams-calling-info.xml");
+ @ClassRule
+ public static LoggerContextRule context = new LoggerContextRule("log4j2-streams-calling-info.xml");
@Test
public void testNoArgBuilderCallerClassInfo() throws Exception {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/939b5884/log4j-jcl/src/test/java/org/apache/logging/log4j/jcl/CallerInformationTest.java
----------------------------------------------------------------------
diff --git a/log4j-jcl/src/test/java/org/apache/logging/log4j/jcl/CallerInformationTest.java b/log4j-jcl/src/test/java/org/apache/logging/log4j/jcl/CallerInformationTest.java
index 27697b7..31fe14d 100644
--- a/log4j-jcl/src/test/java/org/apache/logging/log4j/jcl/CallerInformationTest.java
+++ b/log4j-jcl/src/test/java/org/apache/logging/log4j/jcl/CallerInformationTest.java
@@ -16,24 +16,24 @@
*/
package org.apache.logging.log4j.jcl;
+import static org.junit.Assert.assertEquals;
+
import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.logging.log4j.junit.LoggerContextRule;
import org.apache.logging.log4j.test.appender.ListAppender;
-import org.junit.Rule;
+import org.junit.ClassRule;
import org.junit.Test;
-import static org.junit.Assert.assertEquals;
-
public class CallerInformationTest {
// config from log4j-core test-jar
private static final String CONFIG = "log4j2-calling-class.xml";
- @Rule
- public final LoggerContextRule ctx = new LoggerContextRule(CONFIG);
+ @ClassRule
+ public static final LoggerContextRule ctx = new LoggerContextRule(CONFIG);
@Test
public void testClassLogger() throws Exception {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/939b5884/log4j-jcl/src/test/java/org/apache/logging/log4j/jcl/LoggerTest.java
----------------------------------------------------------------------
diff --git a/log4j-jcl/src/test/java/org/apache/logging/log4j/jcl/LoggerTest.java b/log4j-jcl/src/test/java/org/apache/logging/log4j/jcl/LoggerTest.java
index 3e73b50..4aa94ed 100644
--- a/log4j-jcl/src/test/java/org/apache/logging/log4j/jcl/LoggerTest.java
+++ b/log4j-jcl/src/test/java/org/apache/logging/log4j/jcl/LoggerTest.java
@@ -23,6 +23,7 @@ import org.apache.commons.logging.LogFactory;
import org.apache.logging.log4j.core.util.Constants;
import org.apache.logging.log4j.junit.LoggerContextRule;
import org.apache.logging.log4j.test.appender.ListAppender;
+import org.junit.ClassRule;
import org.junit.Rule;
import org.junit.Test;
@@ -37,8 +38,8 @@ public class LoggerTest {
private static final String CONFIG = "log4j-test1.xml";
- @Rule
- public final LoggerContextRule context = new LoggerContextRule(CONFIG);
+ @ClassRule
+ public static final LoggerContextRule context = new LoggerContextRule(CONFIG);
@Test
public void testLog() {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/939b5884/log4j-slf4j-impl/src/test/java/org/apache/logging/slf4j/CallerInformationTest.java
----------------------------------------------------------------------
diff --git a/log4j-slf4j-impl/src/test/java/org/apache/logging/slf4j/CallerInformationTest.java b/log4j-slf4j-impl/src/test/java/org/apache/logging/slf4j/CallerInformationTest.java
index a3e59f0..c982440 100644
--- a/log4j-slf4j-impl/src/test/java/org/apache/logging/slf4j/CallerInformationTest.java
+++ b/log4j-slf4j-impl/src/test/java/org/apache/logging/slf4j/CallerInformationTest.java
@@ -16,24 +16,24 @@
*/
package org.apache.logging.slf4j;
+import static org.junit.Assert.assertEquals;
+
import java.util.List;
import org.apache.logging.log4j.junit.LoggerContextRule;
import org.apache.logging.log4j.test.appender.ListAppender;
-import org.junit.Rule;
+import org.junit.ClassRule;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import static org.junit.Assert.assertEquals;
-
public class CallerInformationTest {
// config from log4j-core test-jar
private static final String CONFIG = "log4j2-calling-class.xml";
- @Rule
- public final LoggerContextRule ctx = new LoggerContextRule(CONFIG);
+ @ClassRule
+ public static final LoggerContextRule ctx = new LoggerContextRule(CONFIG);
@Test
public void testClassLogger() throws Exception {