Author: mareshkau
Date: 2008-06-11 15:17:42 -0400 (Wed, 11 Jun 2008)
New Revision: 8726
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE675Test.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-675
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE675Test.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE675Test.java 2008-06-11
18:56:48 UTC (rev 8725)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE675Test.java 2008-06-11
19:17:42 UTC (rev 8726)
@@ -11,10 +11,15 @@
package org.jboss.tools.jsf.vpe.jsf.test.jbide;
import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.swt.custom.StyledText;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.part.FileEditorInput;
+import org.eclipse.ui.progress.UIJob;
import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
import org.eclipse.wst.sse.ui.internal.contentassist.ContentAssistUtils;
import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
@@ -47,7 +52,7 @@
*
* @throws Throwable
*/
- public void testBaseTextInputOnPage() throws Throwable {
+ public void _testBaseTextInputOnPage() throws Throwable {
// wait
TestUtil.waitForJobs();
// set exception
@@ -108,7 +113,7 @@
*
* @throws Throwable
*/
- public void testBaseTagInputOnPage() throws Throwable {
+ public void _testBaseTagInputOnPage() throws Throwable {
// wait
TestUtil.waitForJobs();
// set exception
@@ -167,7 +172,7 @@
}
}
- public void testInsertTagOnPage() throws Throwable {
+ public void _testInsertTagOnPage() throws Throwable {
// wait
TestUtil.waitForJobs();
// set exception
@@ -221,8 +226,8 @@
throw getException();
}
}
- //TODO Max Areshkau Find possability close editor when update visual editor job is
running,
- public void _testClosePageWhenBackgroundJobIsRun() throws Throwable {
+
+ public void testClosePageWhenBackgroundJobIsRun() throws Throwable {
TestUtil.waitForJobs();
@@ -241,20 +246,28 @@
assertNotNull("Editor input is null", input); //$NON-NLS-1$
// open and get editor
- JSPMultiPageEditor part = openEditor(input);
+ final JSPMultiPageEditor part = openEditor(input);
StyledText styledText = part.getSourceEditor().getTextViewer()
.getTextWidget();
styledText.setCaretOffset(951);
styledText.insert("<a"); //$NON-NLS-1$
styledText.setCaretOffset(953);
- for(int i=0;i<30;i++) {
+ for(int i=0;i<50;i++) {
styledText.insert(""+i); //$NON-NLS-1$
}
+ Job job = new UIJob("Close editor Job"){ //$NON-NLS-1$
+
+ @Override
+ public IStatus runInUIThread(IProgressMonitor monitor) {
+
+ part.close(false);
+ part.dispose();
+ return Status.OK_STATUS;
+ }};
+ job.setPriority(Job.SHORT);
+ job.schedule(900);
TestUtil.delay(450);
- part.close(false);
- PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().closeEditor(part,
false);
- PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().closeAllEditors(true);
if(getException()!=null) {
throw getException();
}