TraceFilter extends Filter<ILoggingEvent> { @Override public FilterReply decide(ILoggingEvent event) { if (traceMarkerMap.containsKey(event.getMarker())) { return FilterReply.ACCEPT; } else { return FilterReply.DENY; } }  @Override FilterReply decide(ILoggingEvent event);  }
@Test public void testDecide() { final TraceFilter filter = new TraceFilter(); assertEquals("Unexpected filter response", FilterReply.DENY, filter.decide(new MockILoggingEvent())); assertEquals("Unexpected filter response", FilterReply.ACCEPT, filter.decide(new MockILoggingEvent(null, LogMarker.ENTRY.getValue(), "message", new Object[] { null }))); assertEquals("Unexpected filter response", FilterReply.ACCEPT, filter.decide(new MockILoggingEvent(null, LogMarker.EXIT.getValue(), "message", new Object[] { null }))); assertEquals("Unexpected filter response", FilterReply.ACCEPT, filter.decide(new MockILoggingEvent(null, LogMarker.DATA.getValue(), "message", new Object[] { null }))); assertEquals("Unexpected filter response", FilterReply.ACCEPT, filter.decide(new MockILoggingEvent(null, LogMarker.THROWING.getValue(), "message", new Object[] { null }))); assertEquals("Unexpected filter response", FilterReply.DENY, filter.decide(new MockILoggingEvent(null, LogMarker.INFO.getValue(), "message", new Object[] { null }))); assertEquals("Unexpected filter response", FilterReply.DENY, filter.decide(new MockILoggingEvent(null, LogMarker.WARNING.getValue(), "message", new Object[] { null }))); assertEquals("Unexpected filter response", FilterReply.DENY, filter.decide(new MockILoggingEvent(null, LogMarker.ERROR.getValue(), "message", new Object[] { null }))); assertEquals("Unexpected filter response", FilterReply.DENY, filter.decide(new MockILoggingEvent(null, LogMarker.FFDC.getValue(), "message", new Object[] { null }))); assertEquals("Unexpected filter response", FilterReply.DENY, filter.decide(new MockILoggingEvent(null, MarkerFactory.getMarker("unknown"), "message", new Object[] { null }))); }