commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From celes...@apache.org
Subject svn commit: r1346475 - in /commons/proper/math/trunk/src/test/java/org/apache/commons/math3/linear: ArrayRealVectorTest.java RealVectorAbstractTest.java
Date Tue, 05 Jun 2012 17:11:15 GMT
Author: celestin
Date: Tue Jun  5 17:11:15 2012
New Revision: 1346475

URL: http://svn.apache.org/viewvc?rev=1346475&view=rev
Log:
MATH-795: factored out testCosinePrecondition1(), testCosinePrecondition2() and
testCosinePrecondition3().

Modified:
    commons/proper/math/trunk/src/test/java/org/apache/commons/math3/linear/ArrayRealVectorTest.java
    commons/proper/math/trunk/src/test/java/org/apache/commons/math3/linear/RealVectorAbstractTest.java

Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math3/linear/ArrayRealVectorTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math3/linear/ArrayRealVectorTest.java?rev=1346475&r1=1346474&r2=1346475&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math3/linear/ArrayRealVectorTest.java
(original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math3/linear/ArrayRealVectorTest.java
Tue Jun  5 17:11:15 2012
@@ -506,25 +506,6 @@ public class ArrayRealVectorTest extends
         Assert.assertEquals(0, new ArrayRealVector(new double[0], false).getDimension());
     }
 
-    @Test(expected=MathArithmeticException.class)
-    public void testCosinePrecondition1() {
-        final ArrayRealVector v = new ArrayRealVector(new double[] {0, 0, 0});
-        final ArrayRealVector w = new ArrayRealVector(new double[] {1, 0, 0});
-        v.cosine(w);
-    }
-    @Test(expected=MathArithmeticException.class)
-    public void testCosinePrecondition2() {
-        final ArrayRealVector v = new ArrayRealVector(new double[] {0, 0, 0});
-        final ArrayRealVector w = new ArrayRealVector(new double[] {1, 0, 0});
-        w.cosine(v);
-    }
-    @Test(expected=DimensionMismatchException.class)
-    public void testCosinePrecondition3() {
-        final ArrayRealVector v = new ArrayRealVector(new double[] {1, 2, 3});
-        final ArrayRealVector w = new ArrayRealVector(new double[] {1, 2, 3, 4});
-        v.cosine(w);
-    }
-
     @Test(expected=DimensionMismatchException.class)
     public void testCombinePreconditionSameType() {
         final double a = 1d;

Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math3/linear/RealVectorAbstractTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math3/linear/RealVectorAbstractTest.java?rev=1346475&r1=1346474&r2=1346475&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math3/linear/RealVectorAbstractTest.java
(original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math3/linear/RealVectorAbstractTest.java
Tue Jun  5 17:11:15 2012
@@ -45,6 +45,7 @@ import org.apache.commons.math3.analysis
 import org.apache.commons.math3.analysis.function.Tan;
 import org.apache.commons.math3.analysis.function.Tanh;
 import org.apache.commons.math3.analysis.function.Ulp;
+import org.apache.commons.math3.exception.DimensionMismatchException;
 import org.apache.commons.math3.exception.MathArithmeticException;
 import org.apache.commons.math3.exception.MathIllegalArgumentException;
 import org.apache.commons.math3.exception.NumberIsTooSmallException;
@@ -810,6 +811,27 @@ public abstract class RealVectorAbstract
         Assert.assertEquals(-1, v.cosine(w), normTolerance);
     }
 
+    @Test(expected=MathArithmeticException.class)
+    public void testCosinePrecondition1() {
+        final RealVector v = create(new double[] {0, 0, 0});
+        final RealVector w = create(new double[] {1, 0, 0});
+        v.cosine(w);
+    }
+
+    @Test(expected=MathArithmeticException.class)
+    public void testCosinePrecondition2() {
+        final RealVector v = create(new double[] {0, 0, 0});
+        final RealVector w = create(new double[] {1, 0, 0});
+        w.cosine(v);
+    }
+
+    @Test(expected=DimensionMismatchException.class)
+    public void testCosinePrecondition3() {
+        final RealVector v = create(new double[] {1, 2, 3});
+        final RealVector w = create(new double[] {1, 2, 3, 4});
+        v.cosine(w);
+    }
+
     /*
      * TESTS OF THE VISITOR PATTERN
      */



Mime
View raw message