Skip to content

Commit

Permalink
Add test for JBEAP-14320
Browse files Browse the repository at this point in the history
  • Loading branch information
adamecp committed Apr 6, 2018
1 parent 6fb73c9 commit 8712151
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/test/java/org/jboss/logmanager/FilterTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 8712151

Please sign in to comment.