This is an automated email from the ASF dual-hosted git repository. henrib pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-jexl.git
The following commit(s) were added to refs/heads/master by this push: new fcf59afc JEXL-406: added test/example of context methods fcf59afc is described below commit fcf59afce4900c895b953867cd4fe7204aca52eb Author: Henri Biestro <hbies...@cloudera.com> AuthorDate: Fri Sep 22 08:27:51 2023 +0200 JEXL-406: added test/example of context methods --- src/test/java/org/apache/commons/jexl3/Issues400Test.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/test/java/org/apache/commons/jexl3/Issues400Test.java b/src/test/java/org/apache/commons/jexl3/Issues400Test.java index 9c366351..8f726bc1 100644 --- a/src/test/java/org/apache/commons/jexl3/Issues400Test.java +++ b/src/test/java/org/apache/commons/jexl3/Issues400Test.java @@ -156,6 +156,7 @@ public class Issues400Test { * Overloads are respected. */ public static class XuContext extends MapContext { + public String join(Iterator<?> iterator, String str) { if (!iterator.hasNext()) { return ""; @@ -168,6 +169,7 @@ public class Issues400Test { } return strb.toString(); } + public String join(Iterable<?> list, String str) { return join(list.iterator(), str); } @@ -195,7 +197,7 @@ public class Issues400Test { "join((1 .. 4), '-')")) { JexlScript script = jexl.createScript(src); Object result = script.execute(context); - Assert.assertEquals("1-2-3-4", result); + Assert.assertEquals(src,"1-2-3-4", result); } String src0 = "x.join('*')"; @@ -206,9 +208,9 @@ public class Issues400Test { Arrays.asList(1, 2, 3, 4), new int[]{1, 2, 3, 4})) { Object result = script0.execute(context, x); - Assert.assertEquals("1*2*3*4", result); + Assert.assertEquals(src0, "1*2*3*4", result); result = script1.execute(context, x); - Assert.assertEquals("1*2*3*4", result); + Assert.assertEquals(src1, "1*2*3*4", result); } } }