commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From er...@apache.org
Subject svn commit: r1079350 [3/6] - in /commons/proper/math/trunk/src: main/java/org/apache/commons/math/exception/ main/java/org/apache/commons/math/linear/ main/java/org/apache/commons/math/optimization/general/ main/java/org/apache/commons/math/random/ tes...
Date Tue, 08 Mar 2011 13:42:18 GMT
Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/BlockFieldMatrixTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/BlockFieldMatrixTest.java?rev=1079350&r1=1079349&r2=1079350&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/BlockFieldMatrixTest.java (original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/BlockFieldMatrixTest.java Tue Mar  8 13:42:16 2011
@@ -19,18 +19,17 @@ package org.apache.commons.math.linear;
 import java.util.Arrays;
 import java.util.Random;
 
-import junit.framework.TestCase;
+import org.junit.Test;
+import org.junit.Assert;
 
 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.MatrixDimensionMismatchException;
 import org.apache.commons.math.exception.NoDataException;
 import org.apache.commons.math.exception.OutOfRangeException;
 import org.apache.commons.math.exception.NumberIsTooSmallException;
 import org.apache.commons.math.exception.NotStrictlyPositiveException;
-import org.apache.commons.math.exception.NonSquareMatrixException;
 import org.apache.commons.math.exception.MathIllegalArgumentException;
 
 /**
@@ -39,7 +38,7 @@ import org.apache.commons.math.exception
  * @version $Revision$ $Date$
  */
 
-public final class BlockFieldMatrixTest extends TestCase {
+public final class BlockFieldMatrixTest {
 
     // 3 x 3 identity matrix
     protected Fraction[][] id = {
@@ -158,34 +157,33 @@ public final class BlockFieldMatrixTest 
     protected double entryTolerance = 10E-16;
     protected double normTolerance = 10E-14;
 
-    public BlockFieldMatrixTest(String name) {
-        super(name);
-    }
-
     /** test dimensions */
+    @Test
     public void testDimensions() {
         BlockFieldMatrix<Fraction> m = new BlockFieldMatrix<Fraction>(testData);
         BlockFieldMatrix<Fraction> m2 = new BlockFieldMatrix<Fraction>(testData2);
-        assertEquals("testData row dimension",3,m.getRowDimension());
-        assertEquals("testData column dimension",3,m.getColumnDimension());
-        assertTrue("testData is square",m.isSquare());
-        assertEquals("testData2 row dimension",m2.getRowDimension(),2);
-        assertEquals("testData2 column dimension",m2.getColumnDimension(),3);
-        assertTrue("testData2 is not square",!m2.isSquare());
+        Assert.assertEquals("testData row dimension",3,m.getRowDimension());
+        Assert.assertEquals("testData column dimension",3,m.getColumnDimension());
+        Assert.assertTrue("testData is square",m.isSquare());
+        Assert.assertEquals("testData2 row dimension",m2.getRowDimension(),2);
+        Assert.assertEquals("testData2 column dimension",m2.getColumnDimension(),3);
+        Assert.assertTrue("testData2 is not square",!m2.isSquare());
     }
 
     /** test copy functions */
+    @Test
     public void testCopyFunctions() {
         Random r = new Random(66636328996002l);
         BlockFieldMatrix<Fraction> m1 = createRandomMatrix(r, 47, 83);
         BlockFieldMatrix<Fraction> m2 = new BlockFieldMatrix<Fraction>(m1.getData());
-        assertEquals(m1, m2);
+        Assert.assertEquals(m1, m2);
         BlockFieldMatrix<Fraction> m3 = new BlockFieldMatrix<Fraction>(testData);
         BlockFieldMatrix<Fraction> m4 = new BlockFieldMatrix<Fraction>(m3.getData());
-        assertEquals(m3, m4);
+        Assert.assertEquals(m3, m4);
     }
 
     /** test add */
+    @Test
     public void testAdd() {
         BlockFieldMatrix<Fraction> m = new BlockFieldMatrix<Fraction>(testData);
         BlockFieldMatrix<Fraction> mInv = new BlockFieldMatrix<Fraction>(testDataInv);
@@ -193,38 +191,41 @@ public final class BlockFieldMatrixTest 
         Fraction[][] sumEntries = mPlusMInv.getData();
         for (int row = 0; row < m.getRowDimension(); row++) {
             for (int col = 0; col < m.getColumnDimension(); col++) {
-                assertEquals(testDataPlusInv[row][col],sumEntries[row][col]);
+                Assert.assertEquals(testDataPlusInv[row][col],sumEntries[row][col]);
             }
         }
     }
 
     /** test add failure */
+    @Test
     public void testAddFail() {
         BlockFieldMatrix<Fraction> m = new BlockFieldMatrix<Fraction>(testData);
         BlockFieldMatrix<Fraction> m2 = new BlockFieldMatrix<Fraction>(testData2);
         try {
             m.add(m2);
-            fail("MathIllegalArgumentException expected");
+            Assert.fail("MathIllegalArgumentException expected");
         } catch (MathIllegalArgumentException ex) {
             // ignored
         }
     }
 
      /** test m-n = m + -n */
+    @Test
     public void testPlusMinus() {
         BlockFieldMatrix<Fraction> m = new BlockFieldMatrix<Fraction>(testData);
         BlockFieldMatrix<Fraction> m2 = new BlockFieldMatrix<Fraction>(testDataInv);
         TestUtils.assertEquals(m.subtract(m2), m2.scalarMultiply(new Fraction(-1)).add(m));
         try {
             m.subtract(new BlockFieldMatrix<Fraction>(testData2));
-            fail("Expecting illegalArgumentException");
+            Assert.fail("Expecting illegalArgumentException");
         } catch (MathIllegalArgumentException ex) {
             // ignored
         }
     }
 
     /** test multiply */
-     public void testMultiply() {
+    @Test
+    public void testMultiply() {
         BlockFieldMatrix<Fraction> m = new BlockFieldMatrix<Fraction>(testData);
         BlockFieldMatrix<Fraction> mInv = new BlockFieldMatrix<Fraction>(testDataInv);
         BlockFieldMatrix<Fraction> identity = new BlockFieldMatrix<Fraction>(id);
@@ -236,14 +237,14 @@ public final class BlockFieldMatrixTest 
         TestUtils.assertEquals(m2.multiply(identity), m2);
         try {
             m.multiply(new BlockFieldMatrix<Fraction>(bigSingular));
-            fail("Expecting illegalArgumentException");
+            Assert.fail("Expecting illegalArgumentException");
         } catch (MathIllegalArgumentException ex) {
             // expected
         }
     }
 
+    @Test
     public void testSeveralBlocks() {
-
         FieldMatrix<Fraction> m =
             new BlockFieldMatrix<Fraction>(FractionField.getInstance(), 37, 41);
         for (int i = 0; i < m.getRowDimension(); ++i) {
@@ -253,25 +254,25 @@ public final class BlockFieldMatrixTest 
         }
 
         FieldMatrix<Fraction> mT = m.transpose();
-        assertEquals(m.getRowDimension(), mT.getColumnDimension());
-        assertEquals(m.getColumnDimension(), mT.getRowDimension());
+        Assert.assertEquals(m.getRowDimension(), mT.getColumnDimension());
+        Assert.assertEquals(m.getColumnDimension(), mT.getRowDimension());
         for (int i = 0; i < mT.getRowDimension(); ++i) {
             for (int j = 0; j < mT.getColumnDimension(); ++j) {
-                assertEquals(m.getEntry(j, i), mT.getEntry(i, j));
+                Assert.assertEquals(m.getEntry(j, i), mT.getEntry(i, j));
             }
         }
 
         FieldMatrix<Fraction> mPm = m.add(m);
         for (int i = 0; i < mPm.getRowDimension(); ++i) {
             for (int j = 0; j < mPm.getColumnDimension(); ++j) {
-                assertEquals(m.getEntry(i, j).multiply(new Fraction(2)), mPm.getEntry(i, j));
+                Assert.assertEquals(m.getEntry(i, j).multiply(new Fraction(2)), mPm.getEntry(i, j));
             }
         }
 
         FieldMatrix<Fraction> mPmMm = mPm.subtract(m);
         for (int i = 0; i < mPmMm.getRowDimension(); ++i) {
             for (int j = 0; j < mPmMm.getColumnDimension(); ++j) {
-                assertEquals(m.getEntry(i, j), mPmMm.getEntry(i, j));
+                Assert.assertEquals(m.getEntry(i, j), mPmMm.getEntry(i, j));
             }
         }
 
@@ -282,7 +283,7 @@ public final class BlockFieldMatrixTest 
                 for (int k = 0; k < mT.getColumnDimension(); ++k) {
                     sum = sum.add(new Fraction(k * 11 + i, 11).multiply(new Fraction(k * 11 + j, 11)));
                 }
-                assertEquals(sum, mTm.getEntry(i, j));
+                Assert.assertEquals(sum, mTm.getEntry(i, j));
             }
         }
 
@@ -293,35 +294,35 @@ public final class BlockFieldMatrixTest 
                 for (int k = 0; k < m.getColumnDimension(); ++k) {
                     sum = sum.add(new Fraction(i * 11 + k, 11).multiply(new Fraction(j * 11 + k, 11)));
                 }
-                assertEquals(sum, mmT.getEntry(i, j));
+                Assert.assertEquals(sum, mmT.getEntry(i, j));
             }
         }
 
         FieldMatrix<Fraction> sub1 = m.getSubMatrix(2, 9, 5, 20);
         for (int i = 0; i < sub1.getRowDimension(); ++i) {
             for (int j = 0; j < sub1.getColumnDimension(); ++j) {
-                assertEquals(new Fraction((i + 2) * 11 + (j + 5), 11), sub1.getEntry(i, j));
+                Assert.assertEquals(new Fraction((i + 2) * 11 + (j + 5), 11), sub1.getEntry(i, j));
             }
         }
 
         FieldMatrix<Fraction> sub2 = m.getSubMatrix(10, 12, 3, 40);
         for (int i = 0; i < sub2.getRowDimension(); ++i) {
             for (int j = 0; j < sub2.getColumnDimension(); ++j) {
-                assertEquals(new Fraction((i + 10) * 11 + (j + 3), 11), sub2.getEntry(i, j));
+                Assert.assertEquals(new Fraction((i + 10) * 11 + (j + 3), 11), sub2.getEntry(i, j));
             }
         }
 
         FieldMatrix<Fraction> sub3 = m.getSubMatrix(30, 34, 0, 5);
         for (int i = 0; i < sub3.getRowDimension(); ++i) {
             for (int j = 0; j < sub3.getColumnDimension(); ++j) {
-                assertEquals(new Fraction((i + 30) * 11 + (j + 0), 11), sub3.getEntry(i, j));
+                Assert.assertEquals(new Fraction((i + 30) * 11 + (j + 0), 11), sub3.getEntry(i, j));
             }
         }
 
         FieldMatrix<Fraction> sub4 = m.getSubMatrix(30, 32, 32, 35);
         for (int i = 0; i < sub4.getRowDimension(); ++i) {
             for (int j = 0; j < sub4.getColumnDimension(); ++j) {
-                assertEquals(new Fraction((i + 30) * 11 + (j + 32), 11), sub4.getEntry(i, j));
+                Assert.assertEquals(new Fraction((i + 30) * 11 + (j + 32), 11), sub4.getEntry(i, j));
             }
         }
 
@@ -341,6 +342,7 @@ public final class BlockFieldMatrixTest 
     };
     private Fraction[][] d5 = new Fraction[][] {{new Fraction(30)},{new Fraction(70)}};
 
+    @Test
     public void testMultiply2() {
        FieldMatrix<Fraction> m3 = new BlockFieldMatrix<Fraction>(d3);
        FieldMatrix<Fraction> m4 = new BlockFieldMatrix<Fraction>(d4);
@@ -349,19 +351,21 @@ public final class BlockFieldMatrixTest 
    }
 
     /** test trace */
+    @Test
     public void testTrace() {
         FieldMatrix<Fraction> m = new BlockFieldMatrix<Fraction>(id);
-        assertEquals(new Fraction(3),m.getTrace());
+        Assert.assertEquals(new Fraction(3),m.getTrace());
         m = new BlockFieldMatrix<Fraction>(testData2);
         try {
             m.getTrace();
-            fail("Expecting NonSquareMatrixException");
+            Assert.fail("Expecting NonSquareMatrixException");
         } catch (NonSquareMatrixException ex) {
             // ignored
         }
     }
 
     /** test scalarAdd */
+    @Test
     public void testScalarAdd() {
         FieldMatrix<Fraction> m = new BlockFieldMatrix<Fraction>(testData);
         TestUtils.assertEquals(new BlockFieldMatrix<Fraction>(testDataPlus2),
@@ -369,6 +373,7 @@ public final class BlockFieldMatrixTest 
     }
 
     /** test operate */
+    @Test
     public void testOperate() {
         FieldMatrix<Fraction> m = new BlockFieldMatrix<Fraction>(id);
         TestUtils.assertEquals(testVector, m.operate(testVector));
@@ -376,12 +381,13 @@ public final class BlockFieldMatrixTest 
         m = new BlockFieldMatrix<Fraction>(bigSingular);
         try {
             m.operate(testVector);
-            fail("Expecting illegalArgumentException");
+            Assert.fail("Expecting illegalArgumentException");
         } catch (MathIllegalArgumentException ex) {
             // ignored
         }
     }
 
+    @Test
     public void testOperateLarge() {
         int p = (11 * BlockFieldMatrix.BLOCK_SIZE) / 10;
         int q = (11 * BlockFieldMatrix.BLOCK_SIZE) / 10;
@@ -395,6 +401,7 @@ public final class BlockFieldMatrixTest 
         }
     }
 
+    @Test
     public void testOperatePremultiplyLarge() {
         int p = (11 * BlockFieldMatrix.BLOCK_SIZE) / 10;
         int q = (11 * BlockFieldMatrix.BLOCK_SIZE) / 10;
@@ -409,6 +416,7 @@ public final class BlockFieldMatrixTest 
     }
 
     /** test issue MATH-209 */
+    @Test
     public void testMath209() {
         FieldMatrix<Fraction> a = new BlockFieldMatrix<Fraction>(new Fraction[][] {
                 { new Fraction(1), new Fraction(2) },
@@ -416,13 +424,14 @@ public final class BlockFieldMatrixTest 
                 { new Fraction(5), new Fraction(6) }
         });
         Fraction[] b = a.operate(new Fraction[] { new Fraction(1), new Fraction(1) });
-        assertEquals(a.getRowDimension(), b.length);
-        assertEquals( new Fraction(3), b[0]);
-        assertEquals( new Fraction(7), b[1]);
-        assertEquals(new Fraction(11), b[2]);
+        Assert.assertEquals(a.getRowDimension(), b.length);
+        Assert.assertEquals( new Fraction(3), b[0]);
+        Assert.assertEquals( new Fraction(7), b[1]);
+        Assert.assertEquals(new Fraction(11), b[2]);
     }
 
     /** test transpose */
+    @Test
     public void testTranspose() {
         FieldMatrix<Fraction> m = new BlockFieldMatrix<Fraction>(testData);
         FieldMatrix<Fraction> mIT = new FieldLUDecompositionImpl<Fraction>(m).getSolver().getInverse().transpose();
@@ -434,6 +443,7 @@ public final class BlockFieldMatrixTest 
     }
 
     /** test preMultiply by vector */
+    @Test
     public void testPremultiplyVector() {
         FieldMatrix<Fraction> m = new BlockFieldMatrix<Fraction>(testData);
         TestUtils.assertEquals(m.preMultiply(testVector), preMultTest);
@@ -442,12 +452,13 @@ public final class BlockFieldMatrixTest 
         m = new BlockFieldMatrix<Fraction>(bigSingular);
         try {
             m.preMultiply(testVector);
-            fail("expecting MathIllegalArgumentException");
+            Assert.fail("expecting MathIllegalArgumentException");
         } catch (MathIllegalArgumentException ex) {
             // ignored
         }
     }
 
+    @Test
     public void testPremultiply() {
         FieldMatrix<Fraction> m3 = new BlockFieldMatrix<Fraction>(d3);
         FieldMatrix<Fraction> m4 = new BlockFieldMatrix<Fraction>(d4);
@@ -463,42 +474,45 @@ public final class BlockFieldMatrixTest 
         TestUtils.assertEquals(identity.preMultiply(mInv), mInv);
         try {
             m.preMultiply(new BlockFieldMatrix<Fraction>(bigSingular));
-            fail("Expecting illegalArgumentException");
+            Assert.fail("Expecting illegalArgumentException");
         } catch (MathIllegalArgumentException ex) {
             // ignored
         }
     }
 
+    @Test
     public void testGetVectors() {
         FieldMatrix<Fraction> m = new BlockFieldMatrix<Fraction>(testData);
         TestUtils.assertEquals(m.getRow(0), testDataRow1);
         TestUtils.assertEquals(m.getColumn(2), testDataCol3);
         try {
             m.getRow(10);
-            fail("expecting OutOfRangeException");
+            Assert.fail("expecting OutOfRangeException");
         } catch (OutOfRangeException ex) {
             // ignored
         }
         try {
             m.getColumn(-1);
-            fail("expecting OutOfRangeException");
+            Assert.fail("expecting OutOfRangeException");
         } catch (OutOfRangeException ex) {
             // ignored
         }
     }
 
+    @Test
     public void testGetEntry() {
         FieldMatrix<Fraction> m = new BlockFieldMatrix<Fraction>(testData);
-        assertEquals(m.getEntry(0,1),new Fraction(2));
+        Assert.assertEquals(m.getEntry(0,1),new Fraction(2));
         try {
             m.getEntry(10, 4);
-            fail ("Expecting OutOfRangeException");
+            Assert.fail ("Expecting OutOfRangeException");
         } catch (OutOfRangeException ex) {
             // expected
         }
     }
 
     /** test examples in user guide */
+    @Test
     public void testExamples() {
         // Create a real matrix with two rows and three columns
         Fraction[][] matrixData = {
@@ -515,12 +529,12 @@ public final class BlockFieldMatrixTest 
         FieldMatrix<Fraction> n = new BlockFieldMatrix<Fraction>(matrixData2);
         // Now multiply m by n
         FieldMatrix<Fraction> p = m.multiply(n);
-        assertEquals(2, p.getRowDimension());
-        assertEquals(2, p.getColumnDimension());
+        Assert.assertEquals(2, p.getRowDimension());
+        Assert.assertEquals(2, p.getColumnDimension());
         // Invert p
         FieldMatrix<Fraction> pInverse = new FieldLUDecompositionImpl<Fraction>(p).getSolver().getInverse();
-        assertEquals(2, pInverse.getRowDimension());
-        assertEquals(2, pInverse.getColumnDimension());
+        Assert.assertEquals(2, pInverse.getRowDimension());
+        Assert.assertEquals(2, pInverse.getColumnDimension());
 
         // Solve example
         Fraction[][] coefficientsData = {
@@ -531,15 +545,15 @@ public final class BlockFieldMatrixTest 
         FieldMatrix<Fraction> coefficients = new BlockFieldMatrix<Fraction>(coefficientsData);
         Fraction[] constants = {new Fraction(1), new Fraction(-2), new Fraction(1)};
         Fraction[] solution = new FieldLUDecompositionImpl<Fraction>(coefficients).getSolver().solve(constants);
-        assertEquals(new Fraction(2).multiply(solution[0]).
+        Assert.assertEquals(new Fraction(2).multiply(solution[0]).
                      add(new Fraction(3).multiply(solution[1])).
                      subtract(new Fraction(2).multiply(solution[2])),
                      constants[0]);
-        assertEquals(new Fraction(-1).multiply(solution[0]).
+        Assert.assertEquals(new Fraction(-1).multiply(solution[0]).
                      add(new Fraction(7).multiply(solution[1])).
                      add(new Fraction(6).multiply(solution[2])),
                      constants[1]);
-        assertEquals(new Fraction(4).multiply(solution[0]).
+        Assert.assertEquals(new Fraction(4).multiply(solution[0]).
                      subtract(new Fraction(3).multiply(solution[1])).
                      subtract(new Fraction(5).multiply(solution[2])),
                      constants[2]);
@@ -547,6 +561,7 @@ public final class BlockFieldMatrixTest 
     }
 
     // test submatrix accessors
+    @Test
     public void testGetSubMatrix() {
         FieldMatrix<Fraction> m = new BlockFieldMatrix<Fraction>(subTestData);
         checkGetSubMatrix(m, subRows23Cols00,  2 , 3 , 0, 0);
@@ -571,9 +586,9 @@ public final class BlockFieldMatrixTest 
         try {
             FieldMatrix<Fraction> sub = m.getSubMatrix(startRow, endRow, startColumn, endColumn);
             if (reference != null) {
-                assertEquals(new BlockFieldMatrix<Fraction>(reference), sub);
+                Assert.assertEquals(new BlockFieldMatrix<Fraction>(reference), sub);
             } else {
-                fail("Expecting OutOfRangeException or NotStrictlyPositiveException"
+                Assert.fail("Expecting OutOfRangeException or NotStrictlyPositiveException"
                      + " or NumberIsTooSmallException or NoDataException");
             }
         } catch (OutOfRangeException e) {
@@ -600,9 +615,9 @@ public final class BlockFieldMatrixTest 
         try {
             FieldMatrix<Fraction> sub = m.getSubMatrix(selectedRows, selectedColumns);
             if (reference != null) {
-                assertEquals(new BlockFieldMatrix<Fraction>(reference), sub);
+                Assert.assertEquals(new BlockFieldMatrix<Fraction>(reference), sub);
             } else {
-                fail("Expecting OutOfRangeException");
+                Assert.fail("Expecting OutOfRangeException");
             }
         } catch (OutOfRangeException e) {
             if (reference != null) {
@@ -623,6 +638,7 @@ public final class BlockFieldMatrixTest 
         }
     }
 
+    @Test
     public void testGetSetMatrixLarge() {
         int n = 3 * BlockFieldMatrix.BLOCK_SIZE;
         FieldMatrix<Fraction> m =
@@ -634,16 +650,16 @@ public final class BlockFieldMatrixTest 
         for (int i = 0; i < n; ++i) {
             for (int j = 0; j < n; ++j) {
                 if ((i < 2) || (i > n - 3) || (j < 2) || (j > n - 3)) {
-                    assertEquals(new Fraction(0), m.getEntry(i, j));
+                    Assert.assertEquals(new Fraction(0), m.getEntry(i, j));
                 } else {
-                    assertEquals(new Fraction(1), m.getEntry(i, j));
+                    Assert.assertEquals(new Fraction(1), m.getEntry(i, j));
                 }
             }
         }
-        assertEquals(sub, m.getSubMatrix(2, n - 3, 2, n - 3));
-
+        Assert.assertEquals(sub, m.getSubMatrix(2, n - 3, 2, n - 3));
     }
 
+    @Test
     public void testCopySubMatrix() {
         FieldMatrix<Fraction> m = new BlockFieldMatrix<Fraction>(subTestData);
         checkCopy(m, subRows23Cols00,  2 , 3 , 0, 0);
@@ -672,9 +688,9 @@ public final class BlockFieldMatrixTest 
                              new Fraction[reference.length][reference[0].length];
             m.copySubMatrix(startRow, endRow, startColumn, endColumn, sub);
             if (reference != null) {
-                assertEquals(new BlockFieldMatrix<Fraction>(reference), new BlockFieldMatrix<Fraction>(sub));
+                Assert.assertEquals(new BlockFieldMatrix<Fraction>(reference), new BlockFieldMatrix<Fraction>(sub));
             } else {
-                fail("Expecting OutOfRangeException or NumberIsTooSmallException or NoDataException");
+                Assert.fail("Expecting OutOfRangeException or NumberIsTooSmallException or NoDataException");
             }
         } catch (OutOfRangeException e) {
             if (reference != null) {
@@ -699,9 +715,9 @@ public final class BlockFieldMatrixTest 
                     new Fraction[reference.length][reference[0].length];
             m.copySubMatrix(selectedRows, selectedColumns, sub);
             if (reference != null) {
-                assertEquals(new BlockFieldMatrix<Fraction>(reference), new BlockFieldMatrix<Fraction>(sub));
+                Assert.assertEquals(new BlockFieldMatrix<Fraction>(reference), new BlockFieldMatrix<Fraction>(sub));
             } else {
-                fail("Expecting OutOfRangeException or NumberIsTooSmallException or NoDataException");
+                Assert.fail("Expecting OutOfRangeException or NumberIsTooSmallException or NoDataException");
             }
         } catch (OutOfRangeException e) {
             if (reference != null) {
@@ -718,46 +734,49 @@ public final class BlockFieldMatrixTest 
         }
     }
 
+    @Test
     public void testGetRowMatrix() {
         FieldMatrix<Fraction> m     = new BlockFieldMatrix<Fraction>(subTestData);
         FieldMatrix<Fraction> mRow0 = new BlockFieldMatrix<Fraction>(subRow0);
         FieldMatrix<Fraction> mRow3 = new BlockFieldMatrix<Fraction>(subRow3);
-        assertEquals("Row0", mRow0, m.getRowMatrix(0));
-        assertEquals("Row3", mRow3, m.getRowMatrix(3));
+        Assert.assertEquals("Row0", mRow0, m.getRowMatrix(0));
+        Assert.assertEquals("Row3", mRow3, m.getRowMatrix(3));
         try {
             m.getRowMatrix(-1);
-            fail("Expecting OutOfRangeException");
+            Assert.fail("Expecting OutOfRangeException");
         } catch (OutOfRangeException ex) {
             // expected
         }
         try {
             m.getRowMatrix(4);
-            fail("Expecting OutOfRangeException");
+            Assert.fail("Expecting OutOfRangeException");
         } catch (OutOfRangeException ex) {
             // expected
         }
     }
 
+    @Test
     public void testSetRowMatrix() {
         FieldMatrix<Fraction> m = new BlockFieldMatrix<Fraction>(subTestData);
         FieldMatrix<Fraction> mRow3 = new BlockFieldMatrix<Fraction>(subRow3);
-        assertNotSame(mRow3, m.getRowMatrix(0));
+        Assert.assertNotSame(mRow3, m.getRowMatrix(0));
         m.setRowMatrix(0, mRow3);
-        assertEquals(mRow3, m.getRowMatrix(0));
+        Assert.assertEquals(mRow3, m.getRowMatrix(0));
         try {
             m.setRowMatrix(-1, mRow3);
-            fail("Expecting OutOfRangeException");
+            Assert.fail("Expecting OutOfRangeException");
         } catch (OutOfRangeException ex) {
             // expected
         }
         try {
             m.setRowMatrix(0, m);
-            fail("Expecting MatrixDimensionMismatchException");
+            Assert.fail("Expecting MatrixDimensionMismatchException");
         } catch (MatrixDimensionMismatchException ex) {
             // expected
         }
     }
 
+    @Test
     public void testGetSetRowMatrixLarge() {
         int n = 3 * BlockFieldMatrix.BLOCK_SIZE;
         FieldMatrix<Fraction> m =
@@ -769,56 +788,59 @@ public final class BlockFieldMatrixTest 
         for (int i = 0; i < n; ++i) {
             for (int j = 0; j < n; ++j) {
                 if (i != 2) {
-                    assertEquals(new Fraction(0), m.getEntry(i, j));
+                    Assert.assertEquals(new Fraction(0), m.getEntry(i, j));
                 } else {
-                    assertEquals(new Fraction(1), m.getEntry(i, j));
+                    Assert.assertEquals(new Fraction(1), m.getEntry(i, j));
                 }
             }
         }
-        assertEquals(sub, m.getRowMatrix(2));
+        Assert.assertEquals(sub, m.getRowMatrix(2));
 
     }
 
+    @Test
     public void testGetColumnMatrix() {
         FieldMatrix<Fraction> m = new BlockFieldMatrix<Fraction>(subTestData);
         FieldMatrix<Fraction> mColumn1 = new BlockFieldMatrix<Fraction>(subColumn1);
         FieldMatrix<Fraction> mColumn3 = new BlockFieldMatrix<Fraction>(subColumn3);
-        assertEquals(mColumn1, m.getColumnMatrix(1));
-        assertEquals(mColumn3, m.getColumnMatrix(3));
+        Assert.assertEquals(mColumn1, m.getColumnMatrix(1));
+        Assert.assertEquals(mColumn3, m.getColumnMatrix(3));
         try {
             m.getColumnMatrix(-1);
-            fail("Expecting OutOfRangeException");
+            Assert.fail("Expecting OutOfRangeException");
         } catch (OutOfRangeException ex) {
             // expected
         }
         try {
             m.getColumnMatrix(4);
-            fail("Expecting OutOfRangeException");
+            Assert.fail("Expecting OutOfRangeException");
         } catch (OutOfRangeException ex) {
             // expected
         }
     }
 
+    @Test
     public void testSetColumnMatrix() {
         FieldMatrix<Fraction> m = new BlockFieldMatrix<Fraction>(subTestData);
         FieldMatrix<Fraction> mColumn3 = new BlockFieldMatrix<Fraction>(subColumn3);
-        assertNotSame(mColumn3, m.getColumnMatrix(1));
+        Assert.assertNotSame(mColumn3, m.getColumnMatrix(1));
         m.setColumnMatrix(1, mColumn3);
-        assertEquals(mColumn3, m.getColumnMatrix(1));
+        Assert.assertEquals(mColumn3, m.getColumnMatrix(1));
         try {
             m.setColumnMatrix(-1, mColumn3);
-            fail("Expecting OutOfRangeException");
+            Assert.fail("Expecting OutOfRangeException");
         } catch (OutOfRangeException ex) {
             // expected
         }
         try {
             m.setColumnMatrix(0, m);
-            fail("Expecting MatrixDimensionMismatchException");
+            Assert.fail("Expecting MatrixDimensionMismatchException");
         } catch (MatrixDimensionMismatchException ex) {
             // expected
         }
     }
 
+    @Test
     public void testGetSetColumnMatrixLarge() {
         int n = 3 * BlockFieldMatrix.BLOCK_SIZE;
         FieldMatrix<Fraction> m =
@@ -830,56 +852,59 @@ public final class BlockFieldMatrixTest 
         for (int i = 0; i < n; ++i) {
             for (int j = 0; j < n; ++j) {
                 if (j != 2) {
-                    assertEquals(new Fraction(0), m.getEntry(i, j));
+                    Assert.assertEquals(new Fraction(0), m.getEntry(i, j));
                 } else {
-                    assertEquals(new Fraction(1), m.getEntry(i, j));
+                    Assert.assertEquals(new Fraction(1), m.getEntry(i, j));
                 }
             }
         }
-        assertEquals(sub, m.getColumnMatrix(2));
+        Assert.assertEquals(sub, m.getColumnMatrix(2));
 
     }
 
+    @Test
     public void testGetRowVector() {
         FieldMatrix<Fraction> m = new BlockFieldMatrix<Fraction>(subTestData);
         FieldVector<Fraction> mRow0 = new ArrayFieldVector<Fraction>(subRow0[0]);
         FieldVector<Fraction> mRow3 = new ArrayFieldVector<Fraction>(subRow3[0]);
-        assertEquals(mRow0, m.getRowVector(0));
-        assertEquals(mRow3, m.getRowVector(3));
+        Assert.assertEquals(mRow0, m.getRowVector(0));
+        Assert.assertEquals(mRow3, m.getRowVector(3));
         try {
             m.getRowVector(-1);
-            fail("Expecting OutOfRangeException");
+            Assert.fail("Expecting OutOfRangeException");
         } catch (OutOfRangeException ex) {
             // expected
         }
         try {
             m.getRowVector(4);
-            fail("Expecting OutOfRangeException");
+            Assert.fail("Expecting OutOfRangeException");
         } catch (OutOfRangeException ex) {
             // expected
         }
     }
 
+    @Test
     public void testSetRowVector() {
         FieldMatrix<Fraction> m = new BlockFieldMatrix<Fraction>(subTestData);
         FieldVector<Fraction> mRow3 = new ArrayFieldVector<Fraction>(subRow3[0]);
-        assertNotSame(mRow3, m.getRowMatrix(0));
+        Assert.assertNotSame(mRow3, m.getRowMatrix(0));
         m.setRowVector(0, mRow3);
-        assertEquals(mRow3, m.getRowVector(0));
+        Assert.assertEquals(mRow3, m.getRowVector(0));
         try {
             m.setRowVector(-1, mRow3);
-            fail("Expecting OutOfRangeException");
+            Assert.fail("Expecting OutOfRangeException");
         } catch (OutOfRangeException ex) {
             // expected
         }
         try {
             m.setRowVector(0, new ArrayFieldVector<Fraction>(FractionField.getInstance(), 5));
-            fail("Expecting MatrixDimensionMismatchException");
+            Assert.fail("Expecting MatrixDimensionMismatchException");
         } catch (MatrixDimensionMismatchException ex) {
             // expected
         }
     }
 
+    @Test
     public void testGetSetRowVectorLarge() {
         int n = 3 * BlockFieldMatrix.BLOCK_SIZE;
         FieldMatrix<Fraction> m = new BlockFieldMatrix<Fraction>(FractionField.getInstance(), n, n);
@@ -889,56 +914,59 @@ public final class BlockFieldMatrixTest 
         for (int i = 0; i < n; ++i) {
             for (int j = 0; j < n; ++j) {
                 if (i != 2) {
-                    assertEquals(new Fraction(0), m.getEntry(i, j));
+                    Assert.assertEquals(new Fraction(0), m.getEntry(i, j));
                 } else {
-                    assertEquals(new Fraction(1), m.getEntry(i, j));
+                    Assert.assertEquals(new Fraction(1), m.getEntry(i, j));
                 }
             }
         }
-        assertEquals(sub, m.getRowVector(2));
+        Assert.assertEquals(sub, m.getRowVector(2));
 
     }
 
+    @Test
     public void testGetColumnVector() {
         FieldMatrix<Fraction> m = new BlockFieldMatrix<Fraction>(subTestData);
         FieldVector<Fraction> mColumn1 = columnToVector(subColumn1);
         FieldVector<Fraction> mColumn3 = columnToVector(subColumn3);
-        assertEquals(mColumn1, m.getColumnVector(1));
-        assertEquals(mColumn3, m.getColumnVector(3));
+        Assert.assertEquals(mColumn1, m.getColumnVector(1));
+        Assert.assertEquals(mColumn3, m.getColumnVector(3));
         try {
             m.getColumnVector(-1);
-            fail("Expecting OutOfRangeException");
+            Assert.fail("Expecting OutOfRangeException");
         } catch (OutOfRangeException ex) {
             // expected
         }
         try {
             m.getColumnVector(4);
-            fail("Expecting OutOfRangeException");
+            Assert.fail("Expecting OutOfRangeException");
         } catch (OutOfRangeException ex) {
             // expected
         }
     }
 
+    @Test
     public void testSetColumnVector() {
         FieldMatrix<Fraction> m = new BlockFieldMatrix<Fraction>(subTestData);
         FieldVector<Fraction> mColumn3 = columnToVector(subColumn3);
-        assertNotSame(mColumn3, m.getColumnVector(1));
+        Assert.assertNotSame(mColumn3, m.getColumnVector(1));
         m.setColumnVector(1, mColumn3);
-        assertEquals(mColumn3, m.getColumnVector(1));
+        Assert.assertEquals(mColumn3, m.getColumnVector(1));
         try {
             m.setColumnVector(-1, mColumn3);
-            fail("Expecting OutOfRangeException");
+            Assert.fail("Expecting OutOfRangeException");
         } catch (OutOfRangeException ex) {
             // expected
         }
         try {
             m.setColumnVector(0, new ArrayFieldVector<Fraction>(FractionField.getInstance(), 5));
-            fail("Expecting MatrixDimensionMismatchException");
+            Assert.fail("Expecting MatrixDimensionMismatchException");
         } catch (MatrixDimensionMismatchException ex) {
             // expected
         }
     }
 
+    @Test
     public void testGetSetColumnVectorLarge() {
         int n = 3 * BlockFieldMatrix.BLOCK_SIZE;
         FieldMatrix<Fraction> m = new BlockFieldMatrix<Fraction>(FractionField.getInstance(), n, n);
@@ -948,13 +976,13 @@ public final class BlockFieldMatrixTest 
         for (int i = 0; i < n; ++i) {
             for (int j = 0; j < n; ++j) {
                 if (j != 2) {
-                    assertEquals(new Fraction(0), m.getEntry(i, j));
+                    Assert.assertEquals(new Fraction(0), m.getEntry(i, j));
                 } else {
-                    assertEquals(new Fraction(1), m.getEntry(i, j));
+                    Assert.assertEquals(new Fraction(1), m.getEntry(i, j));
                 }
             }
         }
-        assertEquals(sub, m.getColumnVector(2));
+        Assert.assertEquals(sub, m.getColumnVector(2));
 
     }
 
@@ -966,43 +994,46 @@ public final class BlockFieldMatrixTest 
         return new ArrayFieldVector<Fraction>(data, false);
     }
 
+    @Test
     public void testGetRow() {
         FieldMatrix<Fraction> m = new BlockFieldMatrix<Fraction>(subTestData);
         checkArrays(subRow0[0], m.getRow(0));
         checkArrays(subRow3[0], m.getRow(3));
         try {
             m.getRow(-1);
-            fail("Expecting OutOfRangeException");
+            Assert.fail("Expecting OutOfRangeException");
         } catch (OutOfRangeException ex) {
             // expected
         }
         try {
             m.getRow(4);
-            fail("Expecting OutOfRangeException");
+            Assert.fail("Expecting OutOfRangeException");
         } catch (OutOfRangeException ex) {
             // expected
         }
     }
 
+    @Test
     public void testSetRow() {
         FieldMatrix<Fraction> m = new BlockFieldMatrix<Fraction>(subTestData);
-        assertTrue(subRow3[0][0] != m.getRow(0)[0]);
+        Assert.assertTrue(subRow3[0][0] != m.getRow(0)[0]);
         m.setRow(0, subRow3[0]);
         checkArrays(subRow3[0], m.getRow(0));
         try {
             m.setRow(-1, subRow3[0]);
-            fail("Expecting OutOfRangeException");
+            Assert.fail("Expecting OutOfRangeException");
         } catch (OutOfRangeException ex) {
             // expected
         }
         try {
             m.setRow(0, new Fraction[5]);
-            fail("Expecting MatrixDimensionMismatchException");
+            Assert.fail("Expecting MatrixDimensionMismatchException");
         } catch (MatrixDimensionMismatchException ex) {
             // expected
         }
     }
 
+    @Test
     public void testGetSetRowLarge() {
         int n = 3 * BlockFieldMatrix.BLOCK_SIZE;
         FieldMatrix<Fraction> m = new BlockFieldMatrix<Fraction>(FractionField.getInstance(), n, n);
@@ -1013,9 +1044,9 @@ public final class BlockFieldMatrixTest 
         for (int i = 0; i < n; ++i) {
             for (int j = 0; j < n; ++j) {
                 if (i != 2) {
-                    assertEquals(new Fraction(0), m.getEntry(i, j));
+                    Assert.assertEquals(new Fraction(0), m.getEntry(i, j));
                 } else {
-                    assertEquals(new Fraction(1), m.getEntry(i, j));
+                    Assert.assertEquals(new Fraction(1), m.getEntry(i, j));
                 }
             }
         }
@@ -1023,6 +1054,7 @@ public final class BlockFieldMatrixTest 
 
     }
 
+    @Test
     public void testGetColumn() {
         FieldMatrix<Fraction> m = new BlockFieldMatrix<Fraction>(subTestData);
         Fraction[] mColumn1 = columnToArray(subColumn1);
@@ -1031,38 +1063,40 @@ public final class BlockFieldMatrixTest 
         checkArrays(mColumn3, m.getColumn(3));
         try {
             m.getColumn(-1);
-            fail("Expecting OutOfRangeException");
+            Assert.fail("Expecting OutOfRangeException");
         } catch (OutOfRangeException ex) {
             // expected
         }
         try {
             m.getColumn(4);
-            fail("Expecting OutOfRangeException");
+            Assert.fail("Expecting OutOfRangeException");
         } catch (OutOfRangeException ex) {
             // expected
         }
     }
 
+    @Test
     public void testSetColumn() {
         FieldMatrix<Fraction> m = new BlockFieldMatrix<Fraction>(subTestData);
         Fraction[] mColumn3 = columnToArray(subColumn3);
-        assertTrue(mColumn3[0] != m.getColumn(1)[0]);
+        Assert.assertTrue(mColumn3[0] != m.getColumn(1)[0]);
         m.setColumn(1, mColumn3);
         checkArrays(mColumn3, m.getColumn(1));
         try {
             m.setColumn(-1, mColumn3);
-            fail("Expecting OutOfRangeException");
+            Assert.fail("Expecting OutOfRangeException");
         } catch (OutOfRangeException ex) {
             // expected
         }
         try {
             m.setColumn(0, new Fraction[5]);
-            fail("Expecting MatrixDimensionMismatchException");
+            Assert.fail("Expecting MatrixDimensionMismatchException");
         } catch (MatrixDimensionMismatchException ex) {
             // expected
         }
     }
 
+    @Test
     public void testGetSetColumnLarge() {
         int n = 3 * BlockFieldMatrix.BLOCK_SIZE;
         FieldMatrix<Fraction> m = new BlockFieldMatrix<Fraction>(FractionField.getInstance(), n, n);
@@ -1073,9 +1107,9 @@ public final class BlockFieldMatrixTest 
         for (int i = 0; i < n; ++i) {
             for (int j = 0; j < n; ++j) {
                 if (j != 2) {
-                    assertEquals(new Fraction(0), m.getEntry(i, j));
+                    Assert.assertEquals(new Fraction(0), m.getEntry(i, j));
                 } else {
-                    assertEquals(new Fraction(1), m.getEntry(i, j));
+                    Assert.assertEquals(new Fraction(1), m.getEntry(i, j));
                 }
             }
         }
@@ -1092,46 +1126,49 @@ public final class BlockFieldMatrixTest 
     }
 
     private void checkArrays(Fraction[] expected, Fraction[] actual) {
-        assertEquals(expected.length, actual.length);
+        Assert.assertEquals(expected.length, actual.length);
         for (int i = 0; i < expected.length; ++i) {
-            assertEquals(expected[i], actual[i]);
+            Assert.assertEquals(expected[i], actual[i]);
         }
     }
 
+    @Test
     public void testEqualsAndHashCode() {
         BlockFieldMatrix<Fraction> m = new BlockFieldMatrix<Fraction>(testData);
         BlockFieldMatrix<Fraction> m1 = (BlockFieldMatrix<Fraction>) m.copy();
         BlockFieldMatrix<Fraction> mt = (BlockFieldMatrix<Fraction>) m.transpose();
-        assertTrue(m.hashCode() != mt.hashCode());
-        assertEquals(m.hashCode(), m1.hashCode());
-        assertEquals(m, m);
-        assertEquals(m, m1);
-        assertFalse(m.equals(null));
-        assertFalse(m.equals(mt));
-        assertFalse(m.equals(new BlockFieldMatrix<Fraction>(bigSingular)));
+        Assert.assertTrue(m.hashCode() != mt.hashCode());
+        Assert.assertEquals(m.hashCode(), m1.hashCode());
+        Assert.assertEquals(m, m);
+        Assert.assertEquals(m, m1);
+        Assert.assertFalse(m.equals(null));
+        Assert.assertFalse(m.equals(mt));
+        Assert.assertFalse(m.equals(new BlockFieldMatrix<Fraction>(bigSingular)));
     }
 
+    @Test
     public void testToString() {
         BlockFieldMatrix<Fraction> m = new BlockFieldMatrix<Fraction>(testData);
-        assertEquals("BlockFieldMatrix{{1,2,3},{2,5,3},{1,0,8}}", m.toString());
+        Assert.assertEquals("BlockFieldMatrix{{1,2,3},{2,5,3},{1,0,8}}", m.toString());
     }
 
+    @Test
     public void testSetSubMatrix() throws Exception {
         BlockFieldMatrix<Fraction> m = new BlockFieldMatrix<Fraction>(testData);
         m.setSubMatrix(detData2,1,1);
         FieldMatrix<Fraction> expected = new BlockFieldMatrix<Fraction>
             (new Fraction[][] {{new Fraction(1),new Fraction(2),new Fraction(3)},{new Fraction(2),new Fraction(1),new Fraction(3)},{new Fraction(1),new Fraction(2),new Fraction(4)}});
-        assertEquals(expected, m);
+        Assert.assertEquals(expected, m);
 
         m.setSubMatrix(detData2,0,0);
         expected = new BlockFieldMatrix<Fraction>
             (new Fraction[][] {{new Fraction(1),new Fraction(3),new Fraction(3)},{new Fraction(2),new Fraction(4),new Fraction(3)},{new Fraction(1),new Fraction(2),new Fraction(4)}});
-        assertEquals(expected, m);
+        Assert.assertEquals(expected, m);
 
         m.setSubMatrix(testDataPlus2,0,0);
         expected = new BlockFieldMatrix<Fraction>
             (new Fraction[][] {{new Fraction(3),new Fraction(4),new Fraction(5)},{new Fraction(4),new Fraction(7),new Fraction(5)},{new Fraction(3),new Fraction(2),new Fraction(10)}});
-        assertEquals(expected, m);
+        Assert.assertEquals(expected, m);
 
         // javadoc example
         BlockFieldMatrix<Fraction> matrix =
@@ -1150,25 +1187,25 @@ public final class BlockFieldMatrixTest 
                     {new Fraction(5), new Fraction(3), new Fraction(4), new Fraction(8)},
                     {new Fraction(9), new Fraction(5) ,new Fraction(6), new Fraction(2)}
             });
-        assertEquals(expected, matrix);
+        Assert.assertEquals(expected, matrix);
 
         // dimension overflow
         try {
             m.setSubMatrix(testData,1,1);
-            fail("expecting OutOfRangeException");
+            Assert.fail("expecting OutOfRangeException");
         } catch (OutOfRangeException e) {
             // expected
         }
         // dimension underflow
         try {
             m.setSubMatrix(testData,-1,1);
-            fail("expecting OutOfRangeException");
+            Assert.fail("expecting OutOfRangeException");
         } catch (OutOfRangeException e) {
             // expected
         }
         try {
             m.setSubMatrix(testData,1,-1);
-            fail("expecting OutOfRangeException");
+            Assert.fail("expecting OutOfRangeException");
         } catch (OutOfRangeException e) {
             // expected
         }
@@ -1176,7 +1213,7 @@ public final class BlockFieldMatrixTest 
         // null
         try {
             m.setSubMatrix(null,1,1);
-            fail("expecting NullPointerException");
+            Assert.fail("expecting NullPointerException");
         } catch (NullPointerException e) {
             // expected
         }
@@ -1184,7 +1221,7 @@ public final class BlockFieldMatrixTest 
         // ragged
         try {
             m.setSubMatrix(new Fraction[][] {{new Fraction(1)}, {new Fraction(2), new Fraction(3)}}, 0, 0);
-            fail("expecting MathIllegalArgumentException");
+            Assert.fail("expecting MathIllegalArgumentException");
         } catch (MathIllegalArgumentException e) {
             // expected
         }
@@ -1192,13 +1229,13 @@ public final class BlockFieldMatrixTest 
         // empty
         try {
             m.setSubMatrix(new Fraction[][] {{}}, 0, 0);
-            fail("expecting MathIllegalArgumentException");
+            Assert.fail("expecting MathIllegalArgumentException");
         } catch (MathIllegalArgumentException e) {
             // expected
         }
-
     }
 
+    @Test
     public void testWalk() throws MathUserException {
         int rows    = 150;
         int columns = 75;
@@ -1207,87 +1244,88 @@ public final class BlockFieldMatrixTest 
         m.walkInRowOrder(new SetVisitor());
         GetVisitor getVisitor = new GetVisitor();
         m.walkInOptimizedOrder(getVisitor);
-        assertEquals(rows * columns, getVisitor.getCount());
+        Assert.assertEquals(rows * columns, getVisitor.getCount());
 
         m = new BlockFieldMatrix<Fraction>(FractionField.getInstance(), rows, columns);
         m.walkInRowOrder(new SetVisitor(), 1, rows - 2, 1, columns - 2);
         getVisitor = new GetVisitor();
         m.walkInOptimizedOrder(getVisitor, 1, rows - 2, 1, columns - 2);
-        assertEquals((rows - 2) * (columns - 2), getVisitor.getCount());
+        Assert.assertEquals((rows - 2) * (columns - 2), getVisitor.getCount());
         for (int i = 0; i < rows; ++i) {
-            assertEquals(new Fraction(0), m.getEntry(i, 0));
-            assertEquals(new Fraction(0), m.getEntry(i, columns - 1));
+            Assert.assertEquals(new Fraction(0), m.getEntry(i, 0));
+            Assert.assertEquals(new Fraction(0), m.getEntry(i, columns - 1));
         }
         for (int j = 0; j < columns; ++j) {
-            assertEquals(new Fraction(0), m.getEntry(0, j));
-            assertEquals(new Fraction(0), m.getEntry(rows - 1, j));
+            Assert.assertEquals(new Fraction(0), m.getEntry(0, j));
+            Assert.assertEquals(new Fraction(0), m.getEntry(rows - 1, j));
         }
 
         m = new BlockFieldMatrix<Fraction>(FractionField.getInstance(), rows, columns);
         m.walkInColumnOrder(new SetVisitor());
         getVisitor = new GetVisitor();
         m.walkInOptimizedOrder(getVisitor);
-        assertEquals(rows * columns, getVisitor.getCount());
+        Assert.assertEquals(rows * columns, getVisitor.getCount());
 
         m = new BlockFieldMatrix<Fraction>(FractionField.getInstance(), rows, columns);
         m.walkInColumnOrder(new SetVisitor(), 1, rows - 2, 1, columns - 2);
         getVisitor = new GetVisitor();
         m.walkInOptimizedOrder(getVisitor, 1, rows - 2, 1, columns - 2);
-        assertEquals((rows - 2) * (columns - 2), getVisitor.getCount());
+        Assert.assertEquals((rows - 2) * (columns - 2), getVisitor.getCount());
         for (int i = 0; i < rows; ++i) {
-            assertEquals(new Fraction(0), m.getEntry(i, 0));
-            assertEquals(new Fraction(0), m.getEntry(i, columns - 1));
+            Assert.assertEquals(new Fraction(0), m.getEntry(i, 0));
+            Assert.assertEquals(new Fraction(0), m.getEntry(i, columns - 1));
         }
         for (int j = 0; j < columns; ++j) {
-            assertEquals(new Fraction(0), m.getEntry(0, j));
-            assertEquals(new Fraction(0), m.getEntry(rows - 1, j));
+            Assert.assertEquals(new Fraction(0), m.getEntry(0, j));
+            Assert.assertEquals(new Fraction(0), m.getEntry(rows - 1, j));
         }
 
         m = new BlockFieldMatrix<Fraction>(FractionField.getInstance(), rows, columns);
         m.walkInOptimizedOrder(new SetVisitor());
         getVisitor = new GetVisitor();
         m.walkInRowOrder(getVisitor);
-        assertEquals(rows * columns, getVisitor.getCount());
+        Assert.assertEquals(rows * columns, getVisitor.getCount());
 
         m = new BlockFieldMatrix<Fraction>(FractionField.getInstance(), rows, columns);
         m.walkInOptimizedOrder(new SetVisitor(), 1, rows - 2, 1, columns - 2);
         getVisitor = new GetVisitor();
         m.walkInRowOrder(getVisitor, 1, rows - 2, 1, columns - 2);
-        assertEquals((rows - 2) * (columns - 2), getVisitor.getCount());
+        Assert.assertEquals((rows - 2) * (columns - 2), getVisitor.getCount());
         for (int i = 0; i < rows; ++i) {
-            assertEquals(new Fraction(0), m.getEntry(i, 0));
-            assertEquals(new Fraction(0), m.getEntry(i, columns - 1));
+            Assert.assertEquals(new Fraction(0), m.getEntry(i, 0));
+            Assert.assertEquals(new Fraction(0), m.getEntry(i, columns - 1));
         }
         for (int j = 0; j < columns; ++j) {
-            assertEquals(new Fraction(0), m.getEntry(0, j));
-            assertEquals(new Fraction(0), m.getEntry(rows - 1, j));
+            Assert.assertEquals(new Fraction(0), m.getEntry(0, j));
+            Assert.assertEquals(new Fraction(0), m.getEntry(rows - 1, j));
         }
 
         m = new BlockFieldMatrix<Fraction>(FractionField.getInstance(), rows, columns);
         m.walkInOptimizedOrder(new SetVisitor());
         getVisitor = new GetVisitor();
         m.walkInColumnOrder(getVisitor);
-        assertEquals(rows * columns, getVisitor.getCount());
+        Assert.assertEquals(rows * columns, getVisitor.getCount());
 
         m = new BlockFieldMatrix<Fraction>(FractionField.getInstance(), rows, columns);
         m.walkInOptimizedOrder(new SetVisitor(), 1, rows - 2, 1, columns - 2);
         getVisitor = new GetVisitor();
         m.walkInColumnOrder(getVisitor, 1, rows - 2, 1, columns - 2);
-        assertEquals((rows - 2) * (columns - 2), getVisitor.getCount());
+        Assert.assertEquals((rows - 2) * (columns - 2), getVisitor.getCount());
         for (int i = 0; i < rows; ++i) {
-            assertEquals(new Fraction(0), m.getEntry(i, 0));
-            assertEquals(new Fraction(0), m.getEntry(i, columns - 1));
+            Assert.assertEquals(new Fraction(0), m.getEntry(i, 0));
+            Assert.assertEquals(new Fraction(0), m.getEntry(i, columns - 1));
         }
         for (int j = 0; j < columns; ++j) {
-            assertEquals(new Fraction(0), m.getEntry(0, j));
-            assertEquals(new Fraction(0), m.getEntry(rows - 1, j));
+            Assert.assertEquals(new Fraction(0), m.getEntry(0, j));
+            Assert.assertEquals(new Fraction(0), m.getEntry(rows - 1, j));
         }
 
     }
 
+    @Test
     public void testSerial()  {
         BlockFieldMatrix<Fraction> m = new BlockFieldMatrix<Fraction>(testData);
-        assertEquals(m,TestUtils.serializeAndRecover(m));
+        Assert.assertEquals(m,TestUtils.serializeAndRecover(m));
     }
 
     private static class SetVisitor extends DefaultFieldMatrixChangingVisitor<Fraction> {
@@ -1309,7 +1347,7 @@ public final class BlockFieldMatrixTest 
         @Override
         public void visit(int i, int j, Fraction value) {
             ++count;
-            assertEquals(new Fraction(i * 11 + j, 11), value);
+            Assert.assertEquals(new Fraction(i * 11 + j, 11), value);
         }
         public int getCount() {
             return count;
@@ -1331,6 +1369,5 @@ public final class BlockFieldMatrixTest 
         }
         return m;
     }
-
 }
 



Mime
View raw message