From f59cdabef0367c29066590cf55b78c2f7a889174 Mon Sep 17 00:00:00 2001 From: nitram509 Date: Tue, 23 Jun 2015 00:44:06 +0200 Subject: [PATCH 01/11] created Action for posting indexed scripts to Elasticsearch --- jest-common/pom.xml | 5 + .../indices/script/CreateIndexedScript.java | 107 ++++++++++++++++++ .../indices/script/ScriptLanguage.java | 22 ++++ .../script/CreateIndexedScriptTest.java | 86 ++++++++++++++ pom.xml | 7 ++ 5 files changed, 227 insertions(+) create mode 100644 jest-common/src/main/java/io/searchbox/indices/script/CreateIndexedScript.java create mode 100644 jest-common/src/main/java/io/searchbox/indices/script/ScriptLanguage.java create mode 100644 jest-common/src/test/java/io/searchbox/indices/script/CreateIndexedScriptTest.java diff --git a/jest-common/pom.xml b/jest-common/pom.xml index 7e5cd343a..d51ba577f 100644 --- a/jest-common/pom.xml +++ b/jest-common/pom.xml @@ -68,6 +68,11 @@ junit + + org.easytesting + fest-assert + + commons-io commons-io diff --git a/jest-common/src/main/java/io/searchbox/indices/script/CreateIndexedScript.java b/jest-common/src/main/java/io/searchbox/indices/script/CreateIndexedScript.java new file mode 100644 index 000000000..fe37e654e --- /dev/null +++ b/jest-common/src/main/java/io/searchbox/indices/script/CreateIndexedScript.java @@ -0,0 +1,107 @@ +package io.searchbox.indices.script; + +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import io.searchbox.action.AbstractAction; +import io.searchbox.action.GenericResultAbstractAction; + +import java.io.*; +import java.net.URLEncoder; +import java.nio.charset.Charset; + +import static io.searchbox.indices.script.ScriptLanguage.GROOVY; +import static java.nio.charset.Charset.defaultCharset; + +public class CreateIndexedScript extends GenericResultAbstractAction { + + private final String scriptName; + private final ScriptLanguage scriptLanguage; + + public CreateIndexedScript(Builder builder) { + super(builder); + this.payload = builder.payload; + this.scriptName = builder.scriptName; + this.scriptLanguage = builder.scriptLanguage; + setURI(buildURI()); + } + + protected String buildURI() { + try { + return super.buildURI() + "/_scripts/" + scriptLanguage.pathParameterName + "/" + URLEncoder.encode(scriptName, CHARSET); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(e); + } + } + + @Override + public String getRestMethodName() { + return "POST"; + } + + public String getScriptName() { + return scriptName; + } + + public ScriptLanguage getScriptLanguage() { + return scriptLanguage; + } + + public static class Builder extends AbstractAction.Builder { + + private String scriptName; + private JsonElement payload; + private ScriptLanguage scriptLanguage = GROOVY; + + public Builder(String scriptName) { + this.scriptName = scriptName; + } + + @Override + public CreateIndexedScript build() { + return new CreateIndexedScript(this); + } + + public Builder setSource(String source) { + createPayload(source); + return this; + } + + public Builder loadSource(File srcFile) throws IOException { + return loadSource(srcFile, defaultCharset()); + } + + public Builder loadSource(File srcFile, Charset encoding) throws IOException { + return loadSource(new FileInputStream(srcFile), encoding); + } + + public Builder loadSource(InputStream srcStream) throws IOException { + return loadSource(srcStream, defaultCharset()); + } + + public Builder loadSource(InputStream srcStream, Charset encoding) throws IOException { + String src = readFully(srcStream, encoding); + createPayload(src); + return this; + } + + public Builder setLanguage(ScriptLanguage language) { + this.scriptLanguage = language; + return this; + } + + private void createPayload(String source) { + JsonObject jsonObject = new JsonObject(); + jsonObject.addProperty("script", source); + payload = jsonObject; + } + + private String readFully(InputStream srcStream, Charset encoding) throws IOException { + byte[] buf = new byte[8192]; + StringBuilder sb = new StringBuilder(); + for (int read; (read = srcStream.read(buf)) > 0; ) { + sb.append(new String(buf, 0, read, encoding)); + } + return sb.toString(); + } + } +} diff --git a/jest-common/src/main/java/io/searchbox/indices/script/ScriptLanguage.java b/jest-common/src/main/java/io/searchbox/indices/script/ScriptLanguage.java new file mode 100644 index 000000000..9928f3be5 --- /dev/null +++ b/jest-common/src/main/java/io/searchbox/indices/script/ScriptLanguage.java @@ -0,0 +1,22 @@ +package io.searchbox.indices.script; + +/** + * As described in Elasticsearch Reference + * + * https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-scripting.html + * + */ +public enum ScriptLanguage { + GROOVY("groovy"), + EXPRESSION("expression"), + MUSTACHE("mustache"), + MVEL("mvel"), + JAVASCRIPT("javascript"), + PYTHON("python"); + + public final String pathParameterName; + + ScriptLanguage(String pathParameterName) { + this.pathParameterName = pathParameterName; + } +} diff --git a/jest-common/src/test/java/io/searchbox/indices/script/CreateIndexedScriptTest.java b/jest-common/src/test/java/io/searchbox/indices/script/CreateIndexedScriptTest.java new file mode 100644 index 000000000..74876beab --- /dev/null +++ b/jest-common/src/test/java/io/searchbox/indices/script/CreateIndexedScriptTest.java @@ -0,0 +1,86 @@ +package io.searchbox.indices.script; + +import com.google.gson.Gson; +import com.google.gson.JsonObject; +import com.google.gson.JsonParser; +import org.junit.Before; +import org.junit.Test; + +import java.io.File; +import java.io.FileWriter; +import java.io.IOException; + +import static io.searchbox.indices.script.ScriptLanguage.GROOVY; +import static io.searchbox.indices.script.ScriptLanguage.JAVASCRIPT; +import static org.fest.assertions.Assertions.assertThat; + +public class CreateIndexedScriptTest { + + private static final String A_NAME = "a_name"; + private CreateIndexedScript script; + private CreateIndexedScript.Builder builder; + private String groovysnippet; + + @Before + public void setUp() throws Exception { + builder = new CreateIndexedScript.Builder(A_NAME).setLanguage(JAVASCRIPT); + script = builder.build(); + groovysnippet = "def test_a=123\n" + + "def test_b=\"$test_a\"\n"; + } + + @Test + public void defaultScriptingLanguageIsGroovy() throws Exception { + CreateIndexedScript script = new CreateIndexedScript.Builder(A_NAME).build(); + + assertThat(script.getScriptLanguage()).isEqualTo(GROOVY); + assertThat(script.buildURI()).contains(GROOVY.pathParameterName); + } + + @Test + public void scriptingLanguageIsSetIntoPath() throws Exception { + + assertThat(script.buildURI()).contains("/_scripts/" + JAVASCRIPT.pathParameterName + "/"); + } + + @Test + public void nameOfTheScriptIsSetIntoPath() throws Exception { + + assertThat(script.buildURI()).contains("/_scripts/" + JAVASCRIPT.pathParameterName + "/" + A_NAME); + } + + @Test + public void scriptSourceIsValidJsonString() throws Exception { + builder.setSource(groovysnippet); + + script = builder.build(); + + JsonObject jsonPayload = parseAsGson(script.getData(new Gson())); + assertThat(jsonPayload.get("script")).isNotNull(); + assertThat(jsonPayload.get("script").getAsString()).isEqualTo(groovysnippet); + } + + @Test + public void fileSourceIsValidJsonString() throws Exception { + builder.loadSource(createTempGroovySnippetFile()); + + script = builder.build(); + + JsonObject jsonPayload = parseAsGson(script.getData(new Gson())); + assertThat(jsonPayload.get("script")).isNotNull(); + assertThat(jsonPayload.get("script").getAsString()).isEqualTo(groovysnippet); + } + + private File createTempGroovySnippetFile() throws IOException { + File file = File.createTempFile("test", ".groovy"); + file.deleteOnExit(); + FileWriter writer = new FileWriter(file); + writer.write(groovysnippet); + writer.close(); + return file; + } + + private JsonObject parseAsGson(String data) { + return new JsonParser().parse(data).getAsJsonObject(); + } +} \ No newline at end of file diff --git a/pom.xml b/pom.xml index b02a7b450..04bb11b8a 100755 --- a/pom.xml +++ b/pom.xml @@ -89,6 +89,7 @@ 3.4 2.4 4.12 + 1.4 2.18.1 @@ -255,6 +256,12 @@ ${junit.version} test + + org.easytesting + fest-assert + ${fest-assert.version} + test + commons-io From 3ccb6cdd4ead5bde60edbf427c0edaac4b7e9c95 Mon Sep 17 00:00:00 2001 From: nitram509 Date: Tue, 23 Jun 2015 00:47:17 +0200 Subject: [PATCH 02/11] created Action for deleting indexed scripts from ES --- .../indices/script/DeleteIndexedScript.java | 64 +++++++++++++++++++ .../script/DeleteIndexedScriptTest.java | 41 ++++++++++++ 2 files changed, 105 insertions(+) create mode 100644 jest-common/src/main/java/io/searchbox/indices/script/DeleteIndexedScript.java create mode 100644 jest-common/src/test/java/io/searchbox/indices/script/DeleteIndexedScriptTest.java diff --git a/jest-common/src/main/java/io/searchbox/indices/script/DeleteIndexedScript.java b/jest-common/src/main/java/io/searchbox/indices/script/DeleteIndexedScript.java new file mode 100644 index 000000000..3dec68f66 --- /dev/null +++ b/jest-common/src/main/java/io/searchbox/indices/script/DeleteIndexedScript.java @@ -0,0 +1,64 @@ +package io.searchbox.indices.script; + +import io.searchbox.action.AbstractAction; +import io.searchbox.action.GenericResultAbstractAction; + +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; + +import static io.searchbox.indices.script.ScriptLanguage.GROOVY; + +public class DeleteIndexedScript extends GenericResultAbstractAction { + + private final String scriptName; + private final ScriptLanguage scriptLanguage; + + public DeleteIndexedScript(Builder builder) { + super(builder); + this.scriptName = builder.scriptName; + this.scriptLanguage = builder.scriptLanguage; + setURI(buildURI()); + } + + protected String buildURI() { + try { + return super.buildURI() + "/_scripts/" + scriptLanguage.pathParameterName + "/" + URLEncoder.encode(scriptName, CHARSET); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(e); + } + } + + @Override + public String getRestMethodName() { + return "DELETE"; + } + + public String getScriptName() { + return scriptName; + } + + public ScriptLanguage getScriptLanguage() { + return scriptLanguage; + } + + public static class Builder extends AbstractAction.Builder { + + private String scriptName; + private ScriptLanguage scriptLanguage = GROOVY; + + public Builder(String scriptName) { + this.scriptName = scriptName; + } + + public Builder setLanguage(ScriptLanguage scriptLanguage) { + this.scriptLanguage = scriptLanguage; + return this; + } + + @Override + public DeleteIndexedScript build() { + return new DeleteIndexedScript(this); + } + + } +} diff --git a/jest-common/src/test/java/io/searchbox/indices/script/DeleteIndexedScriptTest.java b/jest-common/src/test/java/io/searchbox/indices/script/DeleteIndexedScriptTest.java new file mode 100644 index 000000000..636e218b9 --- /dev/null +++ b/jest-common/src/test/java/io/searchbox/indices/script/DeleteIndexedScriptTest.java @@ -0,0 +1,41 @@ +package io.searchbox.indices.script; + +import org.junit.Before; +import org.junit.Test; + +import static io.searchbox.indices.script.ScriptLanguage.GROOVY; +import static io.searchbox.indices.script.ScriptLanguage.JAVASCRIPT; +import static org.fest.assertions.Assertions.assertThat; + +public class DeleteIndexedScriptTest { + + private static final String A_NAME = "a_name"; + private DeleteIndexedScript script; + + @Before + public void setUp() throws Exception { + DeleteIndexedScript.Builder builder = new DeleteIndexedScript.Builder(A_NAME).setLanguage(JAVASCRIPT); + script = builder.build(); + } + + @Test + public void defaultScriptingLanguageIsGroovy() throws Exception { + DeleteIndexedScript script = new DeleteIndexedScript.Builder(A_NAME).build(); + + assertThat(script.getScriptLanguage()).isEqualTo(GROOVY); + assertThat(script.buildURI()).contains(GROOVY.pathParameterName); + } + + @Test + public void scriptingLanguageIsSetIntoPath() throws Exception { + + assertThat(script.buildURI()).contains("/_scripts/" + JAVASCRIPT.pathParameterName + "/"); + } + + @Test + public void nameOfTheScriptIsSetIntoPath() throws Exception { + + assertThat(script.buildURI()).contains("/_scripts/" + JAVASCRIPT.pathParameterName + "/" + A_NAME); + } + +} \ No newline at end of file From 04932d3f146a33914296f8b91184922feac2f842 Mon Sep 17 00:00:00 2001 From: nitram509 Date: Mon, 29 Jun 2015 19:57:54 +0200 Subject: [PATCH 03/11] reworked tests o use JUnit instead of fest assertions, because its more consistence to all other tests --- jest-common/pom.xml | 5 ----- .../script/CreateIndexedScriptTest.java | 19 ++++++++++--------- .../script/DeleteIndexedScriptTest.java | 12 +++++++----- 3 files changed, 17 insertions(+), 19 deletions(-) diff --git a/jest-common/pom.xml b/jest-common/pom.xml index d51ba577f..7e5cd343a 100644 --- a/jest-common/pom.xml +++ b/jest-common/pom.xml @@ -68,11 +68,6 @@ junit - - org.easytesting - fest-assert - - commons-io commons-io diff --git a/jest-common/src/test/java/io/searchbox/indices/script/CreateIndexedScriptTest.java b/jest-common/src/test/java/io/searchbox/indices/script/CreateIndexedScriptTest.java index 74876beab..216c83447 100644 --- a/jest-common/src/test/java/io/searchbox/indices/script/CreateIndexedScriptTest.java +++ b/jest-common/src/test/java/io/searchbox/indices/script/CreateIndexedScriptTest.java @@ -12,7 +12,8 @@ import static io.searchbox.indices.script.ScriptLanguage.GROOVY; import static io.searchbox.indices.script.ScriptLanguage.JAVASCRIPT; -import static org.fest.assertions.Assertions.assertThat; +import static org.hamcrest.CoreMatchers.containsString; +import static org.junit.Assert.*; public class CreateIndexedScriptTest { @@ -33,20 +34,20 @@ public void setUp() throws Exception { public void defaultScriptingLanguageIsGroovy() throws Exception { CreateIndexedScript script = new CreateIndexedScript.Builder(A_NAME).build(); - assertThat(script.getScriptLanguage()).isEqualTo(GROOVY); - assertThat(script.buildURI()).contains(GROOVY.pathParameterName); + assertEquals(GROOVY, script.getScriptLanguage()); + assertThat(script.buildURI(), containsString(GROOVY.pathParameterName)); } @Test public void scriptingLanguageIsSetIntoPath() throws Exception { - assertThat(script.buildURI()).contains("/_scripts/" + JAVASCRIPT.pathParameterName + "/"); + assertThat(script.buildURI(), containsString("/_scripts/" + JAVASCRIPT.pathParameterName + "/")); } @Test public void nameOfTheScriptIsSetIntoPath() throws Exception { - assertThat(script.buildURI()).contains("/_scripts/" + JAVASCRIPT.pathParameterName + "/" + A_NAME); + assertThat(script.buildURI(), containsString("/_scripts/" + JAVASCRIPT.pathParameterName + "/" + A_NAME)); } @Test @@ -56,8 +57,8 @@ public void scriptSourceIsValidJsonString() throws Exception { script = builder.build(); JsonObject jsonPayload = parseAsGson(script.getData(new Gson())); - assertThat(jsonPayload.get("script")).isNotNull(); - assertThat(jsonPayload.get("script").getAsString()).isEqualTo(groovysnippet); + assertNotNull(jsonPayload.get("script")); + assertEquals(groovysnippet, jsonPayload.get("script").getAsString()); } @Test @@ -67,8 +68,8 @@ public void fileSourceIsValidJsonString() throws Exception { script = builder.build(); JsonObject jsonPayload = parseAsGson(script.getData(new Gson())); - assertThat(jsonPayload.get("script")).isNotNull(); - assertThat(jsonPayload.get("script").getAsString()).isEqualTo(groovysnippet); + assertNotNull(jsonPayload.get("script")); + assertEquals(groovysnippet, jsonPayload.get("script").getAsString()); } private File createTempGroovySnippetFile() throws IOException { diff --git a/jest-common/src/test/java/io/searchbox/indices/script/DeleteIndexedScriptTest.java b/jest-common/src/test/java/io/searchbox/indices/script/DeleteIndexedScriptTest.java index 636e218b9..46c205fcc 100644 --- a/jest-common/src/test/java/io/searchbox/indices/script/DeleteIndexedScriptTest.java +++ b/jest-common/src/test/java/io/searchbox/indices/script/DeleteIndexedScriptTest.java @@ -5,7 +5,9 @@ import static io.searchbox.indices.script.ScriptLanguage.GROOVY; import static io.searchbox.indices.script.ScriptLanguage.JAVASCRIPT; -import static org.fest.assertions.Assertions.assertThat; +import static org.hamcrest.CoreMatchers.containsString; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertThat; public class DeleteIndexedScriptTest { @@ -22,20 +24,20 @@ public void setUp() throws Exception { public void defaultScriptingLanguageIsGroovy() throws Exception { DeleteIndexedScript script = new DeleteIndexedScript.Builder(A_NAME).build(); - assertThat(script.getScriptLanguage()).isEqualTo(GROOVY); - assertThat(script.buildURI()).contains(GROOVY.pathParameterName); + assertEquals(GROOVY, script.getScriptLanguage()); + assertThat(script.buildURI(), containsString(GROOVY.pathParameterName)); } @Test public void scriptingLanguageIsSetIntoPath() throws Exception { - assertThat(script.buildURI()).contains("/_scripts/" + JAVASCRIPT.pathParameterName + "/"); + assertThat(script.buildURI(), containsString("/_scripts/" + JAVASCRIPT.pathParameterName + "/")); } @Test public void nameOfTheScriptIsSetIntoPath() throws Exception { - assertThat(script.buildURI()).contains("/_scripts/" + JAVASCRIPT.pathParameterName + "/" + A_NAME); + assertThat(script.buildURI(), containsString("/_scripts/" + JAVASCRIPT.pathParameterName + "/" + A_NAME)); } } \ No newline at end of file From af5d9437492e6528c2f6e81f0e8321950c904001 Mon Sep 17 00:00:00 2001 From: nitram509 Date: Mon, 29 Jun 2015 20:01:25 +0200 Subject: [PATCH 04/11] made action constructor protected, as Kramer in f4c5abcc421d141452b3f40d526cca54ef89c337 --- .../java/io/searchbox/indices/script/CreateIndexedScript.java | 2 +- .../java/io/searchbox/indices/script/DeleteIndexedScript.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/jest-common/src/main/java/io/searchbox/indices/script/CreateIndexedScript.java b/jest-common/src/main/java/io/searchbox/indices/script/CreateIndexedScript.java index fe37e654e..b236d52dd 100644 --- a/jest-common/src/main/java/io/searchbox/indices/script/CreateIndexedScript.java +++ b/jest-common/src/main/java/io/searchbox/indices/script/CreateIndexedScript.java @@ -17,7 +17,7 @@ public class CreateIndexedScript extends GenericResultAbstractAction { private final String scriptName; private final ScriptLanguage scriptLanguage; - public CreateIndexedScript(Builder builder) { + protected CreateIndexedScript(Builder builder) { super(builder); this.payload = builder.payload; this.scriptName = builder.scriptName; diff --git a/jest-common/src/main/java/io/searchbox/indices/script/DeleteIndexedScript.java b/jest-common/src/main/java/io/searchbox/indices/script/DeleteIndexedScript.java index 3dec68f66..0862b2ea2 100644 --- a/jest-common/src/main/java/io/searchbox/indices/script/DeleteIndexedScript.java +++ b/jest-common/src/main/java/io/searchbox/indices/script/DeleteIndexedScript.java @@ -13,7 +13,7 @@ public class DeleteIndexedScript extends GenericResultAbstractAction { private final String scriptName; private final ScriptLanguage scriptLanguage; - public DeleteIndexedScript(Builder builder) { + protected DeleteIndexedScript(Builder builder) { super(builder); this.scriptName = builder.scriptName; this.scriptLanguage = builder.scriptLanguage; From 56cf15053746aadf5fa10426886a5f209587ce0f Mon Sep 17 00:00:00 2001 From: nitram509 Date: Mon, 29 Jun 2015 20:06:54 +0200 Subject: [PATCH 05/11] reworked to use CharStreams.toString() utility to do more code re-use reworked to use AbstractAction.CHARSET, to be more consistent --- .../indices/script/CreateIndexedScript.java | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/jest-common/src/main/java/io/searchbox/indices/script/CreateIndexedScript.java b/jest-common/src/main/java/io/searchbox/indices/script/CreateIndexedScript.java index b236d52dd..9f366af2e 100644 --- a/jest-common/src/main/java/io/searchbox/indices/script/CreateIndexedScript.java +++ b/jest-common/src/main/java/io/searchbox/indices/script/CreateIndexedScript.java @@ -1,5 +1,6 @@ package io.searchbox.indices.script; +import com.google.common.io.CharStreams; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import io.searchbox.action.AbstractAction; @@ -10,7 +11,6 @@ import java.nio.charset.Charset; import static io.searchbox.indices.script.ScriptLanguage.GROOVY; -import static java.nio.charset.Charset.defaultCharset; public class CreateIndexedScript extends GenericResultAbstractAction { @@ -67,7 +67,7 @@ public Builder setSource(String source) { } public Builder loadSource(File srcFile) throws IOException { - return loadSource(srcFile, defaultCharset()); + return loadSource(srcFile, Charset.forName(AbstractAction.CHARSET)); } public Builder loadSource(File srcFile, Charset encoding) throws IOException { @@ -75,11 +75,11 @@ public Builder loadSource(File srcFile, Charset encoding) throws IOException { } public Builder loadSource(InputStream srcStream) throws IOException { - return loadSource(srcStream, defaultCharset()); + return loadSource(srcStream, Charset.forName(AbstractAction.CHARSET)); } public Builder loadSource(InputStream srcStream, Charset encoding) throws IOException { - String src = readFully(srcStream, encoding); + String src = CharStreams.toString(new InputStreamReader(srcStream, encoding)); createPayload(src); return this; } @@ -95,13 +95,5 @@ private void createPayload(String source) { payload = jsonObject; } - private String readFully(InputStream srcStream, Charset encoding) throws IOException { - byte[] buf = new byte[8192]; - StringBuilder sb = new StringBuilder(); - for (int read; (read = srcStream.read(buf)) > 0; ) { - sb.append(new String(buf, 0, read, encoding)); - } - return sb.toString(); - } } } From 0569d0aa28fbd0ff14265bb99732e8cecf8b48f8 Mon Sep 17 00:00:00 2001 From: nitram509 Date: Mon, 29 Jun 2015 20:07:50 +0200 Subject: [PATCH 06/11] added myself to README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 5ad241145..5c5c06a22 100644 --- a/README.md +++ b/README.md @@ -76,6 +76,7 @@ We also would like to thank the following people for their significant contribut * [Steven Rapp](https://github.com/srapp) * [Stig Brautaset](https://github.com/stig) * [Thomas Mühlfriedel](https://github.com/tomsen-san) +* [Martin W. Kirst](https://github.com/nitram509) Copyright and License From e4bb4190791aa4dbbdadde8cda28b00a8490efb4 Mon Sep 17 00:00:00 2001 From: nitram509 Date: Mon, 29 Jun 2015 20:12:14 +0200 Subject: [PATCH 07/11] to be more consistent, log the Exception and move on --- .../searchbox/indices/script/CreateIndexedScript.java | 10 +++++++--- .../searchbox/indices/script/DeleteIndexedScript.java | 10 +++++++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/jest-common/src/main/java/io/searchbox/indices/script/CreateIndexedScript.java b/jest-common/src/main/java/io/searchbox/indices/script/CreateIndexedScript.java index 9f366af2e..05076086b 100644 --- a/jest-common/src/main/java/io/searchbox/indices/script/CreateIndexedScript.java +++ b/jest-common/src/main/java/io/searchbox/indices/script/CreateIndexedScript.java @@ -7,10 +7,10 @@ import io.searchbox.action.GenericResultAbstractAction; import java.io.*; -import java.net.URLEncoder; import java.nio.charset.Charset; import static io.searchbox.indices.script.ScriptLanguage.GROOVY; +import static java.net.URLEncoder.encode; public class CreateIndexedScript extends GenericResultAbstractAction { @@ -26,11 +26,15 @@ protected CreateIndexedScript(Builder builder) { } protected String buildURI() { + String finalUri = super.buildURI() + "/_scripts/" + scriptLanguage.pathParameterName + "/"; try { - return super.buildURI() + "/_scripts/" + scriptLanguage.pathParameterName + "/" + URLEncoder.encode(scriptName, CHARSET); + finalUri += encode(scriptName, CHARSET); } catch (UnsupportedEncodingException e) { - throw new RuntimeException(e); + // unless CHARSET is overridden with a wrong value in a subclass, + // this exception won't be thrown. + log.error("Error occurred while adding parameters to uri.", e); } + return finalUri; } @Override diff --git a/jest-common/src/main/java/io/searchbox/indices/script/DeleteIndexedScript.java b/jest-common/src/main/java/io/searchbox/indices/script/DeleteIndexedScript.java index 0862b2ea2..359b102ef 100644 --- a/jest-common/src/main/java/io/searchbox/indices/script/DeleteIndexedScript.java +++ b/jest-common/src/main/java/io/searchbox/indices/script/DeleteIndexedScript.java @@ -4,9 +4,9 @@ import io.searchbox.action.GenericResultAbstractAction; import java.io.UnsupportedEncodingException; -import java.net.URLEncoder; import static io.searchbox.indices.script.ScriptLanguage.GROOVY; +import static java.net.URLEncoder.encode; public class DeleteIndexedScript extends GenericResultAbstractAction { @@ -21,11 +21,15 @@ protected DeleteIndexedScript(Builder builder) { } protected String buildURI() { + String finalUri = super.buildURI() + "/_scripts/" + scriptLanguage.pathParameterName + "/"; try { - return super.buildURI() + "/_scripts/" + scriptLanguage.pathParameterName + "/" + URLEncoder.encode(scriptName, CHARSET); + finalUri += encode(scriptName, CHARSET); } catch (UnsupportedEncodingException e) { - throw new RuntimeException(e); + // unless CHARSET is overridden with a wrong value in a subclass, + // this exception won't be thrown. + log.error("Error occurred while adding parameters to uri.", e); } + return finalUri; } @Override From c249a47cb6bdf6d690bc9d1c8d00833d26ab31d5 Mon Sep 17 00:00:00 2001 From: nitram509 Date: Mon, 29 Jun 2015 20:44:19 +0200 Subject: [PATCH 08/11] fixed ident to 4 spaces, cause all other sources also do --- .../indices/script/CreateIndexedScript.java | 140 +++++++++--------- .../indices/script/DeleteIndexedScript.java | 90 +++++------ .../indices/script/ScriptLanguage.java | 20 +-- .../script/CreateIndexedScriptTest.java | 134 ++++++++--------- .../script/DeleteIndexedScriptTest.java | 42 +++--- 5 files changed, 213 insertions(+), 213 deletions(-) diff --git a/jest-common/src/main/java/io/searchbox/indices/script/CreateIndexedScript.java b/jest-common/src/main/java/io/searchbox/indices/script/CreateIndexedScript.java index 05076086b..01480e85a 100644 --- a/jest-common/src/main/java/io/searchbox/indices/script/CreateIndexedScript.java +++ b/jest-common/src/main/java/io/searchbox/indices/script/CreateIndexedScript.java @@ -14,90 +14,90 @@ public class CreateIndexedScript extends GenericResultAbstractAction { - private final String scriptName; - private final ScriptLanguage scriptLanguage; - - protected CreateIndexedScript(Builder builder) { - super(builder); - this.payload = builder.payload; - this.scriptName = builder.scriptName; - this.scriptLanguage = builder.scriptLanguage; - setURI(buildURI()); - } - - protected String buildURI() { - String finalUri = super.buildURI() + "/_scripts/" + scriptLanguage.pathParameterName + "/"; - try { - finalUri += encode(scriptName, CHARSET); - } catch (UnsupportedEncodingException e) { - // unless CHARSET is overridden with a wrong value in a subclass, - // this exception won't be thrown. - log.error("Error occurred while adding parameters to uri.", e); + private final String scriptName; + private final ScriptLanguage scriptLanguage; + + protected CreateIndexedScript(Builder builder) { + super(builder); + this.payload = builder.payload; + this.scriptName = builder.scriptName; + this.scriptLanguage = builder.scriptLanguage; + setURI(buildURI()); } - return finalUri; - } - @Override - public String getRestMethodName() { - return "POST"; - } - - public String getScriptName() { - return scriptName; - } - - public ScriptLanguage getScriptLanguage() { - return scriptLanguage; - } - - public static class Builder extends AbstractAction.Builder { - - private String scriptName; - private JsonElement payload; - private ScriptLanguage scriptLanguage = GROOVY; - - public Builder(String scriptName) { - this.scriptName = scriptName; + protected String buildURI() { + String finalUri = super.buildURI() + "/_scripts/" + scriptLanguage.pathParameterName + "/"; + try { + finalUri += encode(scriptName, CHARSET); + } catch (UnsupportedEncodingException e) { + // unless CHARSET is overridden with a wrong value in a subclass, + // this exception won't be thrown. + log.error("Error occurred while adding parameters to uri.", e); + } + return finalUri; } @Override - public CreateIndexedScript build() { - return new CreateIndexedScript(this); + public String getRestMethodName() { + return "POST"; } - public Builder setSource(String source) { - createPayload(source); - return this; + public String getScriptName() { + return scriptName; } - public Builder loadSource(File srcFile) throws IOException { - return loadSource(srcFile, Charset.forName(AbstractAction.CHARSET)); + public ScriptLanguage getScriptLanguage() { + return scriptLanguage; } - public Builder loadSource(File srcFile, Charset encoding) throws IOException { - return loadSource(new FileInputStream(srcFile), encoding); - } + public static class Builder extends AbstractAction.Builder { - public Builder loadSource(InputStream srcStream) throws IOException { - return loadSource(srcStream, Charset.forName(AbstractAction.CHARSET)); - } + private String scriptName; + private JsonElement payload; + private ScriptLanguage scriptLanguage = GROOVY; - public Builder loadSource(InputStream srcStream, Charset encoding) throws IOException { - String src = CharStreams.toString(new InputStreamReader(srcStream, encoding)); - createPayload(src); - return this; - } + public Builder(String scriptName) { + this.scriptName = scriptName; + } - public Builder setLanguage(ScriptLanguage language) { - this.scriptLanguage = language; - return this; - } + @Override + public CreateIndexedScript build() { + return new CreateIndexedScript(this); + } - private void createPayload(String source) { - JsonObject jsonObject = new JsonObject(); - jsonObject.addProperty("script", source); - payload = jsonObject; - } + public Builder setSource(String source) { + createPayload(source); + return this; + } + + public Builder loadSource(File srcFile) throws IOException { + return loadSource(srcFile, Charset.forName(AbstractAction.CHARSET)); + } + + public Builder loadSource(File srcFile, Charset encoding) throws IOException { + return loadSource(new FileInputStream(srcFile), encoding); + } + + public Builder loadSource(InputStream srcStream) throws IOException { + return loadSource(srcStream, Charset.forName(AbstractAction.CHARSET)); + } - } + public Builder loadSource(InputStream srcStream, Charset encoding) throws IOException { + String src = CharStreams.toString(new InputStreamReader(srcStream, encoding)); + createPayload(src); + return this; + } + + public Builder setLanguage(ScriptLanguage language) { + this.scriptLanguage = language; + return this; + } + + private void createPayload(String source) { + JsonObject jsonObject = new JsonObject(); + jsonObject.addProperty("script", source); + payload = jsonObject; + } + + } } diff --git a/jest-common/src/main/java/io/searchbox/indices/script/DeleteIndexedScript.java b/jest-common/src/main/java/io/searchbox/indices/script/DeleteIndexedScript.java index 359b102ef..88487fac8 100644 --- a/jest-common/src/main/java/io/searchbox/indices/script/DeleteIndexedScript.java +++ b/jest-common/src/main/java/io/searchbox/indices/script/DeleteIndexedScript.java @@ -10,59 +10,59 @@ public class DeleteIndexedScript extends GenericResultAbstractAction { - private final String scriptName; - private final ScriptLanguage scriptLanguage; - - protected DeleteIndexedScript(Builder builder) { - super(builder); - this.scriptName = builder.scriptName; - this.scriptLanguage = builder.scriptLanguage; - setURI(buildURI()); - } - - protected String buildURI() { - String finalUri = super.buildURI() + "/_scripts/" + scriptLanguage.pathParameterName + "/"; - try { - finalUri += encode(scriptName, CHARSET); - } catch (UnsupportedEncodingException e) { - // unless CHARSET is overridden with a wrong value in a subclass, - // this exception won't be thrown. - log.error("Error occurred while adding parameters to uri.", e); + private final String scriptName; + private final ScriptLanguage scriptLanguage; + + protected DeleteIndexedScript(Builder builder) { + super(builder); + this.scriptName = builder.scriptName; + this.scriptLanguage = builder.scriptLanguage; + setURI(buildURI()); } - return finalUri; - } - @Override - public String getRestMethodName() { - return "DELETE"; - } + protected String buildURI() { + String finalUri = super.buildURI() + "/_scripts/" + scriptLanguage.pathParameterName + "/"; + try { + finalUri += encode(scriptName, CHARSET); + } catch (UnsupportedEncodingException e) { + // unless CHARSET is overridden with a wrong value in a subclass, + // this exception won't be thrown. + log.error("Error occurred while adding parameters to uri.", e); + } + return finalUri; + } - public String getScriptName() { - return scriptName; - } + @Override + public String getRestMethodName() { + return "DELETE"; + } - public ScriptLanguage getScriptLanguage() { - return scriptLanguage; - } + public String getScriptName() { + return scriptName; + } - public static class Builder extends AbstractAction.Builder { + public ScriptLanguage getScriptLanguage() { + return scriptLanguage; + } - private String scriptName; - private ScriptLanguage scriptLanguage = GROOVY; + public static class Builder extends AbstractAction.Builder { - public Builder(String scriptName) { - this.scriptName = scriptName; - } + private String scriptName; + private ScriptLanguage scriptLanguage = GROOVY; - public Builder setLanguage(ScriptLanguage scriptLanguage) { - this.scriptLanguage = scriptLanguage; - return this; - } + public Builder(String scriptName) { + this.scriptName = scriptName; + } - @Override - public DeleteIndexedScript build() { - return new DeleteIndexedScript(this); - } + public Builder setLanguage(ScriptLanguage scriptLanguage) { + this.scriptLanguage = scriptLanguage; + return this; + } - } + @Override + public DeleteIndexedScript build() { + return new DeleteIndexedScript(this); + } + + } } diff --git a/jest-common/src/main/java/io/searchbox/indices/script/ScriptLanguage.java b/jest-common/src/main/java/io/searchbox/indices/script/ScriptLanguage.java index 9928f3be5..5ea85f890 100644 --- a/jest-common/src/main/java/io/searchbox/indices/script/ScriptLanguage.java +++ b/jest-common/src/main/java/io/searchbox/indices/script/ScriptLanguage.java @@ -7,16 +7,16 @@ * */ public enum ScriptLanguage { - GROOVY("groovy"), - EXPRESSION("expression"), - MUSTACHE("mustache"), - MVEL("mvel"), - JAVASCRIPT("javascript"), - PYTHON("python"); + GROOVY("groovy"), + EXPRESSION("expression"), + MUSTACHE("mustache"), + MVEL("mvel"), + JAVASCRIPT("javascript"), + PYTHON("python"); - public final String pathParameterName; + public final String pathParameterName; - ScriptLanguage(String pathParameterName) { - this.pathParameterName = pathParameterName; - } + ScriptLanguage(String pathParameterName) { + this.pathParameterName = pathParameterName; + } } diff --git a/jest-common/src/test/java/io/searchbox/indices/script/CreateIndexedScriptTest.java b/jest-common/src/test/java/io/searchbox/indices/script/CreateIndexedScriptTest.java index 216c83447..2cb180cb3 100644 --- a/jest-common/src/test/java/io/searchbox/indices/script/CreateIndexedScriptTest.java +++ b/jest-common/src/test/java/io/searchbox/indices/script/CreateIndexedScriptTest.java @@ -17,71 +17,71 @@ public class CreateIndexedScriptTest { - private static final String A_NAME = "a_name"; - private CreateIndexedScript script; - private CreateIndexedScript.Builder builder; - private String groovysnippet; - - @Before - public void setUp() throws Exception { - builder = new CreateIndexedScript.Builder(A_NAME).setLanguage(JAVASCRIPT); - script = builder.build(); - groovysnippet = "def test_a=123\n" + - "def test_b=\"$test_a\"\n"; - } - - @Test - public void defaultScriptingLanguageIsGroovy() throws Exception { - CreateIndexedScript script = new CreateIndexedScript.Builder(A_NAME).build(); - - assertEquals(GROOVY, script.getScriptLanguage()); - assertThat(script.buildURI(), containsString(GROOVY.pathParameterName)); - } - - @Test - public void scriptingLanguageIsSetIntoPath() throws Exception { - - assertThat(script.buildURI(), containsString("/_scripts/" + JAVASCRIPT.pathParameterName + "/")); - } - - @Test - public void nameOfTheScriptIsSetIntoPath() throws Exception { - - assertThat(script.buildURI(), containsString("/_scripts/" + JAVASCRIPT.pathParameterName + "/" + A_NAME)); - } - - @Test - public void scriptSourceIsValidJsonString() throws Exception { - builder.setSource(groovysnippet); - - script = builder.build(); - - JsonObject jsonPayload = parseAsGson(script.getData(new Gson())); - assertNotNull(jsonPayload.get("script")); - assertEquals(groovysnippet, jsonPayload.get("script").getAsString()); - } - - @Test - public void fileSourceIsValidJsonString() throws Exception { - builder.loadSource(createTempGroovySnippetFile()); - - script = builder.build(); - - JsonObject jsonPayload = parseAsGson(script.getData(new Gson())); - assertNotNull(jsonPayload.get("script")); - assertEquals(groovysnippet, jsonPayload.get("script").getAsString()); - } - - private File createTempGroovySnippetFile() throws IOException { - File file = File.createTempFile("test", ".groovy"); - file.deleteOnExit(); - FileWriter writer = new FileWriter(file); - writer.write(groovysnippet); - writer.close(); - return file; - } - - private JsonObject parseAsGson(String data) { - return new JsonParser().parse(data).getAsJsonObject(); - } + private static final String A_NAME = "a_name"; + private CreateIndexedScript script; + private CreateIndexedScript.Builder builder; + private String groovysnippet; + + @Before + public void setUp() throws Exception { + builder = new CreateIndexedScript.Builder(A_NAME).setLanguage(JAVASCRIPT); + script = builder.build(); + groovysnippet = "def test_a=123\n" + + "def test_b=\"$test_a\"\n"; + } + + @Test + public void defaultScriptingLanguageIsGroovy() throws Exception { + CreateIndexedScript script = new CreateIndexedScript.Builder(A_NAME).build(); + + assertEquals(GROOVY, script.getScriptLanguage()); + assertThat(script.buildURI(), containsString(GROOVY.pathParameterName)); + } + + @Test + public void scriptingLanguageIsSetIntoPath() throws Exception { + + assertThat(script.buildURI(), containsString("/_scripts/" + JAVASCRIPT.pathParameterName + "/")); + } + + @Test + public void nameOfTheScriptIsSetIntoPath() throws Exception { + + assertThat(script.buildURI(), containsString("/_scripts/" + JAVASCRIPT.pathParameterName + "/" + A_NAME)); + } + + @Test + public void scriptSourceIsValidJsonString() throws Exception { + builder.setSource(groovysnippet); + + script = builder.build(); + + JsonObject jsonPayload = parseAsGson(script.getData(new Gson())); + assertNotNull(jsonPayload.get("script")); + assertEquals(groovysnippet, jsonPayload.get("script").getAsString()); + } + + @Test + public void fileSourceIsValidJsonString() throws Exception { + builder.loadSource(createTempGroovySnippetFile()); + + script = builder.build(); + + JsonObject jsonPayload = parseAsGson(script.getData(new Gson())); + assertNotNull(jsonPayload.get("script")); + assertEquals(groovysnippet, jsonPayload.get("script").getAsString()); + } + + private File createTempGroovySnippetFile() throws IOException { + File file = File.createTempFile("test", ".groovy"); + file.deleteOnExit(); + FileWriter writer = new FileWriter(file); + writer.write(groovysnippet); + writer.close(); + return file; + } + + private JsonObject parseAsGson(String data) { + return new JsonParser().parse(data).getAsJsonObject(); + } } \ No newline at end of file diff --git a/jest-common/src/test/java/io/searchbox/indices/script/DeleteIndexedScriptTest.java b/jest-common/src/test/java/io/searchbox/indices/script/DeleteIndexedScriptTest.java index 46c205fcc..52a2702c1 100644 --- a/jest-common/src/test/java/io/searchbox/indices/script/DeleteIndexedScriptTest.java +++ b/jest-common/src/test/java/io/searchbox/indices/script/DeleteIndexedScriptTest.java @@ -11,33 +11,33 @@ public class DeleteIndexedScriptTest { - private static final String A_NAME = "a_name"; - private DeleteIndexedScript script; + private static final String A_NAME = "a_name"; + private DeleteIndexedScript script; - @Before - public void setUp() throws Exception { - DeleteIndexedScript.Builder builder = new DeleteIndexedScript.Builder(A_NAME).setLanguage(JAVASCRIPT); - script = builder.build(); - } + @Before + public void setUp() throws Exception { + DeleteIndexedScript.Builder builder = new DeleteIndexedScript.Builder(A_NAME).setLanguage(JAVASCRIPT); + script = builder.build(); + } - @Test - public void defaultScriptingLanguageIsGroovy() throws Exception { - DeleteIndexedScript script = new DeleteIndexedScript.Builder(A_NAME).build(); + @Test + public void defaultScriptingLanguageIsGroovy() throws Exception { + DeleteIndexedScript script = new DeleteIndexedScript.Builder(A_NAME).build(); - assertEquals(GROOVY, script.getScriptLanguage()); - assertThat(script.buildURI(), containsString(GROOVY.pathParameterName)); - } + assertEquals(GROOVY, script.getScriptLanguage()); + assertThat(script.buildURI(), containsString(GROOVY.pathParameterName)); + } - @Test - public void scriptingLanguageIsSetIntoPath() throws Exception { + @Test + public void scriptingLanguageIsSetIntoPath() throws Exception { - assertThat(script.buildURI(), containsString("/_scripts/" + JAVASCRIPT.pathParameterName + "/")); - } + assertThat(script.buildURI(), containsString("/_scripts/" + JAVASCRIPT.pathParameterName + "/")); + } - @Test - public void nameOfTheScriptIsSetIntoPath() throws Exception { + @Test + public void nameOfTheScriptIsSetIntoPath() throws Exception { - assertThat(script.buildURI(), containsString("/_scripts/" + JAVASCRIPT.pathParameterName + "/" + A_NAME)); - } + assertThat(script.buildURI(), containsString("/_scripts/" + JAVASCRIPT.pathParameterName + "/" + A_NAME)); + } } \ No newline at end of file From 4bf1e04998546870e13cc9badbc0810fa2338923 Mon Sep 17 00:00:00 2001 From: nitram509 Date: Mon, 29 Jun 2015 21:15:39 +0200 Subject: [PATCH 09/11] added integration tests --- .../CreateIndexedScriptIntegrationTest.java | 27 ++++++++++++ .../DeleteIndexedScriptIntegrationTest.java | 43 +++++++++++++++++++ 2 files changed, 70 insertions(+) create mode 100644 jest/src/test/java/io/searchbox/indices/script/CreateIndexedScriptIntegrationTest.java create mode 100644 jest/src/test/java/io/searchbox/indices/script/DeleteIndexedScriptIntegrationTest.java diff --git a/jest/src/test/java/io/searchbox/indices/script/CreateIndexedScriptIntegrationTest.java b/jest/src/test/java/io/searchbox/indices/script/CreateIndexedScriptIntegrationTest.java new file mode 100644 index 000000000..1d7edcc4c --- /dev/null +++ b/jest/src/test/java/io/searchbox/indices/script/CreateIndexedScriptIntegrationTest.java @@ -0,0 +1,27 @@ +package io.searchbox.indices.script; + +import io.searchbox.client.JestResult; +import io.searchbox.common.AbstractIntegrationTest; +import org.elasticsearch.test.ElasticsearchIntegrationTest; +import org.junit.Test; + +import java.io.IOException; + +import static io.searchbox.indices.script.ScriptLanguage.GROOVY; + +@ElasticsearchIntegrationTest.ClusterScope(scope = ElasticsearchIntegrationTest.Scope.TEST, numDataNodes = 1) +public class CreateIndexedScriptIntegrationTest extends AbstractIntegrationTest { + + @Test + public void create_an_indexed_script_for_Groovy() throws IOException { + CreateIndexedScript createIndexedScript = new CreateIndexedScript.Builder("script-test") + .setLanguage(GROOVY) + .setSource("def aVariable = 1\n" + + "return aVariable") + .build(); + JestResult result = client.execute(createIndexedScript); + assertTrue(result.isSucceeded()); + } + +} + diff --git a/jest/src/test/java/io/searchbox/indices/script/DeleteIndexedScriptIntegrationTest.java b/jest/src/test/java/io/searchbox/indices/script/DeleteIndexedScriptIntegrationTest.java new file mode 100644 index 000000000..9c15bf9c5 --- /dev/null +++ b/jest/src/test/java/io/searchbox/indices/script/DeleteIndexedScriptIntegrationTest.java @@ -0,0 +1,43 @@ +package io.searchbox.indices.script; + +import io.searchbox.client.JestResult; +import io.searchbox.common.AbstractIntegrationTest; +import org.elasticsearch.test.ElasticsearchIntegrationTest; +import org.junit.Before; +import org.junit.Test; + +import java.io.IOException; + +import static io.searchbox.indices.script.ScriptLanguage.GROOVY; + +@ElasticsearchIntegrationTest.ClusterScope(scope = ElasticsearchIntegrationTest.Scope.TEST, numDataNodes = 1) +public class DeleteIndexedScriptIntegrationTest extends AbstractIntegrationTest { + + private static final String A_SCRIPT_NAME = "script-test"; + + @Override + @Before + public void setUp() throws Exception { + super.setUp(); + createIndexedScript(); + } + + @Test + public void delete_an_indexed_script_for_Groovy() throws IOException { + DeleteIndexedScript deleteIndexedScript = new DeleteIndexedScript.Builder(A_SCRIPT_NAME) + .setLanguage(ScriptLanguage.GROOVY) + .build(); + JestResult result = client.execute(deleteIndexedScript); + assertTrue(result.isSucceeded()); + } + + private void createIndexedScript() throws IOException { + client.execute(new CreateIndexedScript.Builder(A_SCRIPT_NAME) + .setLanguage(GROOVY) + .setSource("def aVariable = 1\n" + + "return aVariable") + .build()); + } + +} + From 32f770f40adb10eea1672d43d3927ba5b9c5248b Mon Sep 17 00:00:00 2001 From: nitram509 Date: Mon, 29 Jun 2015 22:33:53 +0200 Subject: [PATCH 10/11] removed fest-assertion deps --- pom.xml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/pom.xml b/pom.xml index 04bb11b8a..b02a7b450 100755 --- a/pom.xml +++ b/pom.xml @@ -89,7 +89,6 @@ 3.4 2.4 4.12 - 1.4 2.18.1 @@ -256,12 +255,6 @@ ${junit.version} test - - org.easytesting - fest-assert - ${fest-assert.version} - test - commons-io From a8ca7145edc47f79103839ef3cc8b24278202436 Mon Sep 17 00:00:00 2001 From: nitram509 Date: Mon, 29 Jun 2015 22:34:33 +0200 Subject: [PATCH 11/11] alphabetical ordering --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5c5c06a22..d2370004d 100644 --- a/README.md +++ b/README.md @@ -68,6 +68,7 @@ We also would like to thank the following people for their significant contribut * [Igor Kupczyński](https://github.com/puszczyk) * [Kristoffer Renholm](https://github.com/renholm) * [Mark Woon](https://github.com/markwoon) +* [Martin W. Kirst](https://github.com/nitram509) * [Matthew Bogner](https://github.com/matthewbogner) * [Min Cha](https://github.com/MinCha) * [Neil Gentleman](https://github.com/nigelzor) @@ -76,7 +77,6 @@ We also would like to thank the following people for their significant contribut * [Steven Rapp](https://github.com/srapp) * [Stig Brautaset](https://github.com/stig) * [Thomas Mühlfriedel](https://github.com/tomsen-san) -* [Martin W. Kirst](https://github.com/nitram509) Copyright and License