use of ch.qos.logback.core.spi.FilterReply in project qpid-broker-j by apache.
the class Logback1027WorkaroundTurboFilterTest method testInitCauseRecursion.
public void testInitCauseRecursion() throws Exception {
Exception e1 = new Exception();
Exception e2 = new Exception();
e2.initCause(e1);
e1.initCause(e2);
final FilterReply reply = doDecide(e1);
assertEquals(FilterReply.DENY, reply);
assertEquals(1, _snoopingAppender.getEvents().size());
}
use of ch.qos.logback.core.spi.FilterReply in project qpid-broker-j by apache.
the class Logback1027WorkaroundTurboFilterTest method testNoRecursion.
public void testNoRecursion() {
Exception e1 = new Exception();
Exception e2 = new Exception();
Exception e3 = new Exception();
e2.addSuppressed(e3);
e1.addSuppressed(e2);
e1.initCause(e3);
final FilterReply reply = doDecide(e1);
assertEquals(FilterReply.NEUTRAL, reply);
assertEquals(0, _snoopingAppender.getEvents().size());
}
use of ch.qos.logback.core.spi.FilterReply in project qpid-broker-j by apache.
the class VirtualHostLogEventExcludingFilterTest method testDecideOnNoVirtualHostPrincipalInSubjectAndVirtualHostLogEventNotExcluded.
public void testDecideOnNoVirtualHostPrincipalInSubjectAndVirtualHostLogEventNotExcluded() throws Exception {
Subject subject = new Subject();
subject.getPrincipals().add(mock(Principal.class));
FilterReply reply = doTestDecide(subject);
assertEquals("Unexpected reply for BrokerLogger#virtualHostLogEventExcluded=false and no VH principal in subject", FilterReply.NEUTRAL, reply);
}
use of ch.qos.logback.core.spi.FilterReply in project qpid-broker-j by apache.
the class VirtualHostLogEventExcludingFilterTest method testDecideOnVirtualHostLogEventNotExcludedAndNullSubject.
public void testDecideOnVirtualHostLogEventNotExcludedAndNullSubject() throws Exception {
FilterReply reply = _filter.decide(_loggingEvent);
assertEquals(" BrokerLogger#virtualHostLogEventExcluded=false and subject=null", FilterReply.NEUTRAL, reply);
assertNull("Subject should not be set in test environment", Subject.getSubject(AccessController.getContext()));
}
use of ch.qos.logback.core.spi.FilterReply in project qpid-broker-j by apache.
the class CompositeFilterTest method testDecideWithNoRule.
public void testDecideWithNoRule() {
CompositeFilter compositeFilter = new CompositeFilter();
FilterReply reply = compositeFilter.decide(mock(ILoggingEvent.class));
assertEquals("Unexpected reply with no rule added", FilterReply.DENY, reply);
}
Aggregations