You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ah...@apache.org on 2020/06/29 14:12:53 UTC

[commons-statistics] 02/02: Fix SonarCloud: Assertion should contain the error message.

This is an automated email from the ASF dual-hosted git repository.

aherbert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-statistics.git

commit fb40553df59940377a2193e20b7a4cebbfb27e83
Author: aherbert <ah...@apache.org>
AuthorDate: Mon Jun 29 14:26:36 2020 +0100

    Fix SonarCloud: Assertion should contain the error message.
---
 .../commons/statistics/distribution/FDistributionTest.java  | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/FDistributionTest.java b/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/FDistributionTest.java
index 0c9921d..a708e00 100644
--- a/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/FDistributionTest.java
+++ b/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/FDistributionTest.java
@@ -137,14 +137,9 @@ public class FDistributionTest extends ContinuousDistributionAbstractTest {
     @Test
     public void testMath785() {
         // this test was failing due to inaccurate results from ContinuedFraction.
-
-        try {
-            final double prob = 0.01;
-            final FDistribution f = new FDistribution(200000, 200000);
-            final double result = f.inverseCumulativeProbability(prob);
-            Assertions.assertTrue(result < 1.0);
-        } catch (final AssertionError ex) {
-            Assertions.fail("Failing to calculate inverse cumulative probability");
-        }
+        final double prob = 0.01;
+        final FDistribution f = new FDistribution(200000, 200000);
+        final double result = f.inverseCumulativeProbability(prob);
+        Assertions.assertTrue(result < 1.0, "Failing to calculate inverse cumulative probability");
     }
 }