commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From er...@apache.org
Subject [commons-statistics] 01/03: Order of arguments in Junit assertions.
Date Mon, 02 Dec 2019 00:40:33 GMT
This is an automated email from the ASF dual-hosted git repository.

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

commit 95735be6c1d9842b17199544a4ec711b6ff7560e
Author: Gilles Sadowski <gilles@harfang.homelinux.org>
AuthorDate: Mon Dec 2 01:16:48 2019 +0100

    Order of arguments in Junit assertions.
    
    Reported by "sonarcloud.io".
---
 .../statistics/distribution/BinomialDistributionTest.java    | 12 ++++++------
 .../statistics/distribution/NakagamiDistributionTest.java    |  2 +-
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/BinomialDistributionTest.java
b/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/BinomialDistributionTest.java
index b322a21..c87721d 100644
--- a/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/BinomialDistributionTest.java
+++ b/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/BinomialDistributionTest.java
@@ -108,8 +108,8 @@ public class BinomialDistributionTest extends DiscreteDistributionAbstractTest
{
         verifyDensities();
         verifyCumulativeProbabilities();
         verifyInverseCumulativeProbabilities();
-        Assertions.assertEquals(dist.getSupportLowerBound(), 0);
-        Assertions.assertEquals(dist.getSupportUpperBound(), 0);
+        Assertions.assertEquals(0, dist.getSupportLowerBound());
+        Assertions.assertEquals(0, dist.getSupportUpperBound());
     }
 
     /** Test degenerate case p = 1 */
@@ -126,8 +126,8 @@ public class BinomialDistributionTest extends DiscreteDistributionAbstractTest
{
         verifyDensities();
         verifyCumulativeProbabilities();
         verifyInverseCumulativeProbabilities();
-        Assertions.assertEquals(dist.getSupportLowerBound(), 5);
-        Assertions.assertEquals(dist.getSupportUpperBound(), 5);
+        Assertions.assertEquals(5, dist.getSupportLowerBound());
+        Assertions.assertEquals(5, dist.getSupportUpperBound());
     }
 
     /** Test degenerate case n = 0 */
@@ -144,8 +144,8 @@ public class BinomialDistributionTest extends DiscreteDistributionAbstractTest
{
         verifyDensities();
         verifyCumulativeProbabilities();
         verifyInverseCumulativeProbabilities();
-        Assertions.assertEquals(dist.getSupportLowerBound(), 0);
-        Assertions.assertEquals(dist.getSupportUpperBound(), 0);
+        Assertions.assertEquals(0, dist.getSupportLowerBound());
+        Assertions.assertEquals(0, dist.getSupportUpperBound());
     }
 
     @Test
diff --git a/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/NakagamiDistributionTest.java
b/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/NakagamiDistributionTest.java
index c7d010a..50f0cd8 100644
--- a/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/NakagamiDistributionTest.java
+++ b/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/NakagamiDistributionTest.java
@@ -35,7 +35,7 @@ public class NakagamiDistributionTest extends ContinuousDistributionAbstractTest
     @Test
     public void testSupport() {
         NakagamiDistribution d = makeDistribution();
-        Assertions.assertEquals(d.getSupportLowerBound(), 0, Precision.EPSILON);
+        Assertions.assertEquals(0, d.getSupportLowerBound(), Precision.EPSILON);
         Assertions.assertTrue(Double.isInfinite(d.getSupportUpperBound()));
         Assertions.assertTrue(d.isSupportConnected());
     }


Mime
View raw message