From 93c2fa919fa1f7733ea30c33ce7ee97abca4fd1c Mon Sep 17 00:00:00 2001 From: Frederik Petersen Date: Wed, 7 Jan 2015 19:26:17 +0100 Subject: [PATCH] Replaced anyOf Hamcrest matcher as its not found on build server --- .../sap/sailing/polars/test/CubicEquationTest.java | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/java/com.sap.sailing.polars.test/src/com/sap/sailing/polars/test/CubicEquationTest.java b/java/com.sap.sailing.polars.test/src/com/sap/sailing/polars/test/CubicEquationTest.java index 91cd3d407b6..4fa9d36e6fe 100644 --- a/java/com.sap.sailing.polars.test/src/com/sap/sailing/polars/test/CubicEquationTest.java +++ b/java/com.sap.sailing.polars.test/src/com/sap/sailing/polars/test/CubicEquationTest.java @@ -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); }