Author: scabanovich
Date: 2011-12-22 20:37:19 -0500 (Thu, 22 Dec 2011)
New Revision: 37545
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/jsp/ca/test/CAForUnclosedELTest.java
Log:
JBIDE-10565
https://issues.jboss.org/browse/JBIDE-10565
Test added.
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/jsp/ca/test/CAForUnclosedELTest.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/jsp/ca/test/CAForUnclosedELTest.java 2011-12-23
00:30:52 UTC (rev 37544)
+++
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/jsp/ca/test/CAForUnclosedELTest.java 2011-12-23
01:37:19 UTC (rev 37545)
@@ -1,5 +1,12 @@
package org.jboss.tools.jsf.jsp.ca.test;
+import java.util.List;
+
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.FindReplaceDocumentAdapter;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.jboss.tools.common.base.test.contentassist.CATestUtil;
import org.jboss.tools.jst.jsp.test.ca.ContentAssistantTestCase;
import org.jboss.tools.test.util.TestProjectProvider;
@@ -28,4 +35,16 @@
checkProposals(PAGE_NAME, "<ui:define name=\"pageTitle#{ \"",
30, proposals, false);
checkProposals(PAGE_NAME, "<ui:define name=\"pageHeader\">Greeting
Page#{ </ui:define>", 46, proposals, false);
}
+
+ public void testCAInELStartToken() throws BadLocationException {
+ openEditor(PAGE_NAME);
+
+ IRegion reg = new FindReplaceDocumentAdapter(document).find(0, "<ui:define
name=\"pageTitle#{ \"", true, true, false, false);
+ List<ICompletionProposal> res = CATestUtil.collectProposals(contentAssistant,
viewer, reg.getOffset() + 27);
+ boolean found = compareProposal("person", null, res.toArray(new
ICompletionProposal[0]));
+ assertFalse(found);
+ res = CATestUtil.collectProposals(contentAssistant, viewer, reg.getOffset() + 28);
+ found = compareProposal("person", null, res.toArray(new
ICompletionProposal[0]));
+ assertTrue(found);
+ }
}
\ No newline at end of file