openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject svn commit: r1798999 - /openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/events/async/ObserversAsyncTest.java
Date Sat, 17 Jun 2017 09:15:23 GMT
Author: struberg
Date: Sat Jun 17 09:15:23 2017
New Revision: 1798999

URL: http://svn.apache.org/viewvc?rev=1798999&view=rev
Log:
OWB-1188 improve async test

Modified:
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/events/async/ObserversAsyncTest.java

Modified: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/events/async/ObserversAsyncTest.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/events/async/ObserversAsyncTest.java?rev=1798999&r1=1798998&r2=1798999&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/events/async/ObserversAsyncTest.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/events/async/ObserversAsyncTest.java
Sat Jun 17 09:15:23 2017
@@ -23,6 +23,7 @@ import javax.enterprise.inject.spi.After
 import javax.enterprise.inject.spi.Extension;
 import java.util.ArrayList;
 import java.util.Collections;
+import java.util.Comparator;
 import java.util.List;
 import java.util.concurrent.BlockingQueue;
 import java.util.concurrent.CompletableFuture;
@@ -33,6 +34,7 @@ import java.util.concurrent.LinkedBlocki
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicReference;
 import java.util.stream.IntStream;
+import java.util.stream.Stream;
 
 import org.apache.webbeans.test.AbstractUnitTest;
 import org.junit.Assert;
@@ -74,6 +76,13 @@ public class ObserversAsyncTest extends
         Assert.assertNotNull(t);
         Assert.assertTrue(t instanceof CompletionException);
         CompletionException ce = (CompletionException) t;
+
+        if (count != ce.getSuppressed().length)
+        {
+            Stream.of(ce.getSuppressed())
+                .sorted(Comparator.comparing(Throwable::getMessage))
+                .forEach(throwable -> System.out.println(throwable.getMessage()));
+        }
         Assert.assertEquals(count, ce.getSuppressed().length);
 
     }
@@ -161,7 +170,7 @@ public class ObserversAsyncTest extends
                             sleep(500);
                         }
 
-                        final String name = "Observer" + i;
+                        final String name = String.format("%s_%03d", "Observer", i);
                         e.getEvent().visiting(name);
                         throw new IllegalStateException(name);
                     }));



Mime
View raw message