<commit_before>package ikube.action.index.handler.filesystem;

import ikube.AbstractTest;
import ikube.model.IndexableFileSystemLog;
import ikube.toolkit.FileUtilities;
import org.apache.lucene.document.Document;
import org.junit.Test;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.Spy;

import java.io.File;

import static org.mockito.Matchers.any;
import static org.mockito.Mockito.atLeast;
import static org.mockito.Mockito.verify;

/**
 * @author <NAME>
 * @version 01.00
 * @since 15-08-2014
 */
public class LogFileResourceHandlerTest extends AbstractTest {

    @Spy
    @InjectMocks
    private LogFileResourceHandler logFileResourceHandler;
    @Mock
    private IndexableFileSystemLog indexableFileSystemLog;

    @Test
    public void handleResource() throws Exception {
        File file = FileUtilities.findFileRecursively(new File("."), ".log");
        logFileResourceHandler.handleResource(indexContext, indexableFileSystemLog, new Document(), file);
        verify(indexWriter, atLeast(1)).addDocument(any(Document.class));
    }

}<commit_msg>Fixing tests.<commit_after>package ikube.action.index.handler.filesystem;

import ikube.AbstractTest;
import ikube.model.IndexableFileSystemLog;
import ikube.toolkit.FileUtilities;
import org.apache.lucene.document.Document;
import org.junit.Test;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.Spy;

import java.io.File;

import static org.mockito.Matchers.any;
import static org.mockito.Mockito.atLeast;
import static org.mockito.Mockito.verify;

/**
 * @author <NAME>
 * @version 01.00
 * @since 15-08-2014
 */
public class LogFileResourceHandlerTest extends AbstractTest {

    @Spy
    @InjectMocks
    private LogFileResourceHandler logFileResourceHandler;
    @Mock
    private IndexableFileSystemLog indexableFileSystemLog;

    @Test
    public void handleResource() throws Exception {
        File file = FileUtilities.findFileRecursively(new File("."), "2012-03-05-some.log");
        logFileResourceHandler.handleResource(indexContext, indexableFileSystemLog, new Document(), file);
        verify(indexWriter, atLeast(1)).addDocument(any(Document.class));
    }

}
{'fraction_non_alphanumeric': 0.10286754665452891, 'fraction_numerical': 0.015475648611743286, 'mean_word_length': 4.814814814814815, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6350935', 'n_tokens_mistral': 690, 'n_tokens_neox': 667, 'n_words': 135}