Author: yradtsevich
Date: 2010-12-02 08:15:11 -0500 (Thu, 02 Dec 2010)
New Revision: 27090
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.base.test/src/org/jboss/tools/vpe/base/test/VpeTest.java
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/VpeUiTests.java
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/editor/CustomSashFormTest.java
Log:
https://jira.jboss.org/browse/JBIDE-7711 : VpeUiTests blocks tests execution and is
usually killed by timeout.
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.base.test/src/org/jboss/tools/vpe/base/test/VpeTest.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe.base.test/src/org/jboss/tools/vpe/base/test/VpeTest.java 2010-12-02
13:04:52 UTC (rev 27089)
+++
trunk/vpe/plugins/org.jboss.tools.vpe.base.test/src/org/jboss/tools/vpe/base/test/VpeTest.java 2010-12-02
13:15:11 UTC (rev 27090)
@@ -176,6 +176,16 @@
}
}
+
+ /**
+ * Closes given {@code editor}.
+ */
+ protected void closeEditor(IEditorPart editor) {
+ boolean closed = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
+ .getActivePage().closeEditor(editor, false);
+
+ assertTrue(closed);
+ }
/**
* close all opened editors.
Modified:
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/VpeUiTests.java
===================================================================
---
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/VpeUiTests.java 2010-12-02
13:04:52 UTC (rev 27089)
+++
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/VpeUiTests.java 2010-12-02
13:15:11 UTC (rev 27090)
@@ -31,7 +31,7 @@
suite.addTestSuite(VpeCommandsTests.class);
suite.addTestSuite(VpeResourcesDialogTest.class);
suite.addTestSuite(VpeEditorPreferencesPageTest.class);
- //suite.addTestSuite(CustomSashFormTest.class);
+ suite.addTestSuite(CustomSashFormTest.class);
//suite.addTestSuite(VpePopupMenuTest.class);
suite.addTestSuite(VpeEditAnyDialogTest.class);
return new VpeTestSetup(suite);
Modified:
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/editor/CustomSashFormTest.java
===================================================================
---
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/editor/CustomSashFormTest.java 2010-12-02
13:04:52 UTC (rev 27089)
+++
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/editor/CustomSashFormTest.java 2010-12-02
13:15:11 UTC (rev 27090)
@@ -2,8 +2,6 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.internal.WorkbenchPage;
import org.eclipse.ui.part.FileEditorInput;
import org.jboss.tools.jst.jsp.editor.IVisualEditor;
import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
@@ -44,14 +42,14 @@
/*
* Close editor part
*/
-
((WorkbenchPage)PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()).getEditorPresentation().closeEditor(part);
+ closeEditor(part);
TestUtil.waitForJobs();
TestUtil.delay(5000);
input = new FileEditorInput(file1);
part = openEditor(input);
visualEditor = (VpeEditorPart) part.getVisualEditor();
TestUtil.waitForJobs();
-
((WorkbenchPage)PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()).getEditorPresentation().closeEditor(part);
+ closeEditor(part);
/*
* Test it on another file
@@ -75,7 +73,7 @@
/*
* Close part without saving
*/
-
((WorkbenchPage)PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()).getEditorPresentation().closeEditor(part);
+ closeEditor(part);
TestUtil.waitForJobs();
part = openEditor(input);
@@ -83,10 +81,8 @@
* If there are any exceptions it would be thrown.
*/
TestUtil.waitForJobs();
- if(getException()!=null) {
- throw getException();
- }
-
+ if(getException()!=null) {
+ throw new Exception(getException());
+ }
}
-
}