Return-Path: Delivered-To: apmail-commons-commits-archive@minotaur.apache.org Received: (qmail 50453 invoked from network); 2 Oct 2010 22:07:18 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 2 Oct 2010 22:07:18 -0000 Received: (qmail 30762 invoked by uid 500); 2 Oct 2010 22:07:18 -0000 Delivered-To: apmail-commons-commits-archive@commons.apache.org Received: (qmail 30681 invoked by uid 500); 2 Oct 2010 22:07:17 -0000 Mailing-List: contact commits-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list commits@commons.apache.org Received: (qmail 30674 invoked by uid 99); 2 Oct 2010 22:07:17 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 02 Oct 2010 22:07:17 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 02 Oct 2010 22:07:16 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 474A12388A2C; Sat, 2 Oct 2010 22:06:56 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1003899 - in /commons/proper/math/branches/MATH_2_X: ./ src/test/java/org/apache/commons/math/analysis/solvers/ src/test/java/org/apache/commons/math/fraction/ src/test/java/org/apache/commons/math/geometry/ src/test/java/org/apache/common... Date: Sat, 02 Oct 2010 22:06:56 -0000 To: commits@commons.apache.org From: luc@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20101002220656.474A12388A2C@eris.apache.org> Author: luc Date: Sat Oct 2 22:06:55 2010 New Revision: 1003899 URL: http://svn.apache.org/viewvc?rev=1003899&view=rev Log: backported :r1003543,1003545,1003569,1003584 from trunk to branch 2.X Add missing fail() calls for expected exceptions Modified: commons/proper/math/branches/MATH_2_X/ (props changed) commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/analysis/solvers/UnivariateRealSolverUtilsTest.java commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/fraction/BigFractionTest.java commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/geometry/RotationTest.java commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/linear/LUDecompositionImplTest.java commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/linear/MatrixUtilsTest.java commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/linear/RealVectorFormatAbstractTest.java commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/ode/ContinuousOutputModelTest.java commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/stat/descriptive/MultivariateSummaryStatisticsTest.java Propchange: commons/proper/math/branches/MATH_2_X/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Sat Oct 2 22:06:55 2010 @@ -1 +1 @@ -/commons/proper/math/trunk:1003346,1003348-1003351,1003526,1003533 +/commons/proper/math/trunk:1003346,1003348-1003351,1003526,1003533,1003543,1003545,1003569,1003584 Modified: commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/analysis/solvers/UnivariateRealSolverUtilsTest.java URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/analysis/solvers/UnivariateRealSolverUtilsTest.java?rev=1003899&r1=1003898&r2=1003899&view=diff ============================================================================== --- commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/analysis/solvers/UnivariateRealSolverUtilsTest.java (original) +++ commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/analysis/solvers/UnivariateRealSolverUtilsTest.java Sat Oct 2 22:06:55 2010 @@ -42,12 +42,14 @@ public class UnivariateRealSolverUtilsTe public void testSolveBadParameters() throws MathException { try { // bad endpoints - UnivariateRealSolverUtils.solve(sin,0.0, 4.0, 4.0); + UnivariateRealSolverUtils.solve(sin, -0.1, 4.0, 4.0); + fail("Expecting IllegalArgumentException"); } catch (IllegalArgumentException ex) { // expected } try { // bad accuracy UnivariateRealSolverUtils.solve(sin, 0.0, 4.0, 0.0); +// fail("Expecting IllegalArgumentException"); // TODO needs rework since convergence behaviour was changed } catch (IllegalArgumentException ex) { // expected } Modified: commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/fraction/BigFractionTest.java URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/fraction/BigFractionTest.java?rev=1003899&r1=1003898&r2=1003899&view=diff ============================================================================== --- commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/fraction/BigFractionTest.java (original) +++ commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/fraction/BigFractionTest.java Sat Oct 2 22:06:55 2010 @@ -66,21 +66,25 @@ public class BigFractionTest extends Tes assertFraction(1055531162664967l, 70368744177664l, new BigFraction(15.0000000000001)); try { new BigFraction(null, BigInteger.ONE); + fail("Expecting NullArgumentException"); } catch (NullArgumentException npe) { // expected } try { new BigFraction(BigInteger.ONE, null); + fail("Expecting NullArgumentException"); } catch (NullArgumentException npe) { // expected } try { new BigFraction(BigInteger.ONE, BigInteger.ZERO); + fail("Expecting ArithmeticException"); } catch (ArithmeticException npe) { // expected } try { new BigFraction(2.0 * Integer.MAX_VALUE, 1.0e-5, 100000); + fail("Expecting FractionConversionException"); } catch (FractionConversionException fce) { // expected } @@ -232,7 +236,7 @@ public class BigFractionTest extends Tes for (double v : new double[] { Double.NaN, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY}) { try { new BigFraction(v); - fail("expected exception"); + fail("Expecting IllegalArgumentException"); } catch (IllegalArgumentException iae) { // expected } Modified: commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/geometry/RotationTest.java URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/geometry/RotationTest.java?rev=1003899&r1=1003898&r2=1003899&view=diff ============================================================================== --- commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/geometry/RotationTest.java (original) +++ commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/geometry/RotationTest.java Sat Oct 2 22:06:55 2010 @@ -164,6 +164,7 @@ public class RotationTest { 0.0, 1.0, 0.0 }, { 1.0, 0.0, 0.0 } }, 1.0e-7); + fail("Expecting NotARotationMatrixException"); } catch (NotARotationMatrixException nrme) { // expected behavior } catch (Exception e) { @@ -176,6 +177,7 @@ public class RotationTest { 0.821760, -0.184320, 0.539200 }, { -0.354816, 0.574912, 0.737280 } }, 1.0e-7); + fail("Expecting NotARotationMatrixException"); } catch (NotARotationMatrixException nrme) { // expected behavior } catch (Exception e) { @@ -188,6 +190,7 @@ public class RotationTest { -0.4, 0.6, 0.7 }, { 0.8, -0.2, 0.5 } }, 1.0e-15); + fail("Expecting NotARotationMatrixException"); } catch (NotARotationMatrixException nrme) { // expected behavior } catch (Exception e) { Modified: commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/linear/LUDecompositionImplTest.java URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/linear/LUDecompositionImplTest.java?rev=1003899&r1=1003898&r2=1003899&view=diff ============================================================================== --- commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/linear/LUDecompositionImplTest.java (original) +++ commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/linear/LUDecompositionImplTest.java Sat Oct 2 22:06:55 2010 @@ -73,6 +73,7 @@ public class LUDecompositionImplTest ext public void testNonSquare() { try { new LUDecompositionImpl(MatrixUtils.createRealMatrix(new double[3][2])); + fail("Expecting InvalidMatrixException"); } catch (InvalidMatrixException ime) { // expected behavior } catch (Exception e) { Modified: commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/linear/MatrixUtilsTest.java URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/linear/MatrixUtilsTest.java?rev=1003899&r1=1003898&r2=1003899&view=diff ============================================================================== --- commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/linear/MatrixUtilsTest.java (original) +++ commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/linear/MatrixUtilsTest.java Sat Oct 2 22:06:55 2010 @@ -285,6 +285,7 @@ public final class MatrixUtilsTest exten checkIdentityMatrix(MatrixUtils.createRealIdentityMatrix(1)); try { MatrixUtils.createRealIdentityMatrix(0); + fail("Expecting IllegalArgumentException"); } catch (IllegalArgumentException ex) { // expected } @@ -311,6 +312,7 @@ public final class MatrixUtilsTest exten checkIdentityFieldMatrix(MatrixUtils.createFieldIdentityMatrix(FractionField.getInstance(), 1)); try { MatrixUtils.createRealIdentityMatrix(0); + fail("Expecting IllegalArgumentException"); } catch (IllegalArgumentException ex) { // expected } @@ -392,6 +394,7 @@ public final class MatrixUtilsTest exten checkIdentityBigMatrix(MatrixUtils.createBigIdentityMatrix(1)); try { MatrixUtils.createRealIdentityMatrix(0); + fail("Expecting IllegalArgumentException"); } catch (IllegalArgumentException ex) { // expected } Modified: commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/linear/RealVectorFormatAbstractTest.java URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/linear/RealVectorFormatAbstractTest.java?rev=1003899&r1=1003898&r2=1003899&view=diff ============================================================================== --- commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/linear/RealVectorFormatAbstractTest.java (original) +++ commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/linear/RealVectorFormatAbstractTest.java Sat Oct 2 22:06:55 2010 @@ -333,6 +333,7 @@ public abstract class RealVectorFormatAb public void testParseNoComponents() { try { realVectorFormat.parseObject("{ }"); + fail("Expecting ParseException"); } catch (ParseException pe) { // expected behavior } catch (Exception e) { Modified: commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/ode/ContinuousOutputModelTest.java URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/ode/ContinuousOutputModelTest.java?rev=1003899&r1=1003898&r2=1003899&view=diff ============================================================================== --- commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/ode/ContinuousOutputModelTest.java (original) +++ commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/ode/ContinuousOutputModelTest.java Sat Oct 2 22:06:55 2010 @@ -160,10 +160,9 @@ public class ContinuousOutputModelTest otherCm.handleStep(buildInterpolator(t0, y0, t1), true); cm.append(otherCm); } catch(IllegalArgumentException iae) { - //expected behavior - return true; + return true; // there was an allowable error } - return false; + return false; // no allowable error } private StepInterpolator buildInterpolator(double t0, double[] y0, double t1) { Modified: commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/stat/descriptive/MultivariateSummaryStatisticsTest.java URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/stat/descriptive/MultivariateSummaryStatisticsTest.java?rev=1003899&r1=1003898&r2=1003899&view=diff ============================================================================== --- commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/stat/descriptive/MultivariateSummaryStatisticsTest.java (original) +++ commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/stat/descriptive/MultivariateSummaryStatisticsTest.java Sat Oct 2 22:06:55 2010 @@ -173,6 +173,7 @@ public class MultivariateSummaryStatisti public void testDimension() { try { createMultivariateSummaryStatistics(2, true).addValue(new double[3]); + fail("Expecting DimensionMismatchException"); } catch (DimensionMismatchException dme) { // expected behavior } catch (Exception e) {