Examples of StreamRule


Examples of org.graylog2.plugin.streams.StreamRule

    @Test
    public void testRandomNumberFieldNonMatch() throws Exception {
        String fieldName = "sampleField";
        Integer randomNumber = 4;
        StreamRule rule = getSampleRule();
        rule.setField(fieldName);
        rule.setType(StreamRuleType.PRESENCE);
        rule.setInverted(false);

        Message message = getSampleMessage();
        message.addField(fieldName, randomNumber);

        StreamRuleMatcher matcher = getMatcher(rule);
View Full Code Here

Examples of org.graylog2.plugin.streams.StreamRule

    @Test
    public void testInvertedRandomNumberFieldMatch() throws Exception {
        String fieldName = "sampleField";
        Integer randomNumber = 4;
        StreamRule rule = getSampleRule();
        rule.setField(fieldName);
        rule.setType(StreamRuleType.PRESENCE);
        rule.setInverted(true);

        Message message = getSampleMessage();
        message.addField(fieldName, randomNumber);

        StreamRuleMatcher matcher = getMatcher(rule);
View Full Code Here

Examples of org.graylog2.plugin.streams.StreamRule

public class GreaterMatcherTest extends MatcherTest {

    @Test
    public void testSuccessfulMatch() {
        StreamRule rule = getSampleRule();
        rule.setValue("3");

        Message msg = getSampleMessage();
        msg.addField("something", "4");

        StreamRuleMatcher matcher = getMatcher(rule);
View Full Code Here

Examples of org.graylog2.plugin.streams.StreamRule

        assertTrue(matcher.match(msg, rule));
    }
   
    @Test
    public void testSuccessfulMatchWithNegativeValue() {
        StreamRule rule = getSampleRule();
        rule.setValue("-54354");

        Message msg = getSampleMessage();
        msg.addField("something", "4");

        StreamRuleMatcher matcher = getMatcher(rule);
View Full Code Here

Examples of org.graylog2.plugin.streams.StreamRule

        assertTrue(matcher.match(msg, rule));
    }

    @Test
    public void testSuccessfullInvertedMatch() {
        StreamRule rule = getSampleRule();
        rule.setValue("10");
        rule.setInverted(true);

        Message msg = getSampleMessage();
        msg.addField("something", "4");

        StreamRuleMatcher matcher = getMatcher(rule);
View Full Code Here

Examples of org.graylog2.plugin.streams.StreamRule

        assertTrue(matcher.match(msg, rule));
    }

    @Test
    public void testMissedMatch() {
        StreamRule rule = getSampleRule();
        rule.setValue("25");

        Message msg = getSampleMessage();
        msg.addField("something", "12");

        StreamRuleMatcher matcher = getMatcher(rule);
View Full Code Here

Examples of org.graylog2.plugin.streams.StreamRule

        assertFalse(matcher.match(msg, rule));
    }

    @Test
    public void testMissedInvertedMatch() {
        StreamRule rule = getSampleRule();
        rule.setValue("25");
        rule.setInverted(true);

        Message msg = getSampleMessage();
        msg.addField("something", "30");

        StreamRuleMatcher matcher = getMatcher(rule);
View Full Code Here

Examples of org.graylog2.plugin.streams.StreamRule

        assertFalse(matcher.match(msg, rule));
    }

    @Test
    public void testMissedMatchWithEqualValues() {
        StreamRule rule = getSampleRule();
        rule.setValue("-9001");

        Message msg = getSampleMessage();
        msg.addField("something", "-9001");

        StreamRuleMatcher matcher = getMatcher(rule);
View Full Code Here

Examples of org.graylog2.plugin.streams.StreamRule

        assertFalse(matcher.match(msg, rule));
    }

    @Test
    public void testSuccessfullInvertedMatchWithEqualValues() {
        StreamRule rule = getSampleRule();
        rule.setValue("-9001");
        rule.setInverted(true);

        Message msg = getSampleMessage();
        msg.addField("something", "-9001");

        StreamRuleMatcher matcher = getMatcher(rule);
View Full Code Here

Examples of org.graylog2.plugin.streams.StreamRule

        assertTrue(matcher.match(msg, rule));
    }

    @Test
    public void testMissedMatchWithInvalidValue() {
        StreamRule rule = getSampleRule();
        rule.setValue("LOL I AM NOT EVEN A NUMBER");

        Message msg = getSampleMessage();
        msg.addField("something", "90000");

        StreamRuleMatcher matcher = getMatcher(rule);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.