use of org.opendaylight.infrautils.testutils.LogCaptureRule in project infrautils by opendaylight.
the class LogCaptureRuleInternalTest method testLogCaptureRuleExpectErrorNegative.
@Test(expected = LogCaptureRuleException.class)
@SuppressWarnings("checkstyle:IllegalThrows")
public void testLogCaptureRuleExpectErrorNegative() throws Throwable {
LogCaptureRule logCaptureRule = new LogCaptureRule();
logCaptureRule.expectError("...");
logCaptureRule.apply(new Statement() {
@Override
public void evaluate() throws Throwable {
// do not LOG.error("boum")
}
}, Description.EMPTY).evaluate();
}
use of org.opendaylight.infrautils.testutils.LogCaptureRule in project infrautils by opendaylight.
the class LogCaptureRuleInternalTest method testLogCaptureRuleExpectErrorPositive.
@Test
@SuppressWarnings("checkstyle:IllegalThrows")
public void testLogCaptureRuleExpectErrorPositive() throws Throwable {
LogCaptureRule logCaptureRule = new LogCaptureRule();
logCaptureRule.expectError("boum");
logCaptureRule.apply(new Statement() {
@Override
public void evaluate() throws Throwable {
LOG.error("boum");
}
}, Description.EMPTY).evaluate();
}
Aggregations