use of org.graylog2.plugin.streams.StreamRule in project graylog2-server by Graylog2.
the class GreaterMatcherTest method testSuccessfulDoubleMatchWithNegativeValue.
@Test
public void testSuccessfulDoubleMatchWithNegativeValue() {
StreamRule rule = getSampleRule();
rule.setValue("-54354.0");
Message msg = getSampleMessage();
msg.addField("something", "4.1");
StreamRuleMatcher matcher = getMatcher(rule);
assertTrue(matcher.match(msg, rule));
}
use of org.graylog2.plugin.streams.StreamRule in project graylog2-server by Graylog2.
the class GreaterMatcherTest method testMissedInvertedMatch.
@Test
public void testMissedInvertedMatch() {
StreamRule rule = getSampleRule();
rule.setValue("25");
rule.setInverted(true);
Message msg = getSampleMessage();
msg.addField("something", "30");
StreamRuleMatcher matcher = getMatcher(rule);
assertFalse(matcher.match(msg, rule));
}
use of org.graylog2.plugin.streams.StreamRule in project graylog2-server by Graylog2.
the class GreaterMatcherTest method testMissedMatchWithEqualValues.
@Test
public void testMissedMatchWithEqualValues() {
StreamRule rule = getSampleRule();
rule.setValue("-9001");
Message msg = getSampleMessage();
msg.addField("something", "-9001");
StreamRuleMatcher matcher = getMatcher(rule);
assertFalse(matcher.match(msg, rule));
}
use of org.graylog2.plugin.streams.StreamRule in project graylog2-server by Graylog2.
the class GreaterMatcherTest method testMissedDoubleMatchWithEqualValues.
@Test
public void testMissedDoubleMatchWithEqualValues() {
StreamRule rule = getSampleRule();
rule.setValue("-9001.45");
Message msg = getSampleMessage();
msg.addField("something", "-9001.45");
StreamRuleMatcher matcher = getMatcher(rule);
assertFalse(matcher.match(msg, rule));
}
use of org.graylog2.plugin.streams.StreamRule in project graylog2-server by Graylog2.
the class GreaterMatcherTest method testMissedInvertedMatchMissingField.
@Test
public void testMissedInvertedMatchMissingField() {
StreamRule rule = getSampleRule();
rule.setValue("42");
rule.setInverted(true);
Message msg = getSampleMessage();
msg.addField("someother", "30");
StreamRuleMatcher matcher = getMatcher(rule);
assertFalse(matcher.match(msg, rule));
}
Aggregations