<commit_before>package com.hurence.logisland.querymatcher;

import com.hurence.logisland.event.Event;
import org.junit.Test;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;

import static org.junit.Assert.assertTrue;

/**
 * Created by fprunier on 15/04/16.
 */
public class LuwakQueryMatcherTests {

    @Test
    public void testSimpleMatch() {

        MatchingRule rule1 = new MatchingRule("rule1", "name:luke");

        ArrayList<MatchingRule> rules = new ArrayList<>();
        rules.add(rule1);

        LuwakQueryMatcher matcher = new LuwakQueryMatcher(rules);

        Event ev1 = new Event("mytype");
        ev1.put("name","luke");

        Collection<Event> eventsOut = matcher.process(Arrays.asList(ev1));

        assertTrue(eventsOut.size() == 1);
    }
}
<commit_msg>use the right API on the Event class<commit_after>package com.hurence.logisland.querymatcher;

import com.hurence.logisland.event.Event;
import org.junit.Test;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;

import static org.junit.Assert.assertTrue;

/**
 * Created by fprunier on 15/04/16.
 */
public class LuwakQueryMatcherTests {

    @Test
    public void testSimpleMatch() {

        MatchingRule rule1 = new MatchingRule("rule1", "name:luke");

        ArrayList<MatchingRule> rules = new ArrayList<>();
        rules.add(rule1);

        LuwakQueryMatcher matcher = new LuwakQueryMatcher(rules);

        Event ev1 = new Event("mytype");
        ev1.put("name","string", "luke");

        Collection<Event> eventsOut = matcher.process(Arrays.asList(ev1));

        assertTrue(eventsOut.size() == 1);
    }
}

{'fraction_non_alphanumeric': 0.12507480550568523, 'fraction_numerical': 0.015559545182525433, 'mean_word_length': 3.5067385444743935, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '4942784', 'n_tokens_mistral': 547, 'n_tokens_neox': 526, 'n_words': 110}