You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by rp...@apache.org on 2016/03/17 23:43:35 UTC
[5/9] logging-log4j2 git commit: LOG4J2-1278 added explicit casts to
filter tests to disambiguate the target method
LOG4J2-1278 added explicit casts to filter tests to disambiguate the target method
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/7a5f0e61
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/7a5f0e61
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/7a5f0e61
Branch: refs/heads/LOG4J2-1278-gc-free-logger
Commit: 7a5f0e61aebd1ffaf93f1ccd5d1209d055b038ee
Parents: 3b7299a
Author: rpopma <rp...@apache.org>
Authored: Fri Mar 18 00:26:02 2016 +1100
Committer: rpopma <rp...@apache.org>
Committed: Fri Mar 18 00:26:02 2016 +1100
----------------------------------------------------------------------
.../core/filter/DynamicThresholdFilterTest.java | 4 ++--
.../log4j/core/filter/LevelRangeFilterTest.java | 4 ++--
.../logging/log4j/core/filter/MarkerFilterTest.java | 6 +++---
.../logging/log4j/core/filter/RegexFilterTest.java | 11 ++++++-----
.../core/filter/ThreadContextMapFilterTest.java | 16 ++++++++--------
.../log4j/core/filter/ThresholdFilterTest.java | 4 ++--
.../logging/log4j/core/filter/TimeFilterTest.java | 2 +-
7 files changed, 24 insertions(+), 23 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/7a5f0e61/log4j-core/src/test/java/org/apache/logging/log4j/core/filter/DynamicThresholdFilterTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/filter/DynamicThresholdFilterTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/filter/DynamicThresholdFilterTest.java
index 61a9a46..52d866b 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/filter/DynamicThresholdFilterTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/filter/DynamicThresholdFilterTest.java
@@ -60,8 +60,8 @@ public class DynamicThresholdFilterTest {
null);
filter.start();
assertTrue(filter.isStarted());
- assertSame(Filter.Result.NEUTRAL, filter.filter(null, Level.DEBUG, null, null, (Throwable) null));
- assertSame(Filter.Result.NEUTRAL, filter.filter(null, Level.ERROR, null, null, (Throwable) null));
+ assertSame(Filter.Result.NEUTRAL, filter.filter(null, Level.DEBUG, null, (Object) null, (Throwable) null));
+ assertSame(Filter.Result.NEUTRAL, filter.filter(null, Level.ERROR, null, (Object) null, (Throwable) null));
ThreadContext.clearMap();
ThreadContext.put("userid", "JohnDoe");
ThreadContext.put("organization", "apache");
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/7a5f0e61/log4j-core/src/test/java/org/apache/logging/log4j/core/filter/LevelRangeFilterTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/filter/LevelRangeFilterTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/filter/LevelRangeFilterTest.java
index bcbe577..4deb468 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/filter/LevelRangeFilterTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/filter/LevelRangeFilterTest.java
@@ -35,8 +35,8 @@ public class LevelRangeFilterTest {
final LevelRangeFilter filter = LevelRangeFilter.createFilter(Level.ERROR, Level.INFO, null, null);
filter.start();
assertTrue(filter.isStarted());
- assertSame(Filter.Result.DENY, filter.filter(null, Level.DEBUG, null, null, (Throwable) null));
- assertSame(Filter.Result.NEUTRAL, filter.filter(null, Level.ERROR, null, null, (Throwable) null));
+ assertSame(Filter.Result.DENY, filter.filter(null, Level.DEBUG, null, (Object) null, (Throwable) null));
+ assertSame(Filter.Result.NEUTRAL, filter.filter(null, Level.ERROR, null, (Object) null, (Throwable) null));
LogEvent event = Log4jLogEvent.newBuilder() //
.setLevel(Level.DEBUG) //
.setMessage(new SimpleMessage("Test")) //
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/7a5f0e61/log4j-core/src/test/java/org/apache/logging/log4j/core/filter/MarkerFilterTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/filter/MarkerFilterTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/filter/MarkerFilterTest.java
index a7b77b1..1850e77 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/filter/MarkerFilterTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/filter/MarkerFilterTest.java
@@ -42,9 +42,9 @@ public class MarkerFilterTest {
MarkerFilter filter = MarkerFilter.createFilter("Parent", null, null);
filter.start();
assertTrue(filter.isStarted());
- assertSame(Filter.Result.DENY, filter.filter(null, null, stranger, null, (Throwable) null));
- assertSame(Filter.Result.NEUTRAL, filter.filter(null, null, child, null, (Throwable) null));
- assertSame(Filter.Result.NEUTRAL, filter.filter(null, null, grandChild, null, (Throwable) null));
+ assertSame(Filter.Result.DENY, filter.filter(null, null, stranger, (Object) null, (Throwable) null));
+ assertSame(Filter.Result.NEUTRAL, filter.filter(null, null, child, (Object) null, (Throwable) null));
+ assertSame(Filter.Result.NEUTRAL, filter.filter(null, null, grandChild, (Object) null, (Throwable) null));
filter.stop();
LogEvent event = Log4jLogEvent.newBuilder() //
.setMarker(grandChild) //
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/7a5f0e61/log4j-core/src/test/java/org/apache/logging/log4j/core/filter/RegexFilterTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/filter/RegexFilterTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/filter/RegexFilterTest.java
index 01d3a32..c48edbe 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/filter/RegexFilterTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/filter/RegexFilterTest.java
@@ -48,8 +48,9 @@ public class RegexFilterTest {
filter.start();
assertTrue(filter.isStarted());
assertSame(Filter.Result.NEUTRAL,
- filter.filter(null, Level.DEBUG, null, "This is a test message", (Throwable) null));
- assertSame(Filter.Result.DENY, filter.filter(null, Level.ERROR, null, "This is not a test", (Throwable) null));
+ filter.filter(null, Level.DEBUG, null, (Object) "This is a test message", (Throwable) null));
+ assertSame(Filter.Result.DENY, filter.filter(null, Level.ERROR, null, (Object) "This is not a test",
+ (Throwable) null));
LogEvent event = Log4jLogEvent.newBuilder() //
.setLevel(Level.DEBUG) //
.setMessage(new SimpleMessage("Another test message")) //
@@ -70,8 +71,8 @@ public class RegexFilterTest {
final String multiLine = "test multi line matches\nsome more lines";
final RegexFilter filter = RegexFilter.createFilter(".*line.*", new String[] { "DOTALL", "COMMENTS" }, false,
Filter.Result.DENY, Filter.Result.ACCEPT);
- final Result singleLineResult = filter.filter(null, null, null, singleLine, (Throwable) null);
- final Result multiLineResult = filter.filter(null, null, null, multiLine, (Throwable) null);
+ final Result singleLineResult = filter.filter(null, null, null, (Object) singleLine, (Throwable) null);
+ final Result multiLineResult = filter.filter(null, null, null, (Object) multiLine, (Throwable) null);
assertThat(singleLineResult, equalTo(Result.DENY));
assertThat(multiLineResult, equalTo(Result.DENY));
}
@@ -81,7 +82,7 @@ public class RegexFilterTest {
final RegexFilter filter = RegexFilter.createFilter(".* test .*", null, false, null, null);
filter.start();
assertTrue(filter.isStarted());
- assertSame(Filter.Result.DENY, filter.filter(null, Level.DEBUG, null, (String) null, (Throwable) null));
+ assertSame(Filter.Result.DENY, filter.filter(null, Level.DEBUG, null, (Object) null, (Throwable) null));
assertSame(Filter.Result.DENY, filter.filter(null, Level.DEBUG, null, (Message) null, (Throwable) null));
assertSame(Filter.Result.DENY, filter.filter(null, Level.DEBUG, null, null, (Object[]) null));
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/7a5f0e61/log4j-core/src/test/java/org/apache/logging/log4j/core/filter/ThreadContextMapFilterTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/filter/ThreadContextMapFilterTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/filter/ThreadContextMapFilterTest.java
index 156ed33..546ef30 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/filter/ThreadContextMapFilterTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/filter/ThreadContextMapFilterTest.java
@@ -39,29 +39,29 @@ public class ThreadContextMapFilterTest {
ThreadContextMapFilter filter = ThreadContextMapFilter.createFilter(pairs, "and", null, null);
filter.start();
assertTrue(filter.isStarted());
- assertSame(Filter.Result.DENY, filter.filter(null, Level.DEBUG, null, null, (Throwable) null));
+ assertSame(Filter.Result.DENY, filter.filter(null, Level.DEBUG, null, (Object) null, (Throwable) null));
ThreadContext.remove("userid");
- assertSame(Filter.Result.DENY, filter.filter(null, Level.DEBUG, null, null, (Throwable) null));
+ assertSame(Filter.Result.DENY, filter.filter(null, Level.DEBUG, null, (Object) null, (Throwable) null));
ThreadContext.put("userid", "JohnDoe");
- assertSame(Filter.Result.NEUTRAL, filter.filter(null, Level.ERROR, null, null, (Throwable) null));
+ assertSame(Filter.Result.NEUTRAL, filter.filter(null, Level.ERROR, null, (Object) null, (Throwable) null));
ThreadContext.put("organization", "ASF");
- assertSame(Filter.Result.DENY, filter.filter(null, Level.DEBUG, null, null, (Throwable) null));
+ assertSame(Filter.Result.DENY, filter.filter(null, Level.DEBUG, null, (Object) null, (Throwable) null));
ThreadContext.clearMap();
filter = ThreadContextMapFilter.createFilter(pairs, "or", null, null);
filter.start();
assertTrue(filter.isStarted());
ThreadContext.put("userid", "testuser");
ThreadContext.put("organization", "Apache");
- assertSame(Filter.Result.NEUTRAL, filter.filter(null, Level.DEBUG, null, null, (Throwable) null));
+ assertSame(Filter.Result.NEUTRAL, filter.filter(null, Level.DEBUG, null, (Object) null, (Throwable) null));
ThreadContext.put("organization", "ASF");
- assertSame(Filter.Result.DENY, filter.filter(null, Level.DEBUG, null, null, (Throwable) null));
+ assertSame(Filter.Result.DENY, filter.filter(null, Level.DEBUG, null, (Object) null, (Throwable) null));
ThreadContext.remove("organization");
- assertSame(Filter.Result.DENY, filter.filter(null, Level.DEBUG, null, null, (Throwable) null));
+ assertSame(Filter.Result.DENY, filter.filter(null, Level.DEBUG, null, (Object) null, (Throwable) null));
final KeyValuePair[] single = new KeyValuePair[] {new KeyValuePair("userid", "testuser")};
filter = ThreadContextMapFilter.createFilter(single, null, null, null);
filter.start();
assertTrue(filter.isStarted());
- assertSame(Filter.Result.NEUTRAL, filter.filter(null, Level.DEBUG, null, null, (Throwable) null));
+ assertSame(Filter.Result.NEUTRAL, filter.filter(null, Level.DEBUG, null, (Object) null, (Throwable) null));
ThreadContext.clearMap();
}
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/7a5f0e61/log4j-core/src/test/java/org/apache/logging/log4j/core/filter/ThresholdFilterTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/filter/ThresholdFilterTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/filter/ThresholdFilterTest.java
index 9a71208..5ae7d52 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/filter/ThresholdFilterTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/filter/ThresholdFilterTest.java
@@ -35,8 +35,8 @@ public class ThresholdFilterTest {
final ThresholdFilter filter = ThresholdFilter.createFilter(Level.ERROR, null, null);
filter.start();
assertTrue(filter.isStarted());
- assertSame(Filter.Result.DENY, filter.filter(null, Level.DEBUG, null, null, (Throwable) null));
- assertSame(Filter.Result.NEUTRAL, filter.filter(null, Level.ERROR, null, null, (Throwable) null));
+ assertSame(Filter.Result.DENY, filter.filter(null, Level.DEBUG, null, (Object) null, (Throwable) null));
+ assertSame(Filter.Result.NEUTRAL, filter.filter(null, Level.ERROR, null, (Object) null, (Throwable) null));
LogEvent event = Log4jLogEvent.newBuilder() //
.setLevel(Level.DEBUG) //
.setMessage(new SimpleMessage("Test")) //
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/7a5f0e61/log4j-core/src/test/java/org/apache/logging/log4j/core/filter/TimeFilterTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/filter/TimeFilterTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/filter/TimeFilterTest.java
index d2e5be8..e39d7db 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/filter/TimeFilterTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/filter/TimeFilterTest.java
@@ -41,7 +41,7 @@ public class TimeFilterTest {
cal.set(Calendar.HOUR_OF_DAY, 2);
long tod = cal.getTimeInMillis();
LogEvent event = Log4jLogEvent.newBuilder().setTimeMillis(tod).build();
- assertSame(Filter.Result.NEUTRAL, filter.filter(null, Level.ERROR, null, null, (Throwable) null));
+ assertSame(Filter.Result.NEUTRAL, filter.filter(null, Level.ERROR, null, (Object) null, (Throwable) null));
assertSame(Filter.Result.NEUTRAL, filter.filter(event));
cal.roll(Calendar.DAY_OF_MONTH, true);
tod = cal.getTimeInMillis();