[jbosstools-issues] [JBoss JIRA] (JBIDE-17910) Assign and List directive fixes and tests

Peter Palaga (JIRA) issues at jboss.org
Wed Sep 3 06:35:00 EDT 2014


    [ https://issues.jboss.org/browse/JBIDE-17910?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12998281#comment-12998281 ] 

Peter Palaga commented on JBIDE-17910:
--------------------------------------

Steps to reproduce/verify:

(1.1) Look at {{assign}} directive variants listed in [http://freemarker.org/docs/ref_directive_assign.html]. For each one of them, create one or more FTL templates that use it. 
(1.2) Having activated the {{OutlineContentProvider.fullAstShown}} preference, check visually, if the outline matches the template. There should also be no errors logged when the editor is opened.
(1.3) Repeat (1.1) and (1.2) for the {{list}} directive documented in [http://freemarker.org/docs/ref_directive_list.html]

Basically, I added unit tests that aim at checking the above, see:
* {{org.jboss.ide.eclipse.freemarker.model.test.AssignmentDirectiveTest}} and 
* {{org.jboss.ide.eclipse.freemarker.model.test.ListDirectiveTest}}
and the FTL files they use:
* {{/org.jboss.ide.eclipse.freemarker.test/projects/testEditor/model/assign.txt.ftl}}
* {{/org.jboss.ide.eclipse.freemarker.test/projects/testEditor/model/list.txt.ftl}}

> Assign and List directive fixes and tests
> -----------------------------------------
>
>                 Key: JBIDE-17910
>                 URL: https://issues.jboss.org/browse/JBIDE-17910
>             Project: Tools (JBoss Tools)
>          Issue Type: Task
>          Components: freemarker
>            Reporter: Peter Palaga
>            Assignee: Peter Palaga
>             Fix For: 4.2.0.CR1
>
>
> (1) {{AssignmentDirective.isNestable()}} looks only if the directive ends with {{"/>}} which is simply wrong for {{assign}}, {{local}} and {{global}} directives. [{{assign}} documentation|http://freemarker.org/docs/ref_directive_assign.html] lists several possible variants of the directive. {{AssignmentDirective.isNestable()}} should cover them all and tests need to be added.
> (2) It is clear from the usage of {{ItemSet.getFirstNestableItem(Stack<Item>)}} that it is supposed to return the last (as measured by time) item stored at the stack, not the first one. Therefore, {{getFirstNestableItem()}} needs to use a reverse order when iterating over the stack.
> These two issues should fix the improper tree presented in outline (when rendered with {{OutlineContentProvider.fullAstShown}}.



--
This message was sent by Atlassian JIRA
(v6.3.1#6329)


More information about the jbosstools-issues mailing list