Author: snjeza
Date: 2008-05-02 18:47:22 -0400 (Fri, 02 May 2008)
New Revision: 7952
Modified:
branches/jbosstools-2.1.x/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/HibernateConsoleTest.java
Log:
Checking the errors in the hibernate tests
Modified:
branches/jbosstools-2.1.x/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/HibernateConsoleTest.java
===================================================================
---
branches/jbosstools-2.1.x/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/HibernateConsoleTest.java 2008-05-02
21:12:50 UTC (rev 7951)
+++
branches/jbosstools-2.1.x/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/HibernateConsoleTest.java 2008-05-02
22:47:22 UTC (rev 7952)
@@ -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