diff --git a/elasticsearch/qa/messy-test-watcher-with-groovy/src/test/java/org/elasticsearch/messy/tests/ScriptConditionTests.java b/elasticsearch/qa/messy-test-watcher-with-groovy/src/test/java/org/elasticsearch/messy/tests/ScriptConditionTests.java index 21461900cc5..500d35e70da 100644 --- a/elasticsearch/qa/messy-test-watcher-with-groovy/src/test/java/org/elasticsearch/messy/tests/ScriptConditionTests.java +++ b/elasticsearch/qa/messy-test-watcher-with-groovy/src/test/java/org/elasticsearch/messy/tests/ScriptConditionTests.java @@ -13,7 +13,7 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.script.ScriptException; +import org.elasticsearch.script.GeneralScriptException; import org.elasticsearch.script.ScriptService.ScriptType; import org.elasticsearch.search.internal.InternalSearchResponse; import org.elasticsearch.test.ESTestCase; @@ -138,7 +138,7 @@ public class ScriptConditionTests extends ESTestCase { try { conditionParser.createExecutable(scriptCondition); fail("expected a condition validation exception trying to create an executable with a bad or missing script"); - } catch (ScriptException e) { + } catch (GeneralScriptException e) { // TODO add these when the test if fixed // assertThat(e.getMessage(), is("ASDF")); } @@ -155,7 +155,7 @@ public class ScriptConditionTests extends ESTestCase { try { conditionParser.createExecutable(scriptCondition); fail("expected a condition validation exception trying to create an executable with an invalid language"); - } catch (ScriptException e) { + } catch (GeneralScriptException e) { // TODO add these when the test if fixed // assertThat(e.getMessage(), is("ASDF")); } diff --git a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/support/Exceptions.java b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/support/Exceptions.java index bb682fa7d30..6ec41119413 100644 --- a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/support/Exceptions.java +++ b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/support/Exceptions.java @@ -6,7 +6,7 @@ package org.elasticsearch.xpack.watcher.support; import org.elasticsearch.common.settings.SettingsException; -import org.elasticsearch.script.ScriptException; +import org.elasticsearch.script.GeneralScriptException; import java.io.IOException; @@ -45,9 +45,9 @@ public class Exceptions { } - //todo remove once ScriptException supports varargs - public static ScriptException invalidScript(String msg, Object... args) { - throw new ScriptException(format(msg, args)); + //todo remove once GeneralScriptException supports varargs + public static GeneralScriptException invalidScript(String msg, Object... args) { + throw new GeneralScriptException(format(msg, args)); } //todo remove once SettingsException supports varargs diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/condition/script/ScriptConditionTests.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/condition/script/ScriptConditionTests.java index 4c2afee6146..c24b79efd5e 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/condition/script/ScriptConditionTests.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/condition/script/ScriptConditionTests.java @@ -14,7 +14,7 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.script.ScriptException; +import org.elasticsearch.script.GeneralScriptException; import org.elasticsearch.script.ScriptService.ScriptType; import org.elasticsearch.search.internal.InternalSearchResponse; import org.elasticsearch.test.ESTestCase; @@ -138,7 +138,7 @@ public class ScriptConditionTests extends ESTestCase { try { conditionParser.createExecutable(scriptCondition); fail("expected a condition validation exception trying to create an executable with a bad or missing script"); - } catch (ScriptException e) { + } catch (GeneralScriptException e) { // TODO add these when the test if fixed // assertThat(e.getMessage(), is("ASDF")); } @@ -155,7 +155,7 @@ public class ScriptConditionTests extends ESTestCase { try { conditionParser.createExecutable(scriptCondition); fail("expected a condition validation exception trying to create an executable with an invalid language"); - } catch (ScriptException e) { + } catch (GeneralScriptException e) { // TODO add these when the test if fixed // assertThat(e.getMessage(), is("ASDF")); } diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/transform/script/ScriptTransformTests.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/transform/script/ScriptTransformTests.java index 44ea56315e8..910ee7a8341 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/transform/script/ScriptTransformTests.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/transform/script/ScriptTransformTests.java @@ -12,7 +12,7 @@ import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.json.JsonXContent; import org.elasticsearch.script.CompiledScript; import org.elasticsearch.script.ExecutableScript; -import org.elasticsearch.script.ScriptException; +import org.elasticsearch.script.GeneralScriptException; import org.elasticsearch.script.ScriptService.ScriptType; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.threadpool.ThreadPool; @@ -195,7 +195,7 @@ public class ScriptTransformTests extends ESTestCase { try { transformFactory.createExecutable(scriptTransform); fail("expected a transform validation exception trying to create an executable with a bad or missing script"); - } catch (ScriptException e) { + } catch (GeneralScriptException e) { // I don't think this is what this test intended to check! assertThat(e.getMessage(), containsString("script_lang not supported [groovy]")); } @@ -218,7 +218,7 @@ public class ScriptTransformTests extends ESTestCase { try { transformFactory.createExecutable(scriptCondition); fail("expected a transform validation exception trying to create an executable with an invalid language"); - } catch (ScriptException e) { + } catch (GeneralScriptException e) { assertThat(e.getMessage(), containsString("script_lang not supported [not_a_valid_lang]")); } }