Author: scabanovich
Date: 2009-08-20 10:44:56 -0400 (Thu, 20 Aug 2009)
New Revision: 17191
Added:
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/MissingKBBuilderTest.java
Modified:
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/JstJspAllTests.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4768
Modified:
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/JstJspAllTests.java
===================================================================
---
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/JstJspAllTests.java 2009-08-20
14:42:42 UTC (rev 17190)
+++
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/JstJspAllTests.java 2009-08-20
14:44:56 UTC (rev 17191)
@@ -15,6 +15,7 @@
import org.jboss.tools.jst.jsp.test.ca.JstJspJbide1585Test;
import org.jboss.tools.jst.jsp.test.ca.JstJspJbide1641Test;
import org.jboss.tools.jst.jsp.test.ca.JstJspJbide1759Test;
+import org.jboss.tools.jst.jsp.test.ca.MissingKBBuilderTest;
import org.jboss.tools.jst.jsp.test.ca.StrutsJspJbide1648Test;
public class JstJspAllTests {
@@ -22,6 +23,7 @@
public static Test suite() {
TestSuite suite = new TestSuite("Test for org.jboss.tools.jst.jsp.test");
+ suite.addTestSuite(MissingKBBuilderTest.class);
suite.addTestSuite(JsfJspJbide1807Test.class);
suite.addTestSuite(CAForIDTest.class);
suite.addTestSuite(JsfJspJbide1813Test.class);
Added:
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
(rev 0)
+++
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/MissingKBBuilderTest.java 2009-08-20
14:44:56 UTC (rev 17191)
@@ -0,0 +1,61 @@
+package org.jboss.tools.jst.jsp.test.ca;
+
+import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
+import org.jboss.tools.common.test.util.TestProjectProvider;
+import org.jboss.tools.jst.jsp.test.TestUtil;
+import org.jboss.tools.test.util.JobUtils;
+
+public class MissingKBBuilderTest extends ContentAssistantTestCase{
+ TestProjectProvider provider = null;
+ boolean makeCopy = false;
+ private static final String PROJECT_NAME = "MissingKBBuilderTest";
+ private static final String PAGE_NAME = "/WebContent/pages/inputname.xhtml";
+
+ public void setUp() throws Exception {
+ provider = new TestProjectProvider("org.jboss.tools.jst.jsp.test", null,
PROJECT_NAME, makeCopy);
+ project = provider.getProject();
+ }
+
+ protected void tearDown() throws Exception {
+ if(provider != null) {
+ provider.dispose();
+ }
+ }
+
+ public void testCAForIDTest(){
+ String[] proposals = {
+ "resources"
+ };
+
+ ICompletionProposal[] ps = checkProposals(PAGE_NAME, "<f:loadBundle
basename=\"\" var=\"msg\" />", 24);
+ 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);
+ }
+
+ protected ICompletionProposal[] checkProposals(String fileName, String substring, int
offset){
+ openEditor(fileName);
+
+ int position = 0;
+ if (substring != null) {
+ String documentContent = document.get();
+ position = documentContent.indexOf(substring);
+ }
+
+ ICompletionProposal[] result = null;
+
+ IContentAssistProcessor p = TestUtil.getProcessor(viewer, position + offset,
contentAssistant);
+ if (p != null) {
+ try {
+ result = p.computeCompletionProposals(viewer, position + offset);
+ } catch (Throwable x) {
+ x.printStackTrace();
+ }
+ }
+
+ return result;
+ }
+
+}
\ No newline at end of file
Property changes on:
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/MissingKBBuilderTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain