Author: dgolovin
Date: 2008-01-31 19:02:51 -0500 (Thu, 31 Jan 2008)
New Revision: 6082
Modified:
trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/test/util/ProjectImportTestSetup.java
trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/test/util/xpl/DisplayHelper.java
trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/test/util/xpl/EditorTestHelper.java
Log:
Switch SeamValidatorTestSetup to utility class ProjectImportTestSetup
Modified:
trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/test/util/ProjectImportTestSetup.java
===================================================================
---
trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/test/util/ProjectImportTestSetup.java 2008-02-01
00:02:48 UTC (rev 6081)
+++
trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/test/util/ProjectImportTestSetup.java 2008-02-01
00:02:51 UTC (rev 6082)
@@ -10,6 +10,9 @@
******************************************************************************/
package org.jboss.tools.test.util;
+import org.eclipse.core.resources.IProject;
+import org.jboss.tools.test.util.xpl.EditorTestHelper;
+
import junit.extensions.TestSetup;
import junit.framework.Test;
@@ -34,14 +37,23 @@
this.projectName = projectName;
}
+ public IProject importProject() throws Exception {
+ IProject importedPrj = null;
+ EditorTestHelper.joinBackgroundActivities();
+ importedPrj = (IProject)ResourcesUtils.importProject(bundleName, projectPath);
+ EditorTestHelper.joinBackgroundActivities();
+ return importedPrj;
+ }
+
@Override
protected void setUp() throws Exception {
- ResourcesUtils.importProject(bundleName, projectPath);
+ importProject();
}
@Override
protected void tearDown() throws Exception {
ResourcesUtils.deleteProject(projectName);
+ EditorTestHelper.joinBackgroundActivities();
}
Modified:
trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/test/util/xpl/DisplayHelper.java
===================================================================
---
trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/test/util/xpl/DisplayHelper.java 2008-02-01
00:02:48 UTC (rev 6081)
+++
trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/test/util/xpl/DisplayHelper.java 2008-02-01
00:02:51 UTC (rev 6082)
@@ -54,10 +54,10 @@
if (timeout < 0)
return false;
-
+ long finalTimeout = calculateFinalTimeout(timeout);
// if driving the event loop once makes the condition hold, succeed
// without spawning a thread.
- driveEventQueue(display);
+ driveEventQueue(display,finalTimeout);
if (condition())
return true;
@@ -68,11 +68,12 @@
// repeatedly sleep until condition becomes true or timeout elapses
DisplayWaiter waiter= new DisplayWaiter(display);
DisplayWaiter.Timeout timeoutState= waiter.start(timeout);
+ finalTimeout = calculateFinalTimeout(timeout);
boolean condition;
try {
do {
if (display.sleep())
- driveEventQueue(display);
+ driveEventQueue(display,finalTimeout);
condition= condition();
} while (!condition && !timeoutState.hasTimedOut());
} finally {
Modified:
trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/test/util/xpl/EditorTestHelper.java
===================================================================
---
trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/test/util/xpl/EditorTestHelper.java 2008-02-01
00:02:48 UTC (rev 6081)
+++
trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/test/util/xpl/EditorTestHelper.java 2008-02-01
00:02:51 UTC (rev 6082)
@@ -172,7 +172,7 @@
}
}
// Join jobs
- joinJobs(0, 10000, 500);
+ joinJobs(500, 10000, 500);
Logger.global.exiting("EditorTestHelper",
"joinBackgroundActivities"); //$NON-NLS-1$ //$NON-NLS-2$
}
Show replies by date