From c8bd521ed3de788195680d97fa13896680050014 Mon Sep 17 00:00:00 2001 From: Uwe Schindler Date: Sat, 14 May 2016 12:00:30 +0200 Subject: [PATCH] painless: restore accidentally removed test --- .../org/elasticsearch/painless/WhenThingsGoWrongTests.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/lang-painless/src/test/java/org/elasticsearch/painless/WhenThingsGoWrongTests.java b/modules/lang-painless/src/test/java/org/elasticsearch/painless/WhenThingsGoWrongTests.java index 905766c781c..55ee490bb3f 100644 --- a/modules/lang-painless/src/test/java/org/elasticsearch/painless/WhenThingsGoWrongTests.java +++ b/modules/lang-painless/src/test/java/org/elasticsearch/painless/WhenThingsGoWrongTests.java @@ -175,6 +175,12 @@ public class WhenThingsGoWrongTests extends ScriptTestCase { }); } + public void testDynamicWrongArgs() { + expectThrows(WrongMethodTypeException.class, () -> { + exec("def x = new ArrayList(); return x.get('bogus');"); + }); + } + public void testDynamicArrayWrongIndex() { expectThrows(WrongMethodTypeException.class, () -> { exec("def x = new long[1]; x[0]=1; return x['bogus'];");