Author: vrubezhny
Date: 2009-11-28 17:05:23 -0500 (Sat, 28 Nov 2009)
New Revision: 18911
Modified:
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/ContentAssistantTestCase.java
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1807Test.java
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1813Test.java
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/MissingKBBuilderTest.java
Log:
JBIDE-5137: Fix JstJspAllTests
Modified:
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/ContentAssistantTestCase.java
===================================================================
---
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/ContentAssistantTestCase.java 2009-11-28
21:48:44 UTC (rev 18910)
+++
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/ContentAssistantTestCase.java 2009-11-28
22:05:23 UTC (rev 18911)
@@ -15,6 +15,7 @@
import org.eclipse.ui.part.FileEditorInput;
import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
import org.eclipse.wst.sse.ui.internal.StructuredTextViewer;
+import org.jboss.tools.common.text.ext.util.Utils;
import org.jboss.tools.jst.jsp.contentassist.AutoContentAssistantProposal;
import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
import org.jboss.tools.jst.jsp.jspeditor.JSPTextEditor;
@@ -97,7 +98,27 @@
for (int i = 0; i < proposals.length; i++) {
if (proposals[i] instanceof AutoContentAssistantProposal) {
AutoContentAssistantProposal ap = (AutoContentAssistantProposal)proposals[i];
- if (ap.getReplacementString().toLowerCase().equals(proposalName.toLowerCase()))
return true;
+ String replacementString = ap.getReplacementString().toLowerCase();
+ if (replacementString.equalsIgnoreCase(proposalName)) return true;
+
+ // For a tag proposal there will be not only the the tag name but all others
characters like default attributes, tag ending characters and so on
+ String[] replacementStringParts = replacementString.split(" ");
+ if (replacementStringParts != null && replacementStringParts.length > 0)
{
+ if (replacementStringParts[0].equalsIgnoreCase(proposalName)) return true;
+ }
+
+ // for an attribute proposal there will be a pare of attribute-value (i.e.
attrName="attrValue")
+ replacementStringParts = replacementString.split("=");
+ if (replacementStringParts != null && replacementStringParts.length > 0)
{
+ if (replacementStringParts[0].equalsIgnoreCase(proposalName)) return true;
+ }
+
+ // For an attribute value proposal there will be the quote characters
+ replacementString = Utils.trimQuotes(replacementString);
+ if (replacementString.equalsIgnoreCase(proposalName)) return true;
+
+
+
} else {
if(proposals[i].getDisplayString().toLowerCase().equals(proposalName.toLowerCase()))
return true;
}
Modified:
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1807Test.java
===================================================================
---
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1807Test.java 2009-11-28
21:48:44 UTC (rev 18910)
+++
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1807Test.java 2009-11-28
22:05:23 UTC (rev 18911)
@@ -25,9 +25,9 @@
// - The EL-proposals are removed from the test-list.
// - The "/pages" proposal is added as the main case to test
String[] proposals={
- "/pages",
- "/templates",
- "new jsf el expression - create a new attribute value with #{}"
+ "/pages/",
+ "/templates/",
+ "#{}"
};
checkProposals(PAGE_NAME, "<input type=\"image\" src=\"",
25, proposals, true);
Modified:
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1813Test.java
===================================================================
---
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1813Test.java 2009-11-28
21:48:44 UTC (rev 18910)
+++
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1813Test.java 2009-11-28
22:05:23 UTC (rev 18911)
@@ -27,7 +27,7 @@
String[] proposals={
"ltr",
"rtl",
- "new jsf el expression - create a new attribute value with #{}"
+ "#{}"
};
checkProposals(PAGE_NAME, "dir=\"\"", 5, proposals, true);
Modified:
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/MissingKBBuilderTest.java
===================================================================
---
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/MissingKBBuilderTest.java 2009-11-28
21:48:44 UTC (rev 18910)
+++
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/MissingKBBuilderTest.java 2009-11-28
22:05:23 UTC (rev 18911)
@@ -32,7 +32,7 @@
System.out.println("-1->" + (ps == null ? 0 : ps.length));
JobUtils.waitForIdle(2000);
ps = checkProposals(PAGE_NAME, "<f:loadBundle basename=\"\"
var=\"msg\" />", 24, proposals, false);
- System.out.println("-2->" + ps.length);
+ System.out.println("-2->" + (ps == null ? 0 : ps.length));
}
protected ICompletionProposal[] checkProposals(String fileName, String substring, int
offset){
Show replies by date