You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Henri Biestro (Jira)" <ji...@apache.org> on 2021/06/07 13:15:07 UTC

[jira] [Closed] (JEXL-282) Pragmas with antish names are broken

     [ https://issues.apache.org/jira/browse/JEXL-282?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Henri Biestro closed JEXL-282.
------------------------------

> Pragmas with antish names are broken
> ------------------------------------
>
>                 Key: JEXL-282
>                 URL: https://issues.apache.org/jira/browse/JEXL-282
>             Project: Commons JEXL
>          Issue Type: Bug
>    Affects Versions: 3.1
>            Reporter: Dmitri Blinov
>            Assignee: Henri Biestro
>            Priority: Major
>             Fix For: 3.2
>
>
> The test cases in {{PragmaTest.java}} are now silently swallowing parsing exceptions of tests with antish pragma names. In fact we should report a test error if there is any exception caught during test run.
> {code:java}
>     @Test
>     public void testPragmas() throws Exception {
>         JexlContext jc = new MapContext();
>         try {
>             JexlScript script = JEXL.createScript("#pragma one 1\n#pragma the.very.hard 'truth'\n2;");
>             Assert.assertTrue(script != null);
>             Map<String, Object> pragmas = script.getPragmas();
>             Assert.assertEquals(2, pragmas.size());
>             Assert.assertEquals(1, pragmas.get("one"));
>             Assert.assertEquals("truth", pragmas.get("the.very.hard"));
>         } catch (JexlException xjexl) {
>             String s = xjexl.toString();
>             /* We need to add this to the test */ 
>             Assert.fail("Should not fail with: " + s);
>         }
>     }
> {code}
> As for the problem itself, now a jexl script will not parse correctly with pragmas specifying antish name, like the example specified in the documentation:
> {code}
> #pragma execution.option 42
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)