Skip to content

Commit

Permalink
Revert "Upgrade jcodings dependency to 1.0.44 (elastic#43334)"
Browse files Browse the repository at this point in the history
This reverts commit 08a3549 and adds a
test that demonstrates that grok with ignore case fails with the new
dependency (jcodings 1.0.44 has a breaking change compared to 1.0.12,
also requiring an upgrade of joni).
  • Loading branch information
henningandersen committed Nov 7, 2019
1 parent 8d71af3 commit cc2fd0b
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion libs/grok/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
dependencies {
compile 'org.jruby.joni:joni:2.1.6'
// joni dependencies:
compile 'org.jruby.jcodings:jcodings:1.0.44'
compile 'org.jruby.jcodings:jcodings:1.0.12'

testCompile(project(":test:framework")) {
exclude group: 'org.elasticsearch', module: 'elasticsearch-grok'
Expand Down
1 change: 1 addition & 0 deletions libs/grok/licenses/jcodings-1.0.12.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
6bc17079fcaa8823ea8cd0d4c66516335b558db8
1 change: 0 additions & 1 deletion libs/grok/licenses/jcodings-1.0.44.jar.sha1

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,16 @@ public void testMatch() throws Exception {
assertThat(doc.getFieldValue("one", String.class), equalTo("1"));
}

public void testIgnoreCase() throws Exception {
String fieldName = RandomDocumentPicks.randomFieldName(random());
IngestDocument doc = RandomDocumentPicks.randomIngestDocument(random(), new HashMap<>());
doc.setFieldValue(fieldName, "A");
GrokProcessor processor = new GrokProcessor(randomAlphaOfLength(10), Collections.emptyMap(),
Collections.singletonList("(?<a>(?i)A)"), fieldName, false, false, ThreadWatchdog.noop());
processor.execute(doc);
assertThat(doc.getFieldValue("a", String.class), equalTo("A"));
}

public void testNoMatch() {
String fieldName = RandomDocumentPicks.randomFieldName(random());
IngestDocument doc = RandomDocumentPicks.randomIngestDocument(random(), new HashMap<>());
Expand Down

0 comments on commit cc2fd0b

Please sign in to comment.