geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r677825 - /geronimo/server/trunk/plugins/concurrent/geronimo-concurrent-core/src/test/java/org/apache/geronimo/concurrent/harmony/FutureTaskTest.java
Date Fri, 18 Jul 2008 05:17:03 GMT
Author: gawor
Date: Thu Jul 17 22:17:03 2008
New Revision: 677825

URL: http://svn.apache.org/viewvc?rev=677825&view=rev
Log:
add timeouts - should help in debugging the hanging problem

Modified:
    geronimo/server/trunk/plugins/concurrent/geronimo-concurrent-core/src/test/java/org/apache/geronimo/concurrent/harmony/FutureTaskTest.java

Modified: geronimo/server/trunk/plugins/concurrent/geronimo-concurrent-core/src/test/java/org/apache/geronimo/concurrent/harmony/FutureTaskTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/concurrent/geronimo-concurrent-core/src/test/java/org/apache/geronimo/concurrent/harmony/FutureTaskTest.java?rev=677825&r1=677824&r2=677825&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/concurrent/geronimo-concurrent-core/src/test/java/org/apache/geronimo/concurrent/harmony/FutureTaskTest.java
(original)
+++ geronimo/server/trunk/plugins/concurrent/geronimo-concurrent-core/src/test/java/org/apache/geronimo/concurrent/harmony/FutureTaskTest.java
Thu Jul 17 22:17:03 2008
@@ -29,6 +29,8 @@
 import junit.framework.TestCase;
 
 public class FutureTaskTest extends TestCase {
+        
+    private static int TIMEOUT = 60 * 2;
     
     private ExecutorService executor;
     
@@ -55,7 +57,7 @@
         });
         
         try {
-            future.get();
+            future.get(TIMEOUT, TimeUnit.SECONDS);
             fail("Did not throw exception");
         } catch (CancellationException e) {
             // that's what we expect
@@ -147,7 +149,7 @@
         this.executor.execute(thread);
         
         try {
-            future.get();
+            future.get(TIMEOUT, TimeUnit.SECONDS);
             fail("Did not throw exception");
         } catch (SkippedException e) {
             // that's what we expect
@@ -157,7 +159,7 @@
         Thread.sleep(1000 * 2);
         
         try {
-            future.get();
+            future.get(TIMEOUT, TimeUnit.SECONDS);
             fail("Did not throw exception");
         } catch (SkippedException e) {
             // that's what we expect
@@ -185,7 +187,7 @@
          });
         
         try {
-            future.get();
+            future.get(TIMEOUT, TimeUnit.SECONDS);
             fail("Did not throw exception");
         } catch (CancellationException e) {
             // that's what we expect
@@ -203,7 +205,7 @@
         this.executor.execute(thread);
         
         try {
-            future.get();
+            future.get(TIMEOUT, TimeUnit.SECONDS);
             fail("Did not throw exception");
         } catch (SkippedException e) {
             // that's what we expect
@@ -213,7 +215,7 @@
         Thread.sleep(1000 * 2);
         
         try {
-            future.get();
+            future.get(TIMEOUT, TimeUnit.SECONDS);
             fail("Did not throw exception");
         } catch (SkippedException e) {
             // that's what we expect
@@ -234,7 +236,7 @@
         thread.getLatch().countDown();
                 
         try {
-            future.get();
+            future.get(TIMEOUT, TimeUnit.SECONDS);
             fail("Did not throw exception");
         } catch (CancellationException e) {
             // that's what we expect



Mime
View raw message