Search in sources :

Example 6 with CompositeFilter

use of org.apache.qpid.server.logging.logback.CompositeFilter in project qpid-broker-j by apache.

the class CompositeFilterTest method testDecideWithNeutralRule.

public void testDecideWithNeutralRule() {
    CompositeFilter compositeFilter = new CompositeFilter();
    compositeFilter.addLogInclusionRule(createRule(FilterReply.NEUTRAL));
    final ILoggingEvent loggingEvent = mock(ILoggingEvent.class);
    when(loggingEvent.getLevel()).thenReturn(Level.ERROR);
    FilterReply reply = compositeFilter.decide(loggingEvent);
    assertEquals("Unexpected reply with NEUTRAL rule added", FilterReply.DENY, reply);
}
Also used : CompositeFilter(org.apache.qpid.server.logging.logback.CompositeFilter) FilterReply(ch.qos.logback.core.spi.FilterReply) ILoggingEvent(ch.qos.logback.classic.spi.ILoggingEvent)

Aggregations

CompositeFilter (org.apache.qpid.server.logging.logback.CompositeFilter)6 ILoggingEvent (ch.qos.logback.classic.spi.ILoggingEvent)5 FilterReply (ch.qos.logback.core.spi.FilterReply)5