commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Henri Biestro (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (JEXL-282) Pragmas with antish names are broken
Date Tue, 18 Dec 2018 10:16:00 GMT

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

Henri Biestro resolved JEXL-282.
--------------------------------
       Resolution: Fixed
         Assignee: Henri Biestro
    Fix Version/s: 3.2

Fixed grammar and test
revision   : 3b4a48485e691618d79b15c0e18190b06b1e2a7f

> 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
(v7.6.3#76005)

Mime
View raw message