You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by se...@apache.org on 2011/11/10 16:01:32 UTC

svn commit: r1200359 - /commons/proper/math/trunk/src/test/java/org/apache/commons/math/stat/regression/SimpleRegressionTest.java

Author: sebb
Date: Thu Nov 10 15:01:32 2011
New Revision: 1200359

URL: http://svn.apache.org/viewvc?rev=1200359&view=rev
Log:
Use asserNotNull(var) instead of assertTrue(var != null) and avoid subsequent NPE warnings

Modified:
    commons/proper/math/trunk/src/test/java/org/apache/commons/math/stat/regression/SimpleRegressionTest.java

Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math/stat/regression/SimpleRegressionTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/stat/regression/SimpleRegressionTest.java?rev=1200359&r1=1200358&r2=1200359&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/stat/regression/SimpleRegressionTest.java (original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/stat/regression/SimpleRegressionTest.java Thu Nov 10 15:01:32 2011
@@ -122,7 +122,7 @@ public final class SimpleRegressionTest 
 
         //should not be null
         final RegressionResults fullReg = iface.regress( );
-        Assert.assertTrue(fullReg != null);
+        Assert.assertNotNull(fullReg);
         Assert.assertEquals("intercept", regression.getIntercept(), fullReg.getParameterEstimate(0), 1.0e-16);
         Assert.assertEquals("intercept std err",regression.getInterceptStdErr(), fullReg.getStdErrorOfEstimate(0),1.0E-16);
         Assert.assertEquals("slope", regression.getSlope(), fullReg.getParameterEstimate(1), 1.0e-16);
@@ -135,7 +135,7 @@ public final class SimpleRegressionTest 
 
 
         final RegressionResults noInt   = iface.regress( new int[]{1} );
-        Assert.assertTrue(noInt != null);
+        Assert.assertNotNull(noInt);
         Assert.assertEquals("slope", regressionNoint.getSlope(), noInt.getParameterEstimate(0), 1.0e-12);
         Assert.assertEquals("slope std err",regressionNoint.getSlopeStdErr(), noInt.getStdErrorOfEstimate(0),1.0E-16);
         Assert.assertEquals("number of observations",regressionNoint.getN(), noInt.getN());
@@ -145,7 +145,7 @@ public final class SimpleRegressionTest 
         Assert.assertEquals("SSE", regressionNoint.getSumSquaredErrors(), noInt.getErrorSumSquares() ,1.0E-16);
 
         final RegressionResults onlyInt = iface.regress( new int[]{0} );
-        Assert.assertTrue( onlyInt != null );
+        Assert.assertNotNull(onlyInt);
         Assert.assertEquals("slope", regressionIntOnly.getSlope(), onlyInt.getParameterEstimate(0), 1.0e-12);
         Assert.assertEquals("slope std err",regressionIntOnly.getSlopeStdErr(), onlyInt.getStdErrorOfEstimate(0),1.0E-12);
         Assert.assertEquals("number of observations",regressionIntOnly.getN(), onlyInt.getN());