Author: scabanovich
Date: 2012-07-19 13:12:16 -0400 (Thu, 19 Jul 2012)
New Revision: 42654
Added:
trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/JSF2CompositeOpenOn/WebContent/params/c.xhtml
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/JSF2CompositeOpenOn/WebContent/params/a.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/JSF2CompositeOpenOn/WebContent/params/b.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/src/org/jboss/tools/jsf/text/ext/test/JSPELHyperlinkUIParamTest.java
Log:
JBIDE-12295
https://issues.jboss.org/browse/JBIDE-12295
Test is added.
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/JSF2CompositeOpenOn/WebContent/params/a.xhtml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/JSF2CompositeOpenOn/WebContent/params/a.xhtml 2012-07-19
16:29:09 UTC (rev 42653)
+++
trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/JSF2CompositeOpenOn/WebContent/params/a.xhtml 2012-07-19
17:12:16 UTC (rev 42654)
@@ -7,6 +7,7 @@
<ui:composition template="/params/b.xhtml">
<ui:param name="myparam1" value="#{person}" />
<ui:param name="myparam2" value="abc" />
+ <ui:param name="myparam3" value="#{person}" />
</ui:composition>
</html>
\ No newline at end of file
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/JSF2CompositeOpenOn/WebContent/params/b.xhtml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/JSF2CompositeOpenOn/WebContent/params/b.xhtml 2012-07-19
16:29:09 UTC (rev 42653)
+++
trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/JSF2CompositeOpenOn/WebContent/params/b.xhtml 2012-07-19
17:12:16 UTC (rev 42654)
@@ -6,5 +6,6 @@
<body>
#{myparam1}
#{myparam2}
+ #{myparam3}
</body>
</html>
\ No newline at end of file
Added:
trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/JSF2CompositeOpenOn/WebContent/params/c.xhtml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/JSF2CompositeOpenOn/WebContent/params/c.xhtml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/JSF2CompositeOpenOn/WebContent/params/c.xhtml 2012-07-19
17:12:16 UTC (rev 42654)
@@ -0,0 +1,11 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core">
+
+ <ui:composition template="/params/b.xhtml">
+ <ui:param name="myparam3" value="#{person}" />
+ </ui:composition>
+
+</html>
\ No newline at end of file
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/src/org/jboss/tools/jsf/text/ext/test/JSPELHyperlinkUIParamTest.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/src/org/jboss/tools/jsf/text/ext/test/JSPELHyperlinkUIParamTest.java 2012-07-19
16:29:09 UTC (rev 42653)
+++
trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/src/org/jboss/tools/jsf/text/ext/test/JSPELHyperlinkUIParamTest.java 2012-07-19
17:12:16 UTC (rev 42654)
@@ -10,6 +10,9 @@
******************************************************************************/
package org.jboss.tools.jsf.text.ext.test;
+import java.util.ArrayList;
+import java.util.List;
+
import junit.framework.TestCase;
import org.eclipse.core.resources.IProject;
@@ -26,7 +29,9 @@
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
+import org.jboss.tools.jst.text.ext.hyperlink.ELHyperlink;
import org.jboss.tools.jst.text.ext.hyperlink.ELHyperlinkDetector;
+import org.jboss.tools.jst.text.ext.hyperlink.ELVarListHyperlink;
import org.jboss.tools.jst.web.kb.PageContextFactory;
import org.jboss.tools.test.util.WorkbenchUtils;
@@ -58,24 +63,32 @@
public void testELHyperlinkUIParam() throws PartInitException, BadLocationException {
//Activate page, include model is lazy.
PageContextFactory.createPageContext(project.getFile(new
Path("/WebContent/params/a.xhtml")));
+ PageContextFactory.createPageContext(project.getFile(new
Path("/WebContent/params/c.xhtml")));
String pageName = PROJECT_NAME+"/WebContent/params/b.xhtml";
String textToFind = "myparam1";
String[] resultEditor = new String[]{"a.xhtml", "Person.java"};
try {
- doELHyperlinkUIParam(pageName, textToFind, resultEditor);
+ doELHyperlinkUIParam(pageName, textToFind, false, resultEditor);
} finally {
WorkbenchUtils.closeAllEditors();
}
textToFind = "myparam2";
resultEditor = new String[]{"a.xhtml", "String.java"};
try {
- doELHyperlinkUIParam(pageName, textToFind, resultEditor);
+ doELHyperlinkUIParam(pageName, textToFind, false, resultEditor);
} finally {
WorkbenchUtils.closeAllEditors();
}
+ textToFind = "myparam3";
+ resultEditor = new String[]{"a.xhtml", "c.xhtml",
"Person.java"};
+ try {
+ doELHyperlinkUIParam(pageName, textToFind, true, resultEditor);
+ } finally {
+ WorkbenchUtils.closeAllEditors();
+ }
}
- private void doELHyperlinkUIParam(String pageName, String template, String...
editorName) throws BadLocationException {
+ private void doELHyperlinkUIParam(String pageName, String template, boolean hasList,
String... editorName) throws BadLocationException {
IEditorPart editor = WorkbenchUtils.openEditor(pageName);
assertTrue(editor instanceof JSPMultiPageEditor);
JSPMultiPageEditor jspMultyPageEditor = (JSPMultiPageEditor) editor;
@@ -92,6 +105,22 @@
assertTrue("Hyperlinks for EL: #{" + template + "} are not
found",links.length!=0);
+ if(hasList) {
+ boolean found = false;
+ List<IHyperlink> list = new ArrayList<IHyperlink>();
+ for(int i = 0; i < links.length; i++){
+ if(links[i] instanceof ELVarListHyperlink) {
+ found = true;
+ ELHyperlink[] ls = ((ELVarListHyperlink)links[i]).getHyperlinks();
+ for (ELHyperlink l: ls) list.add(l);
+ } else {
+ list.add(links[i]);
+ }
+ }
+ assertTrue(found);
+ links = list.toArray(new IHyperlink[0]);
+ }
+
for(int i = 0; i < links.length; i++){
IHyperlink link = links[i];
assertNotNull(link.toString());