Author: dgolovin
Date: 2008-11-06 19:59:41 -0500 (Thu, 06 Nov 2008)
New Revision: 11599
Added:
trunk/jst/tests/org.jboss.tools.jst.jsp.test/projects/JsfJbide1704Test/WebContent/WEB-INF/lib/jsf-api.jar
trunk/jst/tests/org.jboss.tools.jst.jsp.test/projects/JsfJbide1704Test/WebContent/WEB-INF/lib/jsf-impl.jar
Removed:
trunk/jst/tests/org.jboss.tools.jst.jsp.test/projects/JsfJbide1704Test/WebContent/WEB-INF/lib/jsf-tlds.jar
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/ca/JsfJspJbide1704Test.java
Log:
fix build hanging for CA tests
Added:
trunk/jst/tests/org.jboss.tools.jst.jsp.test/projects/JsfJbide1704Test/WebContent/WEB-INF/lib/jsf-api.jar
===================================================================
(Binary files differ)
Property changes on:
trunk/jst/tests/org.jboss.tools.jst.jsp.test/projects/JsfJbide1704Test/WebContent/WEB-INF/lib/jsf-api.jar
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added:
trunk/jst/tests/org.jboss.tools.jst.jsp.test/projects/JsfJbide1704Test/WebContent/WEB-INF/lib/jsf-impl.jar
===================================================================
(Binary files differ)
Property changes on:
trunk/jst/tests/org.jboss.tools.jst.jsp.test/projects/JsfJbide1704Test/WebContent/WEB-INF/lib/jsf-impl.jar
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Deleted:
trunk/jst/tests/org.jboss.tools.jst.jsp.test/projects/JsfJbide1704Test/WebContent/WEB-INF/lib/jsf-tlds.jar
===================================================================
(Binary files differ)
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 2008-11-06
21:42:40 UTC (rev 11598)
+++
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/JstJspAllTests.java 2008-11-07
00:59:41 UTC (rev 11599)
@@ -24,11 +24,11 @@
suite.addTestSuite(JstJspJbide1585Test.class);
suite.addTestSuite(StrutsJspJbide1648Test.class);
suite.addTestSuite(JstJspJbide1641Test.class);
- //suite.addTestSuite(JsfJspJbide1704Test.class);
+ suite.addTestSuite(JsfJspJbide1704Test.class);
suite.addTestSuite(JsfJspJbide1717Test.class);
suite.addTestSuite(JstJspJbide1759Test.class);
suite.addTestSuite(Jbide1791Test.class);
- //suite.addTestSuite(JsfJspJbide2437Test.class);
+ suite.addTestSuite(JsfJspJbide2437Test.class);
return suite;
}
Modified:
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1704Test.java
===================================================================
---
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1704Test.java 2008-11-06
21:42:40 UTC (rev 11598)
+++
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1704Test.java 2008-11-07
00:59:41 UTC (rev 11599)
@@ -4,8 +4,12 @@
import junit.framework.TestSuite;
import org.eclipse.core.resources.IResource;
+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.eclipse.jface.text.contentassist.IContentAssistProcessor;
+import org.eclipse.swt.widgets.Display;
import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
@@ -22,10 +26,7 @@
boolean makeCopy = false;
private static final String PROJECT_NAME = "JsfJbide1704Test";
private static final String PAGE_NAME = "/WebContent/pages/greeting";
- private static final String[] PAGE_EXTENSIONS = { ".xhtml", ".jsp"
};
- private static final String PREFIX_TAG_NAME = "f:loadBundle";
-
public static Test suite() {
return new TestSuite(JsfJspJbide1704Test.class);
}
@@ -41,74 +42,38 @@
}
}
- public void testJsfJspJbide1704 () {
- try {
- JobUtils.waitForIdle();
- } catch (Exception e) {
- e.printStackTrace();
- }
-
+ public void testJspJbide1704 () {
assertTrue("Test project \"" + PROJECT_NAME + "\" is not
loaded", (project != null));
-
- for (int i = 0; i < PAGE_EXTENSIONS.length; i++) {
- doTestJsfJspJbide1704(PAGE_NAME + PAGE_EXTENSIONS[i]);
- }
+ doTestJsfJspJbide1704(PAGE_NAME + ".jsp");
}
+ public void testXhtmlJbide1704 () {
+ assertTrue("Test project \"" + PROJECT_NAME + "\" is not
loaded", (project != null));
+ doTestJsfJspJbide1704(PAGE_NAME + ".xhtml");
+ }
+
private void doTestJsfJspJbide1704(String pageName) {
openEditor(pageName);
- IStructuredDocumentRegion[] regions =
((IStructuredDocument)document).getStructuredDocumentRegions();
-
- boolean fLoadBundleTagIsFound = false;
- for (int i = 0; i < regions.length; i++) {
- IStructuredDocumentRegion sdRegion = regions[i];
- ITextRegionList list = sdRegion.getRegions();
-
- // find <f:loadBundle tag first (after this tag the CA is full of JSF- and other
kind of proposals
- if (!fLoadBundleTagIsFound) {
- if (DOMRegionContext.XML_TAG_OPEN == list.get(0).getType() &&
- DOMRegionContext.XML_TAG_NAME == list.get(1).getType() &&
- PREFIX_TAG_NAME.equals(sdRegion.getFullText(list.get(1)).trim())) {
- fLoadBundleTagIsFound = true;
- }
- continue;
- }
+ try {
- //
- if (DOMRegionContext.XML_TAG_OPEN == list.get(0).getType() &&
- DOMRegionContext.XML_TAG_NAME == list.get(1).getType()) {
- // find all the attribute values and their "after closing quotes" offsets
-
- for (int j = 2; j < list.size(); j++) {
- ITextRegion region = list.get(j);
- if (DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE == region.getType()) {
- int length = sdRegion.getFullText(region).trim().length();
- int offsetToTest = sdRegion.getStartOffset(region) + length;
-
- ICompletionProposal[] result= null;
- String errorMessage = null;
+ ICompletionProposal[] result= null;
+ final IRegion reg = new FindReplaceDocumentAdapter(document).find(0,
+ " var=\"msg\"", true, true, false, false);
+ String errorMessage = null;
- IContentAssistProcessor p= TestUtil.getProcessor(viewer, offsetToTest,
contentAssistant);
- if (p != null) {
- try {
- result= p.computeCompletionProposals(viewer, offsetToTest);
- } catch (Throwable x) {
- x.printStackTrace();
- }
- errorMessage= p.getErrorMessage();
- }
-
- for (int k = 0; result != null && k < result.length; k++) {
- // There should not be a proposal of type Red.Proposal in the result
- assertFalse("Content Assistant peturned proposals of type (" +
result[k].getClass().getName() + ").", (result[k] instanceof
AutoContentAssistantProposal));
- }
- }
- }
-
+ final IContentAssistProcessor p= TestUtil.getProcessor(viewer, reg.getOffset(),
contentAssistant);
+ if (p != null) {
+ result= p.computeCompletionProposals(viewer, reg.getOffset());
}
-
+ for (int k = 0; result != null && k < result.length; k++) {
+ // There should not be a proposal of type Red.Proposal in the result
+ assertFalse("Content Assistant peturned proposals of type (" +
result[k].getClass().getName() + ").", (result[k] instanceof
AutoContentAssistantProposal));
+ }
+
+ } catch (BadLocationException e) {
+ fail(e.getMessage());
}
closeEditor();
Show replies by date