Skip to content

Commit

Permalink
Fix FunctionsSnippetsTest after conversion function unification (#70)
Browse files Browse the repository at this point in the history
`evalError()` can no longer trigger the error tested for and was removed.
`evalErrorSuppressed()` now tests an illegal default value in `to_ip()`.

Fixes #64
  • Loading branch information
kroepke authored and joschi committed Aug 2, 2016
1 parent 83c2316 commit 1e0f65f
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@
import org.joda.time.DateTimeUtils;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;

import java.util.Map;
Expand Down Expand Up @@ -329,19 +328,6 @@ public void ipMatching() {
}

@Test
@Ignore("Failing after merging https://github.com/Graylog2/graylog-plugin-pipeline-processor/pull/64")
public void evalError() {
final Rule rule = parser.parseRule(ruleForTest(), false);

final EvaluationContext context = contextForRuleEval(rule, new Message("test", "test", Tools.nowUTC()));

assertThat(context).isNotNull();
assertThat(context.hasEvaluationErrors()).isTrue();
assertThat(Iterables.getLast(context.evaluationErrors()).toString()).isEqualTo("In call to function 'regex' at 5:28 an exception was thrown: Argument 'value' cannot be 'null'");
}

@Test
@Ignore("Failing after merging https://github.com/Graylog2/graylog-plugin-pipeline-processor/pull/64")
public void evalErrorSuppressed() {
final Rule rule = parser.parseRule(ruleForTest(), false);

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
rule "suppressing exceptions/nulls"
when
is_null(to_ip($message.does_not_exist)) && is_not_null($message.this_field_was_set)
is_null(to_ip($message.does_not_exist, "d.f.f.f")) && is_not_null($message.this_field_was_set)
then
trigger_test();
end

0 comments on commit 1e0f65f

Please sign in to comment.