commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From er...@apache.org
Subject svn commit: r1044186 [3/4] - in /commons/proper/math/trunk/src: main/java/org/apache/commons/math/analysis/interpolation/ main/java/org/apache/commons/math/complex/ main/java/org/apache/commons/math/distribution/ main/java/org/apache/commons/math/excep...
Date Fri, 10 Dec 2010 00:50:52 GMT
Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/EigenSolverTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/EigenSolverTest.java?rev=1044186&r1=1044185&r2=1044186&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/EigenSolverTest.java (original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/EigenSolverTest.java Fri Dec 10 00:50:50 2010
@@ -19,10 +19,11 @@ package org.apache.commons.math.linear;
 
 import java.util.Random;
 
+import org.apache.commons.math.util.MathUtils;
 import org.apache.commons.math.exception.SingularMatrixException;
-import junit.framework.TestCase;
+import org.apache.commons.math.exception.MathIllegalArgumentException;
 
-import org.apache.commons.math.util.MathUtils;
+import junit.framework.TestCase;
 
 public class EigenSolverTest extends TestCase {
 
@@ -68,19 +69,19 @@ public class EigenSolverTest extends Tes
         try {
             es.solve(b);
             fail("an exception should have been thrown");
-        } catch (IllegalArgumentException iae) {
+        } catch (MathIllegalArgumentException iae) {
             // expected behavior
         }
         try {
             es.solve(b.getColumn(0));
             fail("an exception should have been thrown");
-        } catch (IllegalArgumentException iae) {
+        } catch (MathIllegalArgumentException iae) {
             // expected behavior
         }
         try {
             es.solve(new ArrayRealVectorTest.RealVectorTestImpl(b.getColumn(0)));
             fail("an exception should have been thrown");
-        } catch (IllegalArgumentException iae) {
+        } catch (MathIllegalArgumentException iae) {
             // expected behavior
         }
     }

Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/FieldMatrixImplTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/FieldMatrixImplTest.java?rev=1044186&r1=1044185&r2=1044186&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/FieldMatrixImplTest.java (original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/FieldMatrixImplTest.java Fri Dec 10 00:50:50 2010
@@ -19,9 +19,11 @@ package org.apache.commons.math.linear;
 import junit.framework.TestCase;
 
 import org.apache.commons.math.TestUtils;
-import org.apache.commons.math.exception.MathUserException;
 import org.apache.commons.math.fraction.Fraction;
 import org.apache.commons.math.fraction.FractionField;
+import org.apache.commons.math.exception.MathUserException;
+import org.apache.commons.math.exception.MathIllegalStateException;
+import org.apache.commons.math.exception.DimensionMismatchException;
 import org.apache.commons.math.exception.MatrixDimensionMismatchException;
 import org.apache.commons.math.exception.NoDataException;
 import org.apache.commons.math.exception.OutOfRangeException;
@@ -29,6 +31,7 @@ import org.apache.commons.math.exception
 import org.apache.commons.math.exception.NotStrictlyPositiveException;
 import org.apache.commons.math.exception.NullArgumentException;
 import org.apache.commons.math.exception.NonSquareMatrixException;
+import org.apache.commons.math.exception.MathIllegalArgumentException;
 
 /**
  * Test cases for the {@link Array2DRowFieldMatrix} class.
@@ -143,8 +146,8 @@ public final class FieldMatrixImplTest e
         Array2DRowFieldMatrix<Fraction> m2 = new Array2DRowFieldMatrix<Fraction>(testData2);
         try {
             m.add(m2);
-            fail("IllegalArgumentException expected");
-        } catch (IllegalArgumentException ex) {
+            fail("MathIllegalArgumentException expected");
+        } catch (MathIllegalArgumentException ex) {
             // ignored
         }
     }
@@ -157,7 +160,7 @@ public final class FieldMatrixImplTest e
         try {
             m.subtract(new Array2DRowFieldMatrix<Fraction>(testData2));
             fail("Expecting illegalArgumentException");
-        } catch (IllegalArgumentException ex) {
+        } catch (MathIllegalArgumentException ex) {
             // ignored
         }
     }
@@ -176,7 +179,7 @@ public final class FieldMatrixImplTest e
         try {
             m.multiply(new Array2DRowFieldMatrix<Fraction>(bigSingular));
             fail("Expecting illegalArgumentException");
-        } catch (IllegalArgumentException ex) {
+        } catch (MathIllegalArgumentException ex) {
             // ignored
         }
     }
@@ -222,7 +225,7 @@ public final class FieldMatrixImplTest e
         try {
             m.operate(testVector);
             fail("Expecting illegalArgumentException");
-        } catch (IllegalArgumentException ex) {
+        } catch (MathIllegalArgumentException ex) {
             // ignored
         }
     }
@@ -259,8 +262,8 @@ public final class FieldMatrixImplTest e
         m = new Array2DRowFieldMatrix<Fraction>(bigSingular);
         try {
             m.preMultiply(testVector);
-            fail("expecting IllegalArgumentException");
-        } catch (IllegalArgumentException ex) {
+            fail("expecting MathIllegalArgumentException");
+        } catch (MathIllegalArgumentException ex) {
             // ignored
         }
     }
@@ -281,7 +284,7 @@ public final class FieldMatrixImplTest e
         try {
             m.preMultiply(new Array2DRowFieldMatrix<Fraction>(bigSingular));
             fail("Expecting illegalArgumentException");
-        } catch (IllegalArgumentException ex) {
+        } catch (MathIllegalArgumentException ex) {
             // ignored
         }
     }
@@ -856,30 +859,30 @@ public final class FieldMatrixImplTest e
         Array2DRowFieldMatrix<Fraction> m2 = new Array2DRowFieldMatrix<Fraction>(FractionField.getInstance());
         try {
             m2.setSubMatrix(testData,0,1);
-            fail("expecting IllegalStateException");
-        } catch (IllegalStateException e) {
+            fail("expecting MathIllegalStateException");
+        } catch (MathIllegalStateException e) {
             // expected
         }
         try {
             m2.setSubMatrix(testData,1,0);
-            fail("expecting IllegalStateException");
-        } catch (IllegalStateException e) {
+            fail("expecting MathIllegalStateException");
+        } catch (MathIllegalStateException e) {
             // expected
         }
 
         // ragged
         try {
             m.setSubMatrix(new Fraction[][] {{new Fraction(1)}, {new Fraction(2), new Fraction(3)}}, 0, 0);
-            fail("expecting IllegalArgumentException");
-        } catch (IllegalArgumentException e) {
+            fail("expecting MathIllegalArgumentException");
+        } catch (MathIllegalArgumentException e) {
             // expected
         }
 
         // empty
         try {
             m.setSubMatrix(new Fraction[][] {{}}, 0, 0);
-            fail("expecting IllegalArgumentException");
-        } catch (IllegalArgumentException e) {
+            fail("expecting MathIllegalArgumentException");
+        } catch (MathIllegalArgumentException e) {
             // expected
         }
 
@@ -1009,12 +1012,20 @@ public final class FieldMatrixImplTest e
     protected void splitLU(FieldMatrix<Fraction> lu,
                            Fraction[][] lowerData,
                            Fraction[][] upperData) {
-        if (!lu.isSquare() ||
-            lowerData.length != lowerData[0].length ||
-            upperData.length != upperData[0].length ||
-            lowerData.length != upperData.length ||
-            lowerData.length != lu.getRowDimension()) {
-            throw new IllegalArgumentException("incorrect dimensions");
+        if (!lu.isSquare()) {
+            throw new NonSquareMatrixException(lu.getRowDimension(), lu.getColumnDimension());
+        }
+        if (lowerData.length != lowerData[0].length) {
+            throw new DimensionMismatchException(lowerData.length, lowerData[0].length);
+        }
+        if (upperData.length != upperData[0].length) {
+            throw new DimensionMismatchException(upperData.length, upperData[0].length);
+        }
+        if (lowerData.length != upperData.length) {
+            throw new DimensionMismatchException(lowerData.length, upperData.length);
+        }
+        if (lowerData.length != lu.getRowDimension()) {
+            throw new DimensionMismatchException(lowerData.length, lu.getRowDimension());
         }
         int n = lu.getRowDimension();
         for (int i = 0; i < n; i++) {
@@ -1035,8 +1046,12 @@ public final class FieldMatrixImplTest e
 
     /** Returns the result of applying the given row permutation to the matrix */
     protected FieldMatrix<Fraction> permuteRows(FieldMatrix<Fraction> matrix, int[] permutation) {
-        if (!matrix.isSquare() || matrix.getRowDimension() != permutation.length) {
-            throw new IllegalArgumentException("dimension mismatch");
+        if (!matrix.isSquare()) {
+            throw new NonSquareMatrixException(matrix.getRowDimension(),
+                                               matrix.getColumnDimension());
+        }
+        if (matrix.getRowDimension() != permutation.length) {
+            throw new DimensionMismatchException(matrix.getRowDimension(), permutation.length);
         }
         int n = matrix.getRowDimension();
         int m = matrix.getColumnDimension();

Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/LUSolverTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/LUSolverTest.java?rev=1044186&r1=1044185&r2=1044186&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/LUSolverTest.java (original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/LUSolverTest.java Fri Dec 10 00:50:50 2010
@@ -18,6 +18,7 @@
 package org.apache.commons.math.linear;
 
 import org.apache.commons.math.exception.SingularMatrixException;
+import org.apache.commons.math.exception.MathIllegalArgumentException;
 import junit.framework.TestCase;
 
 public class LUSolverTest extends TestCase {
@@ -78,19 +79,19 @@ public class LUSolverTest extends TestCa
         try {
             solver.solve(b);
             fail("an exception should have been thrown");
-        } catch (IllegalArgumentException iae) {
+        } catch (MathIllegalArgumentException iae) {
             // expected behavior
         }
         try {
             solver.solve(b.getColumn(0));
             fail("an exception should have been thrown");
-        } catch (IllegalArgumentException iae) {
+        } catch (MathIllegalArgumentException iae) {
             // expected behavior
         }
         try {
             solver.solve(new ArrayRealVectorTest.RealVectorTestImpl(b.getColumn(0)));
             fail("an exception should have been thrown");
-        } catch (IllegalArgumentException iae) {
+        } catch (MathIllegalArgumentException iae) {
             // expected behavior
         }
     }

Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/MatrixUtilsTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/MatrixUtilsTest.java?rev=1044186&r1=1044185&r2=1044186&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/MatrixUtilsTest.java (original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/MatrixUtilsTest.java Fri Dec 10 00:50:50 2010
@@ -26,6 +26,7 @@ import org.apache.commons.math.fraction.
 import org.apache.commons.math.fraction.FractionField;
 import org.apache.commons.math.exception.NullArgumentException;
 import org.apache.commons.math.exception.NotStrictlyPositiveException;
+import org.apache.commons.math.exception.MathIllegalArgumentException;
 
 /**
  * Test cases for the {@link MatrixUtils} class.
@@ -73,14 +74,14 @@ public final class MatrixUtilsTest exten
                 MatrixUtils.createRealMatrix(testData));
         try {
             MatrixUtils.createRealMatrix(new double[][] {{1}, {1,2}});  // ragged
-            fail("Expecting IllegalArgumentException");
-        } catch (IllegalArgumentException ex) {
+            fail("Expecting MathIllegalArgumentException");
+        } catch (MathIllegalArgumentException ex) {
             // expected
         }
         try {
             MatrixUtils.createRealMatrix(new double[][] {{}, {}});  // no columns
-            fail("Expecting IllegalArgumentException");
-        } catch (IllegalArgumentException ex) {
+            fail("Expecting MathIllegalArgumentException");
+        } catch (MathIllegalArgumentException ex) {
             // expected
         }
         try {
@@ -98,14 +99,14 @@ public final class MatrixUtilsTest exten
                      MatrixUtils.createFieldMatrix(fractionColMatrix));
         try {
             MatrixUtils.createFieldMatrix(asFraction(new double[][] {{1}, {1,2}}));  // ragged
-            fail("Expecting IllegalArgumentException");
-        } catch (IllegalArgumentException ex) {
+            fail("Expecting MathIllegalArgumentException");
+        } catch (MathIllegalArgumentException ex) {
             // expected
         }
         try {
             MatrixUtils.createFieldMatrix(asFraction(new double[][] {{}, {}}));  // no columns
-            fail("Expecting IllegalArgumentException");
-        } catch (IllegalArgumentException ex) {
+            fail("Expecting MathIllegalArgumentException");
+        } catch (MathIllegalArgumentException ex) {
             // expected
         }
         try {
@@ -140,8 +141,8 @@ public final class MatrixUtilsTest exten
                      new Array2DRowFieldMatrix<Fraction>(fractionRowMatrix));
         try {
             MatrixUtils.createRowFieldMatrix(new Fraction[] {});  // empty
-            fail("Expecting IllegalArgumentException");
-        } catch (IllegalArgumentException ex) {
+            fail("Expecting MathIllegalArgumentException");
+        } catch (MathIllegalArgumentException ex) {
             // expected
         }
         try {
@@ -157,8 +158,8 @@ public final class MatrixUtilsTest exten
                      new BlockRealMatrix(colMatrix));
         try {
             MatrixUtils.createColumnRealMatrix(new double[] {});  // empty
-            fail("Expecting IllegalArgumentException");
-        } catch (IllegalArgumentException ex) {
+            fail("Expecting MathIllegalArgumentException");
+        } catch (MathIllegalArgumentException ex) {
             // expected
         }
         try {
@@ -177,8 +178,8 @@ public final class MatrixUtilsTest exten
 
         try {
             MatrixUtils.createColumnFieldMatrix(new Fraction[] {});  // empty
-            fail("Expecting IllegalArgumentException");
-        } catch (IllegalArgumentException ex) {
+            fail("Expecting MathIllegalArgumentException");
+        } catch (MathIllegalArgumentException ex) {
             // expected
         }
         try {
@@ -210,8 +211,8 @@ public final class MatrixUtilsTest exten
         checkIdentityMatrix(MatrixUtils.createRealIdentityMatrix(1));
         try {
             MatrixUtils.createRealIdentityMatrix(0);
-            fail("Expecting IllegalArgumentException");
-        } catch (IllegalArgumentException ex) {
+            fail("Expecting MathIllegalArgumentException");
+        } catch (MathIllegalArgumentException ex) {
             // expected
         }
     }
@@ -237,8 +238,8 @@ public final class MatrixUtilsTest exten
         checkIdentityFieldMatrix(MatrixUtils.createFieldIdentityMatrix(FractionField.getInstance(), 1));
         try {
             MatrixUtils.createRealIdentityMatrix(0);
-            fail("Expecting IllegalArgumentException");
-        } catch (IllegalArgumentException ex) {
+            fail("Expecting MathIllegalArgumentException");
+        } catch (MathIllegalArgumentException ex) {
             // expected
         }
     }

Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/QRSolverTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/QRSolverTest.java?rev=1044186&r1=1044185&r2=1044186&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/QRSolverTest.java (original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/QRSolverTest.java Fri Dec 10 00:50:50 2010
@@ -21,6 +21,8 @@ import java.util.Random;
 
 import org.apache.commons.math.exception.MathUserException;
 import org.apache.commons.math.exception.SingularMatrixException;
+import org.apache.commons.math.exception.MathIllegalArgumentException;
+
 import junit.framework.TestCase;
 
 public class QRSolverTest extends TestCase {
@@ -78,19 +80,19 @@ public class QRSolverTest extends TestCa
         try {
             solver.solve(b);
             fail("an exception should have been thrown");
-        } catch (IllegalArgumentException iae) {
+        } catch (MathIllegalArgumentException iae) {
             // expected behavior
         }
         try {
             solver.solve(b.getColumn(0));
             fail("an exception should have been thrown");
-        } catch (IllegalArgumentException iae) {
+        } catch (MathIllegalArgumentException iae) {
             // expected behavior
         }
         try {
             solver.solve(b.getColumnVector(0));
             fail("an exception should have been thrown");
-        } catch (IllegalArgumentException iae) {
+        } catch (MathIllegalArgumentException iae) {
             // expected behavior
         }
     }

Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/RealVectorFormatAbstractTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/RealVectorFormatAbstractTest.java?rev=1044186&r1=1044185&r2=1044186&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/RealVectorFormatAbstractTest.java (original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/RealVectorFormatAbstractTest.java Fri Dec 10 00:50:50 2010
@@ -24,6 +24,7 @@ import java.util.Locale;
 
 import junit.framework.TestCase;
 
+import org.apache.commons.math.exception.MathIllegalArgumentException;
 import org.apache.commons.math.util.CompositeFormat;
 
 public abstract class RealVectorFormatAbstractTest extends TestCase {
@@ -358,7 +359,7 @@ public abstract class RealVectorFormatAb
             Object object = new Object();
             cf.format(object);
             fail();
-        } catch (IllegalArgumentException ex) {
+        } catch (MathIllegalArgumentException ex) {
             // success
         }
     }

Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/SingularValueSolverTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/SingularValueSolverTest.java?rev=1044186&r1=1044185&r2=1044186&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/SingularValueSolverTest.java (original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/SingularValueSolverTest.java Fri Dec 10 00:50:50 2010
@@ -17,6 +17,8 @@
 
 package org.apache.commons.math.linear;
 
+import org.apache.commons.math.exception.MathIllegalArgumentException;
+
 import org.junit.Assert;
 import org.junit.Test;
 
@@ -38,19 +40,19 @@ public class SingularValueSolverTest {
         try {
             solver.solve(b);
             Assert.fail("an exception should have been thrown");
-        } catch (IllegalArgumentException iae) {
+        } catch (MathIllegalArgumentException iae) {
             // expected behavior
         }
         try {
             solver.solve(b.getColumn(0));
             Assert.fail("an exception should have been thrown");
-        } catch (IllegalArgumentException iae) {
+        } catch (MathIllegalArgumentException iae) {
             // expected behavior
         }
         try {
             solver.solve(new ArrayRealVectorTest.RealVectorTestImpl(b.getColumn(0)));
             Assert.fail("an exception should have been thrown");
-        } catch (IllegalArgumentException iae) {
+        } catch (MathIllegalArgumentException iae) {
             // expected behavior
         }
     }

Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/SparseFieldMatrixTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/SparseFieldMatrixTest.java?rev=1044186&r1=1044185&r2=1044186&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/SparseFieldMatrixTest.java (original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/SparseFieldMatrixTest.java Fri Dec 10 00:50:50 2010
@@ -27,6 +27,7 @@ import org.apache.commons.math.exception
 import org.apache.commons.math.exception.NumberIsTooSmallException;
 import org.apache.commons.math.exception.NullArgumentException;
 import org.apache.commons.math.exception.NonSquareMatrixException;
+import org.apache.commons.math.exception.MathIllegalArgumentException;
 
 /**
  * Test cases for the {@link SparseFieldMatrix} class.
@@ -175,8 +176,8 @@ public class SparseFieldMatrixTest exten
         SparseFieldMatrix<Fraction> m2 = createSparseMatrix(testData2);
         try {
             m.add(m2);
-            fail("IllegalArgumentException expected");
-        } catch (IllegalArgumentException ex) {
+            fail("MathIllegalArgumentException expected");
+        } catch (MathIllegalArgumentException ex) {
             // ignored
         }
     }
@@ -191,7 +192,7 @@ public class SparseFieldMatrixTest exten
         try {
             m.subtract(createSparseMatrix(testData2));
             fail("Expecting illegalArgumentException");
-        } catch (IllegalArgumentException ex) {
+        } catch (MathIllegalArgumentException ex) {
             // ignored
         }
     }
@@ -217,7 +218,7 @@ public class SparseFieldMatrixTest exten
         try {
             m.multiply(createSparseMatrix(bigSingular));
             fail("Expecting illegalArgumentException");
-        } catch (IllegalArgumentException ex) {
+        } catch (MathIllegalArgumentException ex) {
             // ignored
         }
     }
@@ -266,7 +267,7 @@ public class SparseFieldMatrixTest exten
         try {
             m.operate(testVector);
             fail("Expecting illegalArgumentException");
-        } catch (IllegalArgumentException ex) {
+        } catch (MathIllegalArgumentException ex) {
             // ignored
         }
     }
@@ -304,8 +305,8 @@ public class SparseFieldMatrixTest exten
         m = createSparseMatrix(bigSingular);
         try {
             m.preMultiply(testVector);
-            fail("expecting IllegalArgumentException");
-        } catch (IllegalArgumentException ex) {
+            fail("expecting MathIllegalArgumentException");
+        } catch (MathIllegalArgumentException ex) {
             // ignored
         }
     }
@@ -330,7 +331,7 @@ public class SparseFieldMatrixTest exten
         try {
             m.preMultiply(createSparseMatrix(bigSingular));
             fail("Expecting illegalArgumentException");
-        } catch (IllegalArgumentException ex) {
+        } catch (MathIllegalArgumentException ex) {
             // ignored
         }
     }
@@ -628,24 +629,24 @@ public class SparseFieldMatrixTest exten
         }
         try {
             new SparseFieldMatrix<Fraction>(field, 0, 0);
-            fail("expecting IllegalArgumentException");
-        } catch (IllegalArgumentException e) {
+            fail("expecting MathIllegalArgumentException");
+        } catch (MathIllegalArgumentException e) {
             // expected
         }
 
         // ragged
         try {
             m.setSubMatrix(new Fraction[][] { { new Fraction(1) }, { new Fraction(2), new Fraction(3) } }, 0, 0);
-            fail("expecting IllegalArgumentException");
-        } catch (IllegalArgumentException e) {
+            fail("expecting MathIllegalArgumentException");
+        } catch (MathIllegalArgumentException e) {
             // expected
         }
 
         // empty
         try {
             m.setSubMatrix(new Fraction[][] { {} }, 0, 0);
-            fail("expecting IllegalArgumentException");
-        } catch (IllegalArgumentException e) {
+            fail("expecting MathIllegalArgumentException");
+        } catch (MathIllegalArgumentException e) {
             // expected
         }
 

Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/SparseFieldVectorTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/SparseFieldVectorTest.java?rev=1044186&r1=1044185&r2=1044186&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/SparseFieldVectorTest.java (original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/SparseFieldVectorTest.java Fri Dec 10 00:50:50 2010
@@ -20,7 +20,7 @@ package org.apache.commons.math.linear;
 import org.apache.commons.math.fraction.Fraction;
 import org.apache.commons.math.fraction.FractionConversionException;
 import org.apache.commons.math.fraction.FractionField;
-
+import org.apache.commons.math.exception.MathIllegalArgumentException;
 
 import junit.framework.TestCase;
 
@@ -175,8 +175,8 @@ public class SparseFieldVectorTest exten
         assertTrue("some output ",  out1.length()!=0);
         try {
             v1.checkVectorDimensions(2);
-            fail("IllegalArgumentException expected");
-        } catch (IllegalArgumentException ex) {
+            fail("MathIllegalArgumentException expected");
+        } catch (MathIllegalArgumentException ex) {
             // expected behavior
         }
 

Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/SparseRealMatrixTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/SparseRealMatrixTest.java?rev=1044186&r1=1044185&r2=1044186&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/SparseRealMatrixTest.java (original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/SparseRealMatrixTest.java Fri Dec 10 00:50:50 2010
@@ -23,6 +23,7 @@ import org.apache.commons.math.exception
 import org.apache.commons.math.exception.NoDataException;
 import org.apache.commons.math.exception.NumberIsTooSmallException;
 import org.apache.commons.math.exception.NonSquareMatrixException;
+import org.apache.commons.math.exception.MathIllegalArgumentException;
 
 /**
  * Test cases for the {@link OpenMapRealMatrix} class.
@@ -155,8 +156,8 @@ public final class SparseRealMatrixTest 
         OpenMapRealMatrix m2 = createSparseMatrix(testData2);
         try {
             m.add(m2);
-            fail("IllegalArgumentException expected");
-        } catch (IllegalArgumentException ex) {
+            fail("MathIllegalArgumentException expected");
+        } catch (MathIllegalArgumentException ex) {
             // ignored
         }
     }
@@ -178,7 +179,7 @@ public final class SparseRealMatrixTest 
         try {
             m.subtract(createSparseMatrix(testData2));
             fail("Expecting illegalArgumentException");
-        } catch (IllegalArgumentException ex) {
+        } catch (MathIllegalArgumentException ex) {
             // ignored
         }
     }
@@ -204,7 +205,7 @@ public final class SparseRealMatrixTest 
         try {
             m.multiply(createSparseMatrix(bigSingular));
             fail("Expecting illegalArgumentException");
-        } catch (IllegalArgumentException ex) {
+        } catch (MathIllegalArgumentException ex) {
             // ignored
         }
     }
@@ -253,7 +254,7 @@ public final class SparseRealMatrixTest 
         try {
             m.operate(testVector);
             fail("Expecting illegalArgumentException");
-        } catch (IllegalArgumentException ex) {
+        } catch (MathIllegalArgumentException ex) {
             // ignored
         }
     }
@@ -291,8 +292,8 @@ public final class SparseRealMatrixTest 
         m = createSparseMatrix(bigSingular);
         try {
             m.preMultiply(testVector);
-            fail("expecting IllegalArgumentException");
-        } catch (IllegalArgumentException ex) {
+            fail("expecting MathIllegalArgumentException");
+        } catch (MathIllegalArgumentException ex) {
             // ignored
         }
     }
@@ -317,7 +318,7 @@ public final class SparseRealMatrixTest 
         try {
             m.preMultiply(createSparseMatrix(bigSingular));
             fail("Expecting illegalArgumentException");
-        } catch (IllegalArgumentException ex) {
+        } catch (MathIllegalArgumentException ex) {
             // ignored
         }
     }
@@ -613,24 +614,24 @@ public final class SparseRealMatrixTest 
         }
         try {
             new OpenMapRealMatrix(0, 0);
-            fail("expecting IllegalArgumentException");
-        } catch (IllegalArgumentException e) {
+            fail("expecting MathIllegalArgumentException");
+        } catch (MathIllegalArgumentException e) {
             // expected
         }
 
         // ragged
         try {
             m.setSubMatrix(new double[][] { { 1 }, { 2, 3 } }, 0, 0);
-            fail("expecting IllegalArgumentException");
-        } catch (IllegalArgumentException e) {
+            fail("expecting MathIllegalArgumentException");
+        } catch (MathIllegalArgumentException e) {
             // expected
         }
 
         // empty
         try {
             m.setSubMatrix(new double[][] { {} }, 0, 0);
-            fail("expecting IllegalArgumentException");
-        } catch (IllegalArgumentException e) {
+            fail("expecting MathIllegalArgumentException");
+        } catch (MathIllegalArgumentException e) {
             // expected
         }
 

Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/SparseRealVectorTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/SparseRealVectorTest.java?rev=1044186&r1=1044185&r2=1044186&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/SparseRealVectorTest.java (original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/SparseRealVectorTest.java Fri Dec 10 00:50:50 2010
@@ -24,6 +24,8 @@ import org.junit.Test;
 import org.apache.commons.math.TestUtils;
 import org.apache.commons.math.analysis.UnivariateRealFunction;
 import org.apache.commons.math.util.FastMath;
+import org.apache.commons.math.exception.MathIllegalArgumentException;
+import org.apache.commons.math.exception.MathArithmeticException;
 import org.apache.commons.math.exception.OutOfRangeException;
 import org.apache.commons.math.analysis.function.Abs;
 import org.apache.commons.math.analysis.function.Acos;
@@ -364,8 +366,8 @@ public class SparseRealVectorTest {
         //Assert.assertEquals("testData is 4.0 ", 4.0, v4.getEntry(0));
         //try {
         //    new SparseRealVector(vec4, 8, 3);
-        //    Assert.fail("IllegalArgumentException expected");
-        //} catch (IllegalArgumentException ex) {
+        //    Assert.fail("MathIllegalArgumentException expected");
+        //} catch (MathIllegalArgumentException ex) {
             // expected behavior
         //}
 
@@ -901,8 +903,8 @@ public class SparseRealVectorTest {
 
         try {
             v_null.unitVector();
-            Assert.fail("Expecting ArithmeticException");
-        } catch (ArithmeticException ex) {
+            Assert.fail("Expecting MathArithmeticException");
+        } catch (MathArithmeticException ex) {
             // expected behavior
         }
 
@@ -911,8 +913,8 @@ public class SparseRealVectorTest {
         assertClose("compare vect" ,v_unitVector_2.getData(),v_unitize.getData(),normTolerance);
         try {
             v_null.unitize();
-            Assert.fail("Expecting ArithmeticException");
-        } catch (ArithmeticException ex) {
+            Assert.fail("Expecting MathArithmeticException");
+        } catch (MathArithmeticException ex) {
             // expected behavior
         }
 
@@ -934,8 +936,8 @@ public class SparseRealVectorTest {
         Assert.assertTrue("some output ",  out1.length()!=0);
         try {
             v1.checkVectorDimensions(2);
-            Assert.fail("IllegalArgumentException expected");
-        } catch (IllegalArgumentException ex) {
+            Assert.fail("MathIllegalArgumentException expected");
+        } catch (MathIllegalArgumentException ex) {
             // expected behavior
         }
 

Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/MultiStartDifferentiableMultivariateVectorialOptimizerTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/MultiStartDifferentiableMultivariateVectorialOptimizerTest.java?rev=1044186&r1=1044185&r2=1044186&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/MultiStartDifferentiableMultivariateVectorialOptimizerTest.java (original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/MultiStartDifferentiableMultivariateVectorialOptimizerTest.java Fri Dec 10 00:50:50 2010
@@ -24,6 +24,7 @@ import static org.junit.Assert.fail;
 import java.io.Serializable;
 
 import org.apache.commons.math.exception.MathUserException;
+import org.apache.commons.math.exception.MathIllegalStateException;
 import org.apache.commons.math.analysis.DifferentiableMultivariateVectorialFunction;
 import org.apache.commons.math.analysis.MultivariateMatrixFunction;
 import org.apache.commons.math.linear.BlockRealMatrix;
@@ -118,7 +119,7 @@ public class MultiStartDifferentiableMul
         try {
             optimizer.getOptima();
             fail("an exception should have been thrown");
-        } catch (IllegalStateException ise) {
+        } catch (MathIllegalStateException ise) {
             // expected
         }
         VectorialPointValuePair optimum =

Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/fitting/GaussianFitterTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/fitting/GaussianFitterTest.java?rev=1044186&r1=1044185&r2=1044186&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/fitting/GaussianFitterTest.java (original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/fitting/GaussianFitterTest.java Fri Dec 10 00:50:50 2010
@@ -19,10 +19,10 @@ package org.apache.commons.math.optimiza
 
 import static org.junit.Assert.assertEquals;
 
-import org.apache.commons.math.exception.MathUserException;
+import org.apache.commons.math.exception.MathIllegalArgumentException;
 import org.apache.commons.math.optimization.OptimizationException;
-import org.apache.commons.math.optimization.general.
-       LevenbergMarquardtOptimizer;
+import org.apache.commons.math.optimization.general.LevenbergMarquardtOptimizer;
+
 import org.junit.Test;
 
 /**
@@ -185,11 +185,10 @@ public class GaussianFitterTest {
      * Basic.
      *
      * @throws OptimizationException in the event of a test case error
-     * @throws MathUserException in the event of a test case error
      */
     @Test
     public void testFit01()
-    throws OptimizationException, MathUserException {
+    throws OptimizationException {
         GaussianFitter fitter = new GaussianFitter(new LevenbergMarquardtOptimizer());
         addDatasetToGaussianFitter(DATASET1, fitter);
         GaussianFunction fitFunction = fitter.fit();
@@ -203,11 +202,10 @@ public class GaussianFitterTest {
      * Zero points is not enough observed points.
      *
      * @throws OptimizationException in the event of a test case error
-     * @throws MathUserException in the event of a test case error
      */
-    @Test(expected=IllegalArgumentException.class)
+    @Test(expected=MathIllegalArgumentException.class)
     public void testFit02()
-    throws OptimizationException, MathUserException {
+    throws OptimizationException {
         GaussianFitter fitter = new GaussianFitter(new LevenbergMarquardtOptimizer());
         fitter.fit();
     }
@@ -216,11 +214,10 @@ public class GaussianFitterTest {
      * Two points is not enough observed points.
      *
      * @throws OptimizationException in the event of a test case error
-     * @throws MathUserException in the event of a test case error
      */
-    @Test(expected=IllegalArgumentException.class)
+    @Test(expected=MathIllegalArgumentException.class)
     public void testFit03()
-    throws OptimizationException, MathUserException {
+    throws OptimizationException {
         GaussianFitter fitter = new GaussianFitter(new LevenbergMarquardtOptimizer());
         addDatasetToGaussianFitter(new double[][] {
             {4.0254623,  531026.0},
@@ -233,11 +230,10 @@ public class GaussianFitterTest {
      * Poor data: right of peak not symmetric with left of peak.
      *
      * @throws OptimizationException in the event of a test case error
-     * @throws MathUserException in the event of a test case error
      */
     @Test
     public void testFit04()
-    throws OptimizationException, MathUserException {
+    throws OptimizationException {
         GaussianFitter fitter = new GaussianFitter(new LevenbergMarquardtOptimizer());
         addDatasetToGaussianFitter(DATASET2, fitter);
         GaussianFunction fitFunction = fitter.fit();
@@ -251,11 +247,10 @@ public class GaussianFitterTest {
      * Poor data: long tails.
      *
      * @throws OptimizationException in the event of a test case error
-     * @throws MathUserException in the event of a test case error
      */
     @Test
     public void testFit05()
-    throws OptimizationException, MathUserException {
+    throws OptimizationException {
         GaussianFitter fitter = new GaussianFitter(new LevenbergMarquardtOptimizer());
         addDatasetToGaussianFitter(DATASET3, fitter);
         GaussianFunction fitFunction = fitter.fit();
@@ -269,11 +264,10 @@ public class GaussianFitterTest {
      * Poor data: right of peak is missing.
      *
      * @throws OptimizationException in the event of a test case error
-     * @throws MathUserException in the event of a test case error
      */
     @Test
     public void testFit06()
-    throws OptimizationException, MathUserException {
+    throws OptimizationException {
         GaussianFitter fitter = new GaussianFitter(new LevenbergMarquardtOptimizer());
         addDatasetToGaussianFitter(DATASET4, fitter);
         GaussianFunction fitFunction = fitter.fit();
@@ -287,11 +281,10 @@ public class GaussianFitterTest {
      * Basic with smaller dataset.
      *
      * @throws OptimizationException in the event of a test case error
-     * @throws MathUserException in the event of a test case error
      */
     @Test
     public void testFit07()
-    throws OptimizationException, MathUserException {
+    throws OptimizationException {
         GaussianFitter fitter = new GaussianFitter(new LevenbergMarquardtOptimizer());
         addDatasetToGaussianFitter(DATASET5, fitter);
         GaussianFunction fitFunction = fitter.fit();

Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/fitting/ParametricGaussianFunctionTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/fitting/ParametricGaussianFunctionTest.java?rev=1044186&r1=1044185&r2=1044186&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/fitting/ParametricGaussianFunctionTest.java (original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/fitting/ParametricGaussianFunctionTest.java Fri Dec 10 00:50:50 2010
@@ -19,10 +19,10 @@ package org.apache.commons.math.optimiza
 
 import org.apache.commons.math.exception.MathUserException;
 import org.apache.commons.math.exception.ZeroException;
+import org.apache.commons.math.exception.MathIllegalArgumentException;
 import org.apache.commons.math.optimization.OptimizationException;
 import org.apache.commons.math.optimization.fitting.CurveFitter;
-import org.apache.commons.math.optimization.general.
-       LevenbergMarquardtOptimizer;
+import org.apache.commons.math.optimization.general.LevenbergMarquardtOptimizer;
 import org.junit.Test;
 
 import static org.junit.Assert.assertEquals;
@@ -111,7 +111,7 @@ public class ParametricGaussianFunctionT
      *
      * @throws MathUserException in the event of a test case error
      */
-    @Test(expected=IllegalArgumentException.class)
+    @Test(expected=MathIllegalArgumentException.class)
     public void testValue01() throws MathUserException {
         ParametricGaussianFunction f = new ParametricGaussianFunction();
         f.value(0.0, null);
@@ -122,7 +122,7 @@ public class ParametricGaussianFunctionT
      *
      * @throws MathUserException in the event of a test case error
      */
-    @Test(expected=IllegalArgumentException.class)
+    @Test(expected=MathIllegalArgumentException.class)
     public void testValue02() throws MathUserException {
         ParametricGaussianFunction f = new ParametricGaussianFunction();
         f.value(0.0, new double[] {0.0, 1.0});

Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math/random/AbstractRandomGeneratorTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/random/AbstractRandomGeneratorTest.java?rev=1044186&r1=1044185&r2=1044186&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/random/AbstractRandomGeneratorTest.java (original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/random/AbstractRandomGeneratorTest.java Fri Dec 10 00:50:50 2010
@@ -17,7 +17,7 @@
 package org.apache.commons.math.random;
 
 import org.apache.commons.math.stat.Frequency;
-
+import org.apache.commons.math.exception.MathIllegalArgumentException;
 
 /**
  * Test cases for the AbstractRandomGenerator class
@@ -38,8 +38,8 @@ public class AbstractRandomGeneratorTest
     public void testNextInt() {
         try {
             testGenerator.nextInt(-1);
-            fail("IllegalArgumentException expected");
-        } catch (IllegalArgumentException ex) {
+            fail("MathIllegalArgumentException expected");
+        } catch (MathIllegalArgumentException ex) {
             // ignored
         }
         Frequency freq = new Frequency();

Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math/random/MersenneTwisterTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/random/MersenneTwisterTest.java?rev=1044186&r1=1044185&r2=1044186&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/random/MersenneTwisterTest.java (original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/random/MersenneTwisterTest.java Fri Dec 10 00:50:50 2010
@@ -21,6 +21,8 @@ import static org.junit.Assert.assertTru
 
 import org.apache.commons.math.stat.descriptive.SummaryStatistics;
 import org.apache.commons.math.util.FastMath;
+import org.apache.commons.math.exception.MathIllegalArgumentException;
+
 import org.junit.Test;
 
 public class MersenneTwisterTest {
@@ -62,7 +64,7 @@ public class MersenneTwisterTest {
                      0.006);
     }
 
-    @Test(expected=java.lang.IllegalArgumentException.class)
+    @Test(expected=MathIllegalArgumentException.class)
     public void testNextIntNeg() {
         new MersenneTwister(1).nextInt(-1);
     }

Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math/random/RandomDataTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/random/RandomDataTest.java?rev=1044186&r1=1044185&r2=1044186&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/random/RandomDataTest.java (original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/random/RandomDataTest.java Fri Dec 10 00:50:50 2010
@@ -47,6 +47,7 @@ import org.apache.commons.math.stat.desc
 import org.apache.commons.math.stat.inference.ChiSquareTest;
 import org.apache.commons.math.stat.inference.ChiSquareTestImpl;
 import org.apache.commons.math.util.FastMath;
+import org.apache.commons.math.exception.MathIllegalArgumentException;
 
 /**
  * Test cases for the RandomData class.
@@ -86,8 +87,8 @@ public class RandomDataTest extends Retr
     public void testNextInt() {
         try {
             randomData.nextInt(4, 3);
-            fail("IllegalArgumentException expected");
-        } catch (IllegalArgumentException ex) {
+            fail("MathIllegalArgumentException expected");
+        } catch (MathIllegalArgumentException ex) {
             // ignored
         }
         Frequency freq = new Frequency();
@@ -114,8 +115,8 @@ public class RandomDataTest extends Retr
     public void testNextLong() {
         try {
             randomData.nextLong(4, 3);
-            fail("IllegalArgumentException expected");
-        } catch (IllegalArgumentException ex) {
+            fail("MathIllegalArgumentException expected");
+        } catch (MathIllegalArgumentException ex) {
             // ignored
         }
         Frequency freq = new Frequency();
@@ -142,8 +143,8 @@ public class RandomDataTest extends Retr
     public void testNextSecureLong() {
         try {
             randomData.nextSecureLong(4, 3);
-            fail("IllegalArgumentException expected");
-        } catch (IllegalArgumentException ex) {
+            fail("MathIllegalArgumentException expected");
+        } catch (MathIllegalArgumentException ex) {
             // ignored
         }
         Frequency freq = new Frequency();
@@ -170,8 +171,8 @@ public class RandomDataTest extends Retr
     public void testNextSecureInt() {
         try {
             randomData.nextSecureInt(4, 3);
-            fail("IllegalArgumentException expected");
-        } catch (IllegalArgumentException ex) {
+            fail("MathIllegalArgumentException expected");
+        } catch (MathIllegalArgumentException ex) {
             // ignored
         }
         Frequency freq = new Frequency();
@@ -203,8 +204,8 @@ public class RandomDataTest extends Retr
     public void testNextPoisson() {
         try {
             randomData.nextPoisson(0);
-            fail("zero mean -- expecting IllegalArgumentException");
-        } catch (IllegalArgumentException ex) {
+            fail("zero mean -- expecting MathIllegalArgumentException");
+        } catch (MathIllegalArgumentException ex) {
             // ignored
         }
         Frequency f = new Frequency();
@@ -219,14 +220,14 @@ public class RandomDataTest extends Retr
         assertEquals("cum Poisson(4)", cumPct, 0.7851, 0.2);
         try {
             randomData.nextPoisson(-1);
-            fail("negative mean supplied -- IllegalArgumentException expected");
-        } catch (IllegalArgumentException ex) {
+            fail("negative mean supplied -- MathIllegalArgumentException expected");
+        } catch (MathIllegalArgumentException ex) {
             // ignored
         }
         try {
             randomData.nextPoisson(0);
-            fail("0 mean supplied -- IllegalArgumentException expected");
-        } catch (IllegalArgumentException ex) {
+            fail("0 mean supplied -- MathIllegalArgumentException expected");
+        } catch (MathIllegalArgumentException ex) {
             // ignored
         }
 
@@ -388,14 +389,14 @@ public class RandomDataTest extends Retr
     public void testNextHex() {
         try {
             randomData.nextHexString(-1);
-            fail("negative length supplied -- IllegalArgumentException expected");
-        } catch (IllegalArgumentException ex) {
+            fail("negative length supplied -- MathIllegalArgumentException expected");
+        } catch (MathIllegalArgumentException ex) {
             // ignored
         }
         try {
             randomData.nextHexString(0);
-            fail("zero length supplied -- IllegalArgumentException expected");
-        } catch (IllegalArgumentException ex) {
+            fail("zero length supplied -- MathIllegalArgumentException expected");
+        } catch (MathIllegalArgumentException ex) {
             // ignored
         }
         String hexString = randomData.nextHexString(3);
@@ -408,8 +409,8 @@ public class RandomDataTest extends Retr
         }
         try {
             hexString = randomData.nextHexString(0);
-            fail("zero length requested -- expecting IllegalArgumentException");
-        } catch (IllegalArgumentException ex) {
+            fail("zero length requested -- expecting MathIllegalArgumentException");
+        } catch (MathIllegalArgumentException ex) {
             // ignored
         }
         if (hexString.length() != 1) {
@@ -443,14 +444,14 @@ public class RandomDataTest extends Retr
     public void testNextSecureHex() {
         try {
             randomData.nextSecureHexString(-1);
-            fail("negative length -- IllegalArgumentException expected");
-        } catch (IllegalArgumentException ex) {
+            fail("negative length -- MathIllegalArgumentException expected");
+        } catch (MathIllegalArgumentException ex) {
             // ignored
         }
         try {
             randomData.nextSecureHexString(0);
-            fail("zero length -- IllegalArgumentException expected");
-        } catch (IllegalArgumentException ex) {
+            fail("zero length -- MathIllegalArgumentException expected");
+        } catch (MathIllegalArgumentException ex) {
             // ignored
         }
         String hexString = randomData.nextSecureHexString(3);
@@ -463,8 +464,8 @@ public class RandomDataTest extends Retr
         }
         try {
             hexString = randomData.nextSecureHexString(0);
-            fail("zero length requested -- expecting IllegalArgumentException");
-        } catch (IllegalArgumentException ex) {
+            fail("zero length requested -- expecting MathIllegalArgumentException");
+        } catch (MathIllegalArgumentException ex) {
             // ignored
         }
         if (hexString.length() != 1) {
@@ -498,14 +499,14 @@ public class RandomDataTest extends Retr
     public void testNextUniform() {
         try {
             randomData.nextUniform(4, 3);
-            fail("IllegalArgumentException expected");
-        } catch (IllegalArgumentException ex) {
+            fail("MathIllegalArgumentException expected");
+        } catch (MathIllegalArgumentException ex) {
             // ignored
         }
         try {
             randomData.nextUniform(3, 3);
-            fail("IllegalArgumentException expected");
-        } catch (IllegalArgumentException ex) {
+            fail("MathIllegalArgumentException expected");
+        } catch (MathIllegalArgumentException ex) {
             // ignored
         }
         double[] expected = { 500, 500 };
@@ -545,8 +546,8 @@ public class RandomDataTest extends Retr
     public void testNextGaussian() {
         try {
             randomData.nextGaussian(0, 0);
-            fail("zero sigma -- IllegalArgumentException expected");
-        } catch (IllegalArgumentException ex) {
+            fail("zero sigma -- MathIllegalArgumentException expected");
+        } catch (MathIllegalArgumentException ex) {
             // ignored
         }
         SummaryStatistics u = new SummaryStatistics();
@@ -567,14 +568,14 @@ public class RandomDataTest extends Retr
     public void testNextExponential() {
         try {
             randomData.nextExponential(-1);
-            fail("negative mean -- expecting IllegalArgumentException");
-        } catch (IllegalArgumentException ex) {
+            fail("negative mean -- expecting MathIllegalArgumentException");
+        } catch (MathIllegalArgumentException ex) {
             // ignored
         }
         try {
             randomData.nextExponential(0);
-            fail("zero mean -- expecting IllegalArgumentException");
-        } catch (IllegalArgumentException ex) {
+            fail("zero mean -- expecting MathIllegalArgumentException");
+        } catch (MathIllegalArgumentException ex) {
             // ignored
         }
         long cumFreq = 0;
@@ -688,8 +689,8 @@ public class RandomDataTest extends Retr
         // Make sure we fail for sample size > collection size
         try {
             one = randomData.nextSample(hs, 2);
-            fail("sample size > set size, expecting IllegalArgumentException");
-        } catch (IllegalArgumentException ex) {
+            fail("sample size > set size, expecting MathIllegalArgumentException");
+        } catch (MathIllegalArgumentException ex) {
             // ignored
         }
 
@@ -697,8 +698,8 @@ public class RandomDataTest extends Retr
         try {
             hs = new HashSet<Object>();
             one = randomData.nextSample(hs, 0);
-            fail("n = k = 0, expecting IllegalArgumentException");
-        } catch (IllegalArgumentException ex) {
+            fail("n = k = 0, expecting MathIllegalArgumentException");
+        } catch (MathIllegalArgumentException ex) {
             // ignored
         }
     }
@@ -746,24 +747,24 @@ public class RandomDataTest extends Retr
             // Make sure we fail for k size > n
             try {
                 perm = randomData.nextPermutation(2, 3);
-                fail("permutation k > n, expecting IllegalArgumentException");
-            } catch (IllegalArgumentException ex) {
+                fail("permutation k > n, expecting MathIllegalArgumentException");
+            } catch (MathIllegalArgumentException ex) {
                 // ignored
             }
 
             // Make sure we fail for n = 0
             try {
                 perm = randomData.nextPermutation(0, 0);
-                fail("permutation k = n = 0, expecting IllegalArgumentException");
-            } catch (IllegalArgumentException ex) {
+                fail("permutation k = n = 0, expecting MathIllegalArgumentException");
+            } catch (MathIllegalArgumentException ex) {
                 // ignored
             }
 
             // Make sure we fail for k < n < 0
             try {
                 perm = randomData.nextPermutation(-1, -3);
-                fail("permutation k < n < 0, expecting IllegalArgumentException");
-            } catch (IllegalArgumentException ex) {
+                fail("permutation k < n < 0, expecting MathIllegalArgumentException");
+            } catch (MathIllegalArgumentException ex) {
                 // ignored
             }
 

Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math/random/Well1024aTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/random/Well1024aTest.java?rev=1044186&r1=1044185&r2=1044186&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/random/Well1024aTest.java (original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/random/Well1024aTest.java Fri Dec 10 00:50:50 2010
@@ -19,6 +19,7 @@ package org.apache.commons.math.random;
 import org.junit.Assert;
 
 import org.apache.commons.math.stat.descriptive.SummaryStatistics;
+import org.apache.commons.math.exception.MathIllegalArgumentException;
 import org.apache.commons.math.util.FastMath;
 import org.junit.Test;
 
@@ -61,7 +62,7 @@ public class Well1024aTest {
                      0.003);
     }
 
-    @Test(expected=java.lang.IllegalArgumentException.class)
+    @Test(expected=MathIllegalArgumentException.class)
     public void testNextIntNeg() {
         new Well1024a(1).nextInt(-1);
     }

Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math/stat/StatUtilsTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/stat/StatUtilsTest.java?rev=1044186&r1=1044185&r2=1044186&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/stat/StatUtilsTest.java (original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/stat/StatUtilsTest.java Fri Dec 10 00:50:50 2010
@@ -21,6 +21,7 @@ import junit.framework.TestCase;
 import org.apache.commons.math.TestUtils;
 import org.apache.commons.math.stat.descriptive.DescriptiveStatistics;
 import org.apache.commons.math.util.FastMath;
+import org.apache.commons.math.exception.MathIllegalArgumentException;
 
 /**
  * Test cases for the {@link StatUtils} class.
@@ -119,14 +120,14 @@ public final class StatUtilsTest extends
         try {
             StatUtils.sumSq(x);
             fail("null is not a valid data array.");
-        } catch (IllegalArgumentException ex) {
+        } catch (MathIllegalArgumentException ex) {
             // success
         }
 
         try {
             StatUtils.sumSq(x, 0, 4);
             fail("null is not a valid data array.");
-        } catch (IllegalArgumentException ex) {
+        } catch (MathIllegalArgumentException ex) {
             // success
         }
 
@@ -153,14 +154,14 @@ public final class StatUtilsTest extends
         try {
             StatUtils.product(x);
             fail("null is not a valid data array.");
-        } catch (IllegalArgumentException ex) {
+        } catch (MathIllegalArgumentException ex) {
             // success
         }
 
         try {
             StatUtils.product(x, 0, 4);
             fail("null is not a valid data array.");
-        } catch (IllegalArgumentException ex) {
+        } catch (MathIllegalArgumentException ex) {
             // success
         }
 
@@ -187,14 +188,14 @@ public final class StatUtilsTest extends
         try {
             StatUtils.sumLog(x);
             fail("null is not a valid data array.");
-        } catch (IllegalArgumentException ex) {
+        } catch (MathIllegalArgumentException ex) {
             // success
         }
 
         try {
             StatUtils.sumLog(x, 0, 4);
             fail("null is not a valid data array.");
-        } catch (IllegalArgumentException ex) {
+        } catch (MathIllegalArgumentException ex) {
             // success
         }
 
@@ -220,7 +221,7 @@ public final class StatUtilsTest extends
         try {
             StatUtils.mean(x, 0, 4);
             fail("null is not a valid data array.");
-        } catch (IllegalArgumentException ex) {
+        } catch (MathIllegalArgumentException ex) {
             // success
         }
 
@@ -243,7 +244,7 @@ public final class StatUtilsTest extends
         try {
             StatUtils.variance(x, 0, 4);
             fail("null is not a valid data array.");
-        } catch (IllegalArgumentException ex) {
+        } catch (MathIllegalArgumentException ex) {
             // success
         }
 
@@ -270,7 +271,7 @@ public final class StatUtilsTest extends
         try {
             StatUtils.max(x, 0, 4);
             fail("null is not a valid data array.");
-        } catch (IllegalArgumentException ex) {
+        } catch (MathIllegalArgumentException ex) {
             // success
         }
 
@@ -309,7 +310,7 @@ public final class StatUtilsTest extends
         try {
             StatUtils.min(x, 0, 4);
             fail("null is not a valid data array.");
-        } catch (IllegalArgumentException ex) {
+        } catch (MathIllegalArgumentException ex) {
             // success
         }
 
@@ -349,14 +350,14 @@ public final class StatUtilsTest extends
         try {
             StatUtils.percentile(x, .25);
             fail("null is not a valid data array.");
-        } catch (IllegalArgumentException ex) {
+        } catch (MathIllegalArgumentException ex) {
             // success
         }
 
         try {
             StatUtils.percentile(x, 0, 4, 0.25);
             fail("null is not a valid data array.");
-        } catch (IllegalArgumentException ex) {
+        } catch (MathIllegalArgumentException ex) {
             // success
         }
 
@@ -388,21 +389,21 @@ public final class StatUtilsTest extends
                 StatUtils.variance(diff), tolerance);
         try {
             StatUtils.meanDifference(sample1, small);
-            fail("Expecting IllegalArgumentException");
-        } catch (IllegalArgumentException ex) {
+            fail("Expecting MathIllegalArgumentException");
+        } catch (MathIllegalArgumentException ex) {
             // expected
         }
         try {
             StatUtils.varianceDifference(sample1, small, meanDifference);
-            fail("Expecting IllegalArgumentException");
-        } catch (IllegalArgumentException ex) {
+            fail("Expecting MathIllegalArgumentException");
+        } catch (MathIllegalArgumentException ex) {
             // expected
         }
         try {
             double[] single = {1.0};
             StatUtils.varianceDifference(single, single, meanDifference);
-            fail("Expecting IllegalArgumentException");
-        } catch (IllegalArgumentException ex) {
+            fail("Expecting MathIllegalArgumentException");
+        } catch (MathIllegalArgumentException ex) {
             // expected
         }
     }
@@ -411,8 +412,8 @@ public final class StatUtilsTest extends
         double[] test = null;
         try {
             StatUtils.geometricMean(test);
-            fail("Expecting IllegalArgumentException");
-        } catch (IllegalArgumentException ex) {
+            fail("Expecting MathIllegalArgumentException");
+        } catch (MathIllegalArgumentException ex) {
             // expected
         }
         test = new double[] {2, 4, 6, 8};

Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math/stat/descriptive/AbstractUnivariateStatisticTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/stat/descriptive/AbstractUnivariateStatisticTest.java?rev=1044186&r1=1044185&r2=1044186&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/stat/descriptive/AbstractUnivariateStatisticTest.java (original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/stat/descriptive/AbstractUnivariateStatisticTest.java Fri Dec 10 00:50:50 2010
@@ -18,6 +18,7 @@ package org.apache.commons.math.stat.des
 
 import junit.framework.TestCase;
 
+import org.apache.commons.math.exception.MathIllegalArgumentException;
 import org.apache.commons.math.stat.descriptive.moment.Mean;
 
 /**
@@ -53,50 +54,50 @@ public class AbstractUnivariateStatistic
         assertFalse(testStatistic.test(testArray, 0, 0));
         try {
             testStatistic.test(singletonArray, 2, 1);  // start past end
-            fail("Expecting IllegalArgumentException");
-        } catch (IllegalArgumentException ex) {
+            fail("Expecting MathIllegalArgumentException");
+        } catch (MathIllegalArgumentException ex) {
             // expected
         }
         try {
             testStatistic.test(testArray, 0, 7);  // end past end
-            fail("Expecting IllegalArgumentException");
-        } catch (IllegalArgumentException ex) {
+            fail("Expecting MathIllegalArgumentException");
+        } catch (MathIllegalArgumentException ex) {
             // expected
         }
         try {
             testStatistic.test(testArray, -1, 1);  // start negative
-            fail("Expecting IllegalArgumentException");
-        } catch (IllegalArgumentException ex) {
+            fail("Expecting MathIllegalArgumentException");
+        } catch (MathIllegalArgumentException ex) {
             // expected
         }
         try {
             testStatistic.test(testArray, 0, -1);  // length negative
-            fail("Expecting IllegalArgumentException");
-        } catch (IllegalArgumentException ex) {
+            fail("Expecting MathIllegalArgumentException");
+        } catch (MathIllegalArgumentException ex) {
             // expected
         }
         try {
             testStatistic.test(nullArray, 0, 1);  // null array
-            fail("Expecting IllegalArgumentException");
-        } catch (IllegalArgumentException ex) {
+            fail("Expecting MathIllegalArgumentException");
+        } catch (MathIllegalArgumentException ex) {
             // expected
         }
         try {
             testStatistic.test(testArray, nullArray, 0, 1);  // null weights array
-            fail("Expecting IllegalArgumentException");
-        } catch (IllegalArgumentException ex) {
+            fail("Expecting MathIllegalArgumentException");
+        } catch (MathIllegalArgumentException ex) {
             // expected
         }
         try {
             testStatistic.test(singletonArray, testWeightsArray, 0, 1);  // weights.length != value.length
-            fail("Expecting IllegalArgumentException");
-        } catch (IllegalArgumentException ex) {
+            fail("Expecting MathIllegalArgumentException");
+        } catch (MathIllegalArgumentException ex) {
             // expected
         }
         try {
             testStatistic.test(testArray, testNegativeWeightsArray, 0, 6);  // can't have negative weights
-            fail("Expecting IllegalArgumentException");
-        } catch (IllegalArgumentException ex) {
+            fail("Expecting MathIllegalArgumentException");
+        } catch (MathIllegalArgumentException ex) {
             // expected
         }
     }

Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math/stat/descriptive/moment/SemiVarianceTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/stat/descriptive/moment/SemiVarianceTest.java?rev=1044186&r1=1044185&r2=1044186&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/stat/descriptive/moment/SemiVarianceTest.java (original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/stat/descriptive/moment/SemiVarianceTest.java Fri Dec 10 00:50:50 2010
@@ -19,6 +19,7 @@ package org.apache.commons.math.stat.des
 
 import org.apache.commons.math.TestUtils;
 import org.apache.commons.math.stat.StatUtils;
+import org.apache.commons.math.exception.MathIllegalArgumentException;
 
 import junit.framework.TestCase;
 
@@ -30,14 +31,14 @@ public class SemiVarianceTest extends Te
         try {
             sv.evaluate(nothing);
             fail("null is not a valid data array.");
-        } catch (IllegalArgumentException iae) {
+        } catch (MathIllegalArgumentException iae) {
         }
 
         try {
             sv.setVarianceDirection(SemiVariance.UPSIDE_VARIANCE);
             sv.evaluate(nothing);
             fail("null is not a valid data array.");
-        } catch (IllegalArgumentException iae) {
+        } catch (MathIllegalArgumentException iae) {
         }
         nothing = new double[] {};
         assertTrue(Double.isNaN(sv.evaluate(nothing)));

Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math/stat/descriptive/rank/PercentileTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/stat/descriptive/rank/PercentileTest.java?rev=1044186&r1=1044185&r2=1044186&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/stat/descriptive/rank/PercentileTest.java (original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/stat/descriptive/rank/PercentileTest.java Fri Dec 10 00:50:50 2010
@@ -18,6 +18,7 @@ package org.apache.commons.math.stat.des
 
 import org.apache.commons.math.stat.descriptive.UnivariateStatistic;
 import org.apache.commons.math.stat.descriptive.UnivariateStatisticAbstractTest;
+import org.apache.commons.math.exception.MathIllegalArgumentException;
 
 /**
  * Test cases for the {@link UnivariateStatistic} class.
@@ -71,13 +72,13 @@ public class PercentileTest extends Univ
         try {
             p.evaluate(d, 0, d.length, -1.0);
             fail();
-        } catch (IllegalArgumentException ex) {
+        } catch (MathIllegalArgumentException ex) {
             // success
         }
         try {
             p.evaluate(d, 0, d.length, 101.0);
             fail();
-        } catch (IllegalArgumentException ex) {
+        } catch (MathIllegalArgumentException ex) {
             // success
         }
     }
@@ -102,8 +103,8 @@ public class PercentileTest extends Univ
         double[] emptyArray = new double[] {};
         try {
             percentile.evaluate(nullArray);
-            fail("Expecting IllegalArgumentException for null array");
-        } catch (IllegalArgumentException ex) {
+            fail("Expecting MathIllegalArgumentException for null array");
+        } catch (MathIllegalArgumentException ex) {
             // expected
         }
         assertTrue(Double.isNaN(percentile.evaluate(emptyArray)));
@@ -144,14 +145,14 @@ public class PercentileTest extends Univ
         assertEquals(100, percentile.getQuantile(), 0);
         try {
             percentile.setQuantile(0);
-            fail("Expecting IllegalArgumentException");
-        } catch (IllegalArgumentException ex) {
+            fail("Expecting MathIllegalArgumentException");
+        } catch (MathIllegalArgumentException ex) {
             // expected
         }
         try {
             new Percentile(0);
-            fail("Expecting IllegalArgumentException");
-        } catch (IllegalArgumentException ex) {
+            fail("Expecting MathIllegalArgumentException");
+        } catch (MathIllegalArgumentException ex) {
             // expected
         }
     }

Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math/stat/inference/ChiSquareTestTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/stat/inference/ChiSquareTestTest.java?rev=1044186&r1=1044185&r2=1044186&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/stat/inference/ChiSquareTestTest.java (original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/stat/inference/ChiSquareTestTest.java Fri Dec 10 00:50:50 2010
@@ -16,6 +16,8 @@
  */
 package org.apache.commons.math.stat.inference;
 
+import org.apache.commons.math.exception.MathIllegalArgumentException;
+
 import junit.framework.TestCase;
 
 /**
@@ -53,8 +55,8 @@ public class ChiSquareTestTest extends T
 
         try {
             testStatistic.chiSquareTest(expected1, observed1, 95);
-            fail("alpha out of range, IllegalArgumentException expected");
-        } catch (IllegalArgumentException ex) {
+            fail("alpha out of range, MathIllegalArgumentException expected");
+        } catch (MathIllegalArgumentException ex) {
             // expected
         }
 
@@ -62,8 +64,8 @@ public class ChiSquareTestTest extends T
         double[] tooShortEx = { 1 };
         try {
             testStatistic.chiSquare(tooShortEx, tooShortObs);
-            fail("arguments too short, IllegalArgumentException expected");
-        } catch (IllegalArgumentException ex) {
+            fail("arguments too short, MathIllegalArgumentException expected");
+        } catch (MathIllegalArgumentException ex) {
             // expected
         }
 
@@ -72,8 +74,8 @@ public class ChiSquareTestTest extends T
         double[] unMatchedEx = { 1, 1, 2 };
         try {
             testStatistic.chiSquare(unMatchedEx, unMatchedObs);
-            fail("arrays have different lengths, IllegalArgumentException expected");
-        } catch (IllegalArgumentException ex) {
+            fail("arrays have different lengths, MathIllegalArgumentException expected");
+        } catch (MathIllegalArgumentException ex) {
             // expected
         }
 
@@ -81,8 +83,8 @@ public class ChiSquareTestTest extends T
         expected[0] = 0;
         try {
             testStatistic.chiSquareTest(expected, observed, .01);
-            fail("bad expected count, IllegalArgumentException expected");
-        } catch (IllegalArgumentException ex) {
+            fail("bad expected count, MathIllegalArgumentException expected");
+        } catch (MathIllegalArgumentException ex) {
             // expected
         }
 
@@ -91,8 +93,8 @@ public class ChiSquareTestTest extends T
         observed[0] = -1;
         try {
             testStatistic.chiSquareTest(expected, observed, .01);
-            fail("bad expected count, IllegalArgumentException expected");
-        } catch (IllegalArgumentException ex) {
+            fail("bad expected count, MathIllegalArgumentException expected");
+        } catch (MathIllegalArgumentException ex) {
             // expected
         }
 
@@ -117,8 +119,8 @@ public class ChiSquareTestTest extends T
         long[][] counts3 = { {40, 22, 43}, {91, 21, 28}, {60, 10}};
         try {
             testStatistic.chiSquare(counts3);
-            fail("Expecting IllegalArgumentException");
-        } catch (IllegalArgumentException ex) {
+            fail("Expecting MathIllegalArgumentException");
+        } catch (MathIllegalArgumentException ex) {
             // expected
         }
 
@@ -126,15 +128,15 @@ public class ChiSquareTestTest extends T
         long[][] counts4 = {{40, 22, 43}};
         try {
             testStatistic.chiSquare(counts4);
-            fail("Expecting IllegalArgumentException");
-        } catch (IllegalArgumentException ex) {
+            fail("Expecting MathIllegalArgumentException");
+        } catch (MathIllegalArgumentException ex) {
             // expected
         }
         long[][] counts5 = {{40}, {40}, {30}, {10}};
         try {
             testStatistic.chiSquare(counts5);
-            fail("Expecting IllegalArgumentException");
-        } catch (IllegalArgumentException ex) {
+            fail("Expecting MathIllegalArgumentException");
+        } catch (MathIllegalArgumentException ex) {
             // expected
         }
 
@@ -142,16 +144,16 @@ public class ChiSquareTestTest extends T
         long[][] counts6 = {{10, -2}, {30, 40}, {60, 90} };
         try {
             testStatistic.chiSquare(counts6);
-            fail("Expecting IllegalArgumentException");
-        } catch (IllegalArgumentException ex) {
+            fail("Expecting MathIllegalArgumentException");
+        } catch (MathIllegalArgumentException ex) {
             // expected
         }
 
         // bad alpha
         try {
             testStatistic.chiSquareTest(counts, 0);
-            fail("Expecting IllegalArgumentException");
-        } catch (IllegalArgumentException ex) {
+            fail("Expecting MathIllegalArgumentException");
+        } catch (MathIllegalArgumentException ex) {
             // expected
         }
     }
@@ -225,8 +227,8 @@ public class ChiSquareTestTest extends T
         try {
             testStatistic.chiSquareTestDataSetsComparison(
                     observed1, observed2);
-            fail("Expecting IllegalArgumentException - negative count");
-        } catch (IllegalArgumentException ex) {
+            fail("Expecting MathIllegalArgumentException - negative count");
+        } catch (MathIllegalArgumentException ex) {
             // expected
         }
         long[] observed3 = {10, 0, 12, 10, 15};
@@ -234,8 +236,8 @@ public class ChiSquareTestTest extends T
         try {
             testStatistic.chiSquareTestDataSetsComparison(
                     observed3, observed4);
-            fail("Expecting IllegalArgumentException - double 0's");
-        } catch (IllegalArgumentException ex) {
+            fail("Expecting MathIllegalArgumentException - double 0's");
+        } catch (MathIllegalArgumentException ex) {
             // expected
         }
         long[] observed5 = {10, 10, 12, 10, 15};
@@ -243,8 +245,8 @@ public class ChiSquareTestTest extends T
         try {
             testStatistic.chiSquareTestDataSetsComparison(
                     observed5, observed6);
-            fail("Expecting IllegalArgumentException - vanishing counts");
-        } catch (IllegalArgumentException ex) {
+            fail("Expecting MathIllegalArgumentException - vanishing counts");
+        } catch (MathIllegalArgumentException ex) {
             // expected
         }
     }

Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math/stat/inference/TTestTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/stat/inference/TTestTest.java?rev=1044186&r1=1044185&r2=1044186&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/stat/inference/TTestTest.java (original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/stat/inference/TTestTest.java Fri Dec 10 00:50:50 2010
@@ -18,13 +18,14 @@ package org.apache.commons.math.stat.inf
 
 import junit.framework.TestCase;
 
+import org.apache.commons.math.exception.MathIllegalArgumentException;
 import org.apache.commons.math.stat.descriptive.SummaryStatistics;
+
 /**
  * Test cases for the TTestImpl class.
  *
  * @version $Revision$ $Date$
  */
-
 public class TTestTest extends TestCase {
 
     protected TTest testStatistic = new TTestImpl();
@@ -66,55 +67,55 @@ public class TTestTest extends TestCase 
 
         try {
             testStatistic.t(mu, (double[]) null);
-            fail("arguments too short, IllegalArgumentException expected");
-        } catch (IllegalArgumentException ex) {
+            fail("arguments too short, MathIllegalArgumentException expected");
+        } catch (MathIllegalArgumentException ex) {
             // expected
         }
 
         try {
             testStatistic.t(mu, (SummaryStatistics) null);
-            fail("arguments too short, IllegalArgumentException expected");
-        } catch (IllegalArgumentException ex) {
+            fail("arguments too short, MathIllegalArgumentException expected");
+        } catch (MathIllegalArgumentException ex) {
             // expected
         }
 
         try {
             testStatistic.t(mu, emptyObs);
-            fail("arguments too short, IllegalArgumentException expected");
-        } catch (IllegalArgumentException ex) {
+            fail("arguments too short, MathIllegalArgumentException expected");
+        } catch (MathIllegalArgumentException ex) {
             // expected
         }
 
         try {
             testStatistic.t(mu, emptyStats);
-            fail("arguments too short, IllegalArgumentException expected");
-        } catch (IllegalArgumentException ex) {
+            fail("arguments too short, MathIllegalArgumentException expected");
+        } catch (MathIllegalArgumentException ex) {
             // expected
         }
 
         try {
             testStatistic.t(mu, tooShortObs);
-            fail("insufficient data to compute t statistic, IllegalArgumentException expected");
-        } catch (IllegalArgumentException ex) {
+            fail("insufficient data to compute t statistic, MathIllegalArgumentException expected");
+        } catch (MathIllegalArgumentException ex) {
             // expected
         }
         try {
             testStatistic.tTest(mu, tooShortObs);
-            fail("insufficient data to perform t test, IllegalArgumentException expected");
-        } catch (IllegalArgumentException ex) {
+            fail("insufficient data to perform t test, MathIllegalArgumentException expected");
+        } catch (MathIllegalArgumentException ex) {
            // expected
         }
 
         try {
             testStatistic.t(mu, tooShortStats);
-            fail("insufficient data to compute t statistic, IllegalArgumentException expected");
-        } catch (IllegalArgumentException ex) {
+            fail("insufficient data to compute t statistic, MathIllegalArgumentException expected");
+        } catch (MathIllegalArgumentException ex) {
             // expected
         }
         try {
             testStatistic.tTest(mu, tooShortStats);
-            fail("insufficient data to perform t test, IllegalArgumentException expected");
-        } catch (IllegalArgumentException ex) {
+            fail("insufficient data to perform t test, MathIllegalArgumentException expected");
+        } catch (MathIllegalArgumentException ex) {
             // expected
         }
     }
@@ -142,15 +143,15 @@ public class TTestTest extends TestCase 
 
         try {
             testStatistic.tTest(0d, oneSidedP, 95);
-            fail("alpha out of range, IllegalArgumentException expected");
-        } catch (IllegalArgumentException ex) {
+            fail("alpha out of range, MathIllegalArgumentException expected");
+        } catch (MathIllegalArgumentException ex) {
             // expected
         }
 
         try {
             testStatistic.tTest(0d, oneSidedPStats, 95);
-            fail("alpha out of range, IllegalArgumentException expected");
-        } catch (IllegalArgumentException ex) {
+            fail("alpha out of range, MathIllegalArgumentException expected");
+        } catch (MathIllegalArgumentException ex) {
             // expected
         }
 
@@ -188,57 +189,57 @@ public class TTestTest extends TestCase 
 
         try {
             testStatistic.tTest(sample1, sample2, .95);
-            fail("alpha out of range, IllegalArgumentException expected");
-        } catch (IllegalArgumentException ex) {
+            fail("alpha out of range, MathIllegalArgumentException expected");
+        } catch (MathIllegalArgumentException ex) {
             // expected
         }
 
         try {
             testStatistic.tTest(sampleStats1, sampleStats2, .95);
-            fail("alpha out of range, IllegalArgumentException expected");
-        } catch (IllegalArgumentException ex) {
+            fail("alpha out of range, MathIllegalArgumentException expected");
+        } catch (MathIllegalArgumentException ex) {
             // expected
         }
 
         try {
             testStatistic.tTest(sample1, tooShortObs, .01);
-            fail("insufficient data, IllegalArgumentException expected");
-        } catch (IllegalArgumentException ex) {
+            fail("insufficient data, MathIllegalArgumentException expected");
+        } catch (MathIllegalArgumentException ex) {
             // expected
         }
 
         try {
             testStatistic.tTest(sampleStats1, tooShortStats, .01);
-            fail("insufficient data, IllegalArgumentException expected");
-        } catch (IllegalArgumentException ex) {
+            fail("insufficient data, MathIllegalArgumentException expected");
+        } catch (MathIllegalArgumentException ex) {
             // expected
         }
 
         try {
             testStatistic.tTest(sample1, tooShortObs);
-            fail("insufficient data, IllegalArgumentException expected");
-        } catch (IllegalArgumentException ex) {
+            fail("insufficient data, MathIllegalArgumentException expected");
+        } catch (MathIllegalArgumentException ex) {
            // expected
         }
 
         try {
             testStatistic.tTest(sampleStats1, tooShortStats);
-            fail("insufficient data, IllegalArgumentException expected");
-        } catch (IllegalArgumentException ex) {
+            fail("insufficient data, MathIllegalArgumentException expected");
+        } catch (MathIllegalArgumentException ex) {
             // expected
         }
 
         try {
             testStatistic.t(sample1, tooShortObs);
-            fail("insufficient data, IllegalArgumentException expected");
-        } catch (IllegalArgumentException ex) {
+            fail("insufficient data, MathIllegalArgumentException expected");
+        } catch (MathIllegalArgumentException ex) {
             // expected
         }
 
         try {
             testStatistic.t(sampleStats1, tooShortStats);
-            fail("insufficient data, IllegalArgumentException expected");
-        } catch (IllegalArgumentException ex) {
+            fail("insufficient data, MathIllegalArgumentException expected");
+        } catch (MathIllegalArgumentException ex) {
            // expected
         }
     }



Mime
View raw message