diff --git a/src/test/java/org/jboss/logmanager/FilterTests.java b/src/test/java/org/jboss/logmanager/FilterTests.java index b51a1f97..37b388bb 100644 --- a/src/test/java/org/jboss/logmanager/FilterTests.java +++ b/src/test/java/org/jboss/logmanager/FilterTests.java @@ -436,6 +436,14 @@ public void testRegexFilter3() { assertFalse("Handler was run", ran.get()); } + @Test + public void regexFilterExceptionNullMessageTest(){ + LogRecord logRecord = new LogRecord(Level.ALL, null); + Filter filter = new RegexFilter("test"); + boolean isLoggable = filter.isLoggable(logRecord); + assertFalse(isLoggable); + } + @Test public void testSubstitueFilter0() { final Filter filter = new SubstituteFilter(Pattern.compile("test"), "lunch", true); @@ -490,6 +498,13 @@ public void testSubstituteFilter3() { assertEquals("Substitution was not correctly applied", "This is a lunches lunches", record.getFormattedMessage()); } + @Test + public void substituteFilterExceptionNullMessageTest(){ + LogRecord logRecord = new LogRecord(Level.ALL, null); + Filter filter = new SubstituteFilter(Pattern.compile("test"), "lunch", true); + filter.isLoggable(logRecord); + } + private static final class MessageCheckingHandler extends Handler {