mmiklavc commented on a change in pull request #1554: METRON-2307: Migrate to 
JUnit5
URL: https://github.com/apache/metron/pull/1554#discussion_r346599789
 
 

 ##########
 File path: 
metron-analytics/metron-statistics/src/test/java/org/apache/metron/statistics/OnlineStatisticsProviderTest.java
 ##########
 @@ -96,19 +98,22 @@ private void validateEquality(Iterable<Double> values) {
     validateStatisticsProvider(aggregatedProvider, summaryStats, stats);
   }
 
-  @Test(expected = IllegalStateException.class)
+  @Test
   public void testOverflow() {
     OnlineStatisticsProvider statsProvider = new OnlineStatisticsProvider();
-    statsProvider.addValue(Double.MAX_VALUE + 1);
+    assertThrows(IllegalStateException.class, () -> 
statsProvider.addValue(Double.MAX_VALUE + 1));
   }
 
-  @Test(expected = IllegalStateException.class)
+  @Test
   public void testUnderflow() {
     OnlineStatisticsProvider statsProvider = new OnlineStatisticsProvider();
     double d = 3e-305;
-    for(int i = 0;i < 5;++i,d/=100000) {
-      statsProvider.addValue(d);
-    }
+//    for(int i = 0;i < 5;++i,d/=100000) {
+    assertThrows(IllegalStateException.class, () -> statsProvider.addValue(d));
+//    }
+//    for(int i = 0;i < 5;++i,d/=100000) {
 
 Review comment:
   Looks like we changed the test semantics a bit here. Are we sure those loops 
should be removed? If so, can we remove the commented out code?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to