RegexFilter extends AbstractStringBasedFilter { @Override public boolean accept(LogData logData, int row) { if (patternOk && condition.length() > 0) { return pattern.matcher(logData.getMessage()).find(); } return condition.length() == 0 || !patternOk; } RegexFilter(); @Override boolean accept(LogData logData, int row);  }
@Test public void testMessageNull(){ assertFalse(createFilter("A", false).accept(new LogData(), 1)); }
@Test public void testMessageAcceptCaseSensitive(){ assertFalse(createFilter("ala\\*a", false).accept(new LogDataBuilder().withMessage("ala ma kota").build(), 1)); }
@Test public void testMessageAcceptCaseInsensitive(){ assertFalse(createFilter("ala\\*a", false).accept(new LogDataBuilder().withMessage("Ala ma kota").build(), 1)); }
@Test public void testMessageRejectCaseSensitive(){ assertFalse(createFilter("ala\\*a", false).accept(new LogDataBuilder().withMessage("Ala ma kota").build(), 1)); }
@Test public void testMessageRejectCaseInsensitive(){ assertFalse(createFilter("ala\\*a", false).accept(new LogDataBuilder().withMessage("Kot ma ale").build(), 1)); }