Test: fix this test to work in IntelliJ
This commit is contained in:
parent
b28fc1afa5
commit
b0b96af746
|
@ -24,6 +24,7 @@ import com.google.common.base.Predicate;
|
|||
import org.apache.log4j.AppenderSkeleton;
|
||||
import org.apache.log4j.Level;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.log4j.LogManager;
|
||||
import org.apache.log4j.spi.LoggingEvent;
|
||||
import org.apache.lucene.analysis.Analyzer;
|
||||
import org.apache.lucene.document.Field;
|
||||
|
@ -1317,7 +1318,14 @@ public class InternalEngineTests extends ElasticsearchLuceneTestCase {
|
|||
public void testIndexWriterIFDInfoStream() {
|
||||
MockAppender mockAppender = new MockAppender();
|
||||
|
||||
Logger iwIFDLogger = Logger.getLogger("index.engine.internal.lucene.iw.ifd");
|
||||
// Works when running this test inside Intellij:
|
||||
Logger iwIFDLogger = LogManager.exists("org.elasticsearch.index.engine.internal.lucene.iw.ifd");
|
||||
if (iwIFDLogger == null) {
|
||||
// Works when running this test from command line:
|
||||
iwIFDLogger = LogManager.exists("index.engine.internal.lucene.iw.ifd");
|
||||
assertNotNull(iwIFDLogger);
|
||||
}
|
||||
|
||||
Level savedLevel = iwIFDLogger.getLevel();
|
||||
iwIFDLogger.addAppender(mockAppender);
|
||||
iwIFDLogger.setLevel(Level.DEBUG);
|
||||
|
|
Loading…
Reference in New Issue