Class LogCaptureFeature

java.lang.Object
org.nuxeo.runtime.test.runner.LogCaptureFeature
All Implemented Interfaces:
RunnerFeature

public class LogCaptureFeature extends Object implements RunnerFeature
Test feature to capture from a log4j appender to check that some log4j calls have been correctly called.

On a test class or a test method using this feature, a default filter can be configured with the annotation LogCaptureFeature.FilterOn or a custom one implementing LogCaptureFeature.Filter class can be provided with the annotation LogCaptureFeature.FilterWith to select the log events to capture.

A LogCaptureFeature.Result instance is to be injected with Inject as an attribute of the test.

The method LogCaptureFeature.Result.assertHasEvent() can then be called from test methods to check that matching log calls (events) have been captured.

Since:
5.7