Skip to content
Snippets Groups Projects
Commit dbd3fb68 authored by felmer's avatar felmer
Browse files

making tests more robust by suppressing log lines with 'FullTextIndex' in the logger name.

SVN: 32861
parent 5aa4f085
No related branches found
No related tags found
No related merge requests found
......@@ -94,6 +94,21 @@ public final class BufferedAppender extends WriterAppender
configureRootLogger();
setThreshold(logLevel);
}
public void addRegexForLoggingEventsToBeDropped(String loggerNameRegex)
{
final Pattern pattern = Pattern.compile(loggerNameRegex);
this.addFilter(new Filter()
{
@Override
public int decide(LoggingEvent event)
{
String loggerName = event.getLoggerName();
return pattern.matcher(loggerName).matches() ? Filter.DENY : Filter.ACCEPT;
}
});
}
private final void configureRootLogger()
{
......
......@@ -231,6 +231,7 @@ public class UploadingCommandTest extends AssertJUnit
public void setup()
{
logRecorder = new BufferedAppender("%-5p %c - %m%n", Level.INFO);
logRecorder.addRegexForLoggingEventsToBeDropped("OPERATION.*FullTextIndex.*");
context = new Mockery();
factory = context.mock(ICIFEXRPCServiceFactory.class);
cifex = context.mock(ICIFEXComponent.class);
......
......@@ -422,6 +422,7 @@ public class MultiDataSetArchiverTest extends AbstractFileSystemTestCase
public void setUpTestEnvironment()
{
logRecorder = new BufferedAppender("%-5p %c - %m%n", Level.INFO, "OPERATION.*");
logRecorder.addRegexForLoggingEventsToBeDropped("OPERATION.*FullTextIndex.*");
transaction = new MockMultiDataSetArchiverDBTransaction();
store = new File(workingDirectory, "store");
share = new File(store, "1");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment