Author: dgolovin
Date: 2011-01-11 19:53:44 -0500 (Tue, 11 Jan 2011)
New Revision: 28106
Modified:
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/SeamProjectNewWizardTest.java
Log:
https://issues.jboss.org/browse/JBIDE-7745 Seam/JSF UI test fails on b2
replaced dealy(2000) calls with empty runAndDispach() cycle to clean up deffered events.
It lets avoid "widget disposed" errors
Modified:
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/SeamProjectNewWizardTest.java
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/SeamProjectNewWizardTest.java 2011-01-11
23:35:34 UTC (rev 28105)
+++
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/SeamProjectNewWizardTest.java 2011-01-12
00:53:44 UTC (rev 28106)
@@ -75,9 +75,15 @@
dialog.create();
dialog.setBlockOnOpen(false);
dialog.open();
- JobUtils.delay(2000);
+ // this is necessary to fix
https://jira.jboss.org/jira/browse/JBIDE-4824
+ // wait until all defferedEvents are processed
+ cleanDefferedEvents();
}
+ private void cleanDefferedEvents() {
+ while (Display.getCurrent().readAndDispatch());
+ }
+
/**
*
*/
@@ -102,7 +108,7 @@
try {
// Disable Library Configuration
disableLibraryConfiguration();
- JobUtils.delay(1000);
+ cleanDefferedEvents();
boolean canFinish = wizard.canFinish();
assertFalse("Finish button is enabled at first wizard page before all requerd
fileds are valid.", canFinish);
@@ -121,11 +127,11 @@
try {
// Disable Library Configuration
disableLibraryConfiguration();
- JobUtils.delay(2000);
+ cleanDefferedEvents();
// Set project name
wizard.getDataModel().setProperty(IFacetDataModelProperties.FACET_PROJECT_NAME,
"testSeamProject");
- JobUtils.delay(2000);
+ cleanDefferedEvents();
assertTrue("Finish button is disabled at first wizard page in spite of created
JBoss AS Runtime, Server, DB Connection and Seam Runtime and valid project name.",
wizard.canFinish());
} finally {