Author: snjeza
Date: 2008-05-07 09:58:16 -0400 (Wed, 07 May 2008)
New Revision: 7994
Modified:
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/HibernateConsoleTest.java
Log:
testing the errors in the hibernate tests
Modified:
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/HibernateConsoleTest.java
===================================================================
---
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/HibernateConsoleTest.java 2008-05-07
13:58:12 UTC (rev 7993)
+++
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/HibernateConsoleTest.java 2008-05-07
13:58:16 UTC (rev 7994)
@@ -20,6 +20,8 @@
public abstract class HibernateConsoleTest extends TestCase {
+ private static final long MAX_IDLE = 5*60*1000L;
+
private SimpleTestProject project;
public HibernateConsoleTest(String name) {
@@ -109,9 +111,19 @@
/**
* Wait until all background tasks are complete.
*/
- public void waitForJobs() {
+ /*public void waitForJobs() {
while (Platform.getJobManager().currentJob() != null)
delay(2000);
+ }*/
+
+ public void waitForJobs() {
+ long start = System.currentTimeMillis();
+ while (!Job.getJobManager().isIdle()) {
+ delay(500);
+ if ( (System.currentTimeMillis()-start) > MAX_IDLE )
+ throw new RuntimeException("A long running task detected");
+ }
+ delay(1000);
}
public boolean noMoreJobs() {
Show replies by date