Skip to content

Commit

Permalink
Removed tests that got added during a cherry-pick conflict.
Browse files Browse the repository at this point in the history
These tests can run on master only. See #27896
  • Loading branch information
martijnvg committed Apr 5, 2018
1 parent f4a8b52 commit c4f16eb
Showing 1 changed file with 0 additions and 33 deletions.
33 changes: 0 additions & 33 deletions libs/grok/src/test/java/org/elasticsearch/grok/GrokTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -264,39 +264,6 @@ public void testCircularReference() {
"via patterns [NAME2=>NAME3=>NAME4]", e.getMessage());
}

public void testBooleanCaptures() {
Map<String, String> bank = new HashMap<>();

String pattern = "%{WORD:name}=%{WORD:status:boolean}";
Grok g = new Grok(basePatterns, pattern);

String text = "active=true";
Map<String, Object> expected = new HashMap<>();
expected.put("name", "active");
expected.put("status", true);
Map<String, Object> actual = g.captures(text);

assertEquals(expected, actual);
}

public void testNumericCaptures() {
Map<String, String> bank = new HashMap<>();
bank.put("BASE10NUM", "(?<![0-9.+-])(?>[+-]?(?:(?:[0-9]+(?:\\.[0-9]+)?)|(?:\\.[0-9]+)))");
bank.put("NUMBER", "(?:%{BASE10NUM})");

String pattern = "%{NUMBER:bytes:float} %{NUMBER:id:long} %{NUMBER:rating:double}";
Grok g = new Grok(bank, pattern);

String text = "12009.34 20000000000 4820.092";
Map<String, Object> expected = new HashMap<>();
expected.put("bytes", 12009.34f);
expected.put("id", 20000000000L);
expected.put("rating", 4820.092);
Map<String, Object> actual = g.captures(text);

assertEquals(expected, actual);
}

public void testNumericCapturesCoercion() {
Map<String, String> bank = new HashMap<>();
bank.put("BASE10NUM", "(?<![0-9.+-])(?>[+-]?(?:(?:[0-9]+(?:\\.[0-9]+)?)|(?:\\.[0-9]+)))");
Expand Down

0 comments on commit c4f16eb

Please sign in to comment.