Replaced anyOf Hamcrest matcher as its not found on build server

This commit is contained in:
Frederik Petersen committed 2015-01-07 19:26:17 +01:00
1 parent c851d962d3
commit 93c2fa919f
1 file changed
+4 -7
@@ -1,9 +1,9 @@
package com.sap.sailing.polars.test;
import static org.hamcrest.Matchers.anyOf;
import static org.hamcrest.Matchers.closeTo;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
import org.junit.Test;
@@ -36,7 +36,6 @@ public class CubicEquationTest {
}
@SuppressWarnings("unchecked")
@Test
public void testThreeRealRoots() {
CubicEquation eq = new CubicEquation(2, -4, -22, 24);
@@ -44,15 +43,13 @@ public class CubicEquationTest {
assertThat(result.length, is(3));
double x1 = result[0];
assertThat(x1, anyOf(closeTo(4, ERROR),closeTo(-3, ERROR),closeTo(1, ERROR)));
assertTrue(Math.abs(x1 - 4) < ERROR || x1 + 3 < ERROR || x1 -1 < ERROR);
double x2 = result[1];
assertThat(x2, anyOf(closeTo(4, ERROR),closeTo(-3, ERROR),closeTo(1, ERROR)));
assertTrue(Math.abs(x2 - 4) < ERROR || x2 + 3 < ERROR || x2 -1 < ERROR);
double x3 = result[2];
assertThat(x3, anyOf(closeTo(4, ERROR),closeTo(-3, ERROR),closeTo(1, ERROR)));
assertTrue(Math.abs(x3 - 4) < ERROR || x3 + 3 < ERROR || x3 -1 < ERROR);
}