<commit_before>package com.ltsllc.miranda.file;

import com.ltsllc.miranda.event.EventsFile;
import com.ltsllc.miranda.miranda.Miranda;
import com.ltsllc.miranda.property.MirandaProperties;
import com.ltsllc.miranda.test.TestCase;
import com.ltsllc.miranda.writer.Writer;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;

import java.io.File;

import static org.mockito.Mockito.atLeastOnce;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;

/**
 * Created by Clark on 2/26/2017.
 */
public class TestMirandaFileReadyState extends TestCase {
    private static final String ROOT = "testdir";

    private static final String[][] FILE_SYSTEM_SPEC = {
            {"whatever", "random file"},
            {"new", "directory"},
            {"new/20170220-001.msg", "event file"},
            {"old", "directory"},
            {"old/whatever", "random file"},
    };

    private static final String FILENAME = "testdir/new/20170220-001.msg";

    @Mock
    private EventsFile mockEventsFile;

    private MirandaFileReadyState mirandaFileReadyState;

    public EventsFile getMockEventsFile() {
        return mockEventsFile;
    }

    public MirandaFileReadyState getMirandaFileReadyState() {
        return mirandaFileReadyState;
    }

    public void reset () {
        super.reset();
    }

    @Before
    public void setup () {
        reset();

        super.setup();

        setuplog4j();
        setupWriter();
        setupMirandaProperties();

        createEventHiearchicy(ROOT, FILE_SYSTEM_SPEC);
        setupFileWatcher(100);

        this.mockEventsFile = mock(EventsFile.class);
        this.mirandaFileReadyState = new MirandaFileReadyState(getMockEventsFile());
    }

    @After
    public void cleanup () {
        deleteDirectory(ROOT);
    }
    @Test
    public void testProcessFileChangedMessage () {
        File file = new File(FILENAME);
        FileChangedMessage message = new FileChangedMessage(null,this, file);
        getMirandaFileReadyState().processMessage(message);

        verify(getMockEventsFile(), atLeastOnce()).load();
    }
}<commit_msg>Updates to TestMirandaFileReadyState<commit_after>package com.ltsllc.miranda.file;

import com.ltsllc.miranda.event.EventsFile;
import com.ltsllc.miranda.miranda.Miranda;
import com.ltsllc.miranda.property.MirandaProperties;
import com.ltsllc.miranda.test.TestCase;
import com.ltsllc.miranda.writer.Writer;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;

import java.io.File;

import static org.mockito.Mockito.atLeastOnce;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;

/**
 * Created by Clark on 2/26/2017.
 */
public class TestMirandaFileReadyState extends TestCase {
    private static final String ROOT = "testdir";

    private static final String[][] FILE_SYSTEM_SPEC = {
            {"whatever", "random file"},
            {"new", "directory"},
            {"new/20170220-001.msg", "event file"},
            {"old", "directory"},
            {"old/whatever", "random file"},
    };

    private static final String FILENAME = "testdir/new/20170220-001.msg";

    @Mock
    private EventsFile mockEventsFile;

    private MirandaFileReadyState mirandaFileReadyState;

    public EventsFile getMockEventsFile() {
        return mockEventsFile;
    }

    public MirandaFileReadyState getMirandaFileReadyState() {
        return mirandaFileReadyState;
    }

    public void reset () {
        super.reset();
    }

    @Before
    public void setup () {
        reset();

        super.setup();

        setuplog4j();
        setupWriter();
        setupMirandaProperties();

        createEventHiearchicy(ROOT, FILE_SYSTEM_SPEC);
        setupFileWatcher(100);

        this.mockEventsFile = mock(EventsFile.class);
        this.mirandaFileReadyState = new MirandaFileReadyState(getMockEventsFile());
    }

    @After
    public void cleanup () {
        deleteDirectory(ROOT);
    }

    @Test
    public void testProcessFileChangedMessage () {
        File file = new File(FILENAME);
        FileChangedMessage message = new FileChangedMessage(null,this, file);
        getMirandaFileReadyState().processMessage(message);

        verify(getMockEventsFile(), atLeastOnce()).load();
    }
}
{'fraction_non_alphanumeric': 0.10850574712643678, 'fraction_numerical': 0.015172413793103448, 'mean_word_length': 3.1280834914611004, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6615476', 'n_tokens_mistral': 1352, 'n_tokens_neox': 1259, 'n_words': 262}