Author: snjeza
Date: 2008-10-23 18:13:10 -0400 (Thu, 23 Oct 2008)
New Revision: 11131
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE1479Test.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE788Test.java
Log:
Fixing errors in the org.jboss.tools.jsf.vpe.jsf.test tests
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE1479Test.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE1479Test.java 2008-10-23
22:13:05 UTC (rev 11130)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE1479Test.java 2008-10-23
22:13:10 UTC (rev 11131)
@@ -75,7 +75,7 @@
job.setPriority(Job.SHORT);
job.schedule(0L);
job.join();
- TestUtil.waitForIdle();
+ TestUtil.waitForIdle(15*1000*60);
TestUtil.delay(1000L);
closeEditors();
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE788Test.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE788Test.java 2008-10-23
22:13:05 UTC (rev 11130)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE788Test.java 2008-10-23
22:13:10 UTC (rev 11131)
@@ -259,55 +259,59 @@
assertNotNull("Editor input is null", input); //$NON-NLS-1$
// open and get editor
- JSPMultiPageEditor part = openEditor(input);
-
- int position =
TestUtil.getLinePositionOffcet(part.getSourceEditor().getTextViewer(), lineIndex,
linePosition);
+ ICompletionProposal[] results;
+ try {
+ JSPMultiPageEditor part = openEditor(input);
+
+ int position = TestUtil.getLinePositionOffcet(part.getSourceEditor().getTextViewer(),
lineIndex, linePosition);
- // insert string
- part.getSourceEditor().getTextViewer().getTextWidget()
- .replaceTextRange(position, 0, partOfString);
+ // insert string
+ part.getSourceEditor().getTextViewer().getTextWidget()
+ .replaceTextRange(position, 0, partOfString);
- int newPosition = position + partOfString.length();
+ int newPosition = position + partOfString.length();
- // sets cursor position
- part.getSourceEditor().getTextViewer().getTextWidget().setCaretOffset(
- newPosition);
-
- TestUtil.waitForJobs();
- TestUtil.delay(1000);
- SourceViewerConfiguration sourceViewerConfiguration = ((JSPTextEditor) part
- .getSourceEditor()).getSourceViewerConfigurationForTest();
- // errase errors which can be on start of editor(for example xuklunner
- // not found)
- setException(null);
- StructuredTextViewerConfiguration stvc = (StructuredTextViewerConfiguration)
sourceViewerConfiguration;
- IContentAssistant iContentAssistant = stvc
- .getContentAssistant((ISourceViewer) part.getSourceEditor()
- .getAdapter(ISourceViewer.class));
- assertNotNull(iContentAssistant);
- IContentAssistProcessor iContentAssistProcessor = iContentAssistant
- .getContentAssistProcessor(caName);
- assertNotNull(iContentAssistProcessor);
- ICompletionProposal[] results = iContentAssistProcessor
- .computeCompletionProposals(part.getSourceEditor()
- .getTextViewer(), newPosition);
+ // sets cursor position
+ part.getSourceEditor().getTextViewer().getTextWidget().setCaretOffset(
+ newPosition);
+
+ TestUtil.waitForJobs();
+ TestUtil.delay(1000);
+ SourceViewerConfiguration sourceViewerConfiguration = ((JSPTextEditor) part
+ .getSourceEditor()).getSourceViewerConfigurationForTest();
+ // errase errors which can be on start of editor(for example xuklunner
+ // not found)
+ setException(null);
+ StructuredTextViewerConfiguration stvc = (StructuredTextViewerConfiguration)
sourceViewerConfiguration;
+ IContentAssistant iContentAssistant = stvc
+ .getContentAssistant((ISourceViewer) part.getSourceEditor()
+ .getAdapter(ISourceViewer.class));
+ assertNotNull(iContentAssistant);
+ IContentAssistProcessor iContentAssistProcessor = iContentAssistant
+ .getContentAssistProcessor(caName);
+ assertNotNull(iContentAssistProcessor);
+ results = iContentAssistProcessor
+ .computeCompletionProposals(part.getSourceEditor()
+ .getTextViewer(), newPosition);
- // remove inserted string
- part.getSourceEditor().getTextViewer().getTextWidget()
- .replaceTextRange(position, partOfString.length(), "");
//$NON-NLS-1$
- assertNotNull(results);
- assertTrue("Number of ca proposals shouldn't be a
null",results.length>0); //$NON-NLS-1$
- if (isCheck) {
- for (int i = 0; i < results.length; i++) {
+ // remove inserted string
+ part.getSourceEditor().getTextViewer().getTextWidget()
+ .replaceTextRange(position, partOfString.length(), "");
//$NON-NLS-1$
+ assertNotNull(results);
+ assertTrue("Number of ca proposals shouldn't be a
null",results.length>0); //$NON-NLS-1$
+ if (isCheck) {
+ for (int i = 0; i < results.length; i++) {
- String displayString = ((ICompletionProposal)
results[i]).getDisplayString();
- assertNotNull(displayString);
- assertEquals(true, displayString.startsWith(partOfString));
- }
- }
+ String displayString = ((ICompletionProposal) results[i]).getDisplayString();
+ assertNotNull(displayString);
+ assertEquals(true, displayString.startsWith(partOfString));
+ }
+ }
+ } finally {
+ closeEditors();
+ TestUtil.delay(1000L);
+ }
- closeEditors();
- TestUtil.delay(1000L);
return results;
}
}