You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ma...@apache.org on 2020/12/06 15:55:17 UTC
[commons-geometry] branch master updated: GEOMETRY-103 - Migrate to
JUnit 5
This is an automated email from the ASF dual-hosted git repository.
mattjuntunen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-geometry.git
The following commit(s) were added to refs/heads/master by this push:
new 6e0a273 GEOMETRY-103 - Migrate to JUnit 5
6e0a273 is described below
commit 6e0a273e79843f3c470778d28f2027fa00e80e5e
Author: Arturo Bernal <ar...@gmail.com>
AuthorDate: Sat Dec 5 13:32:37 2020 +0100
GEOMETRY-103 - Migrate to JUnit 5
---
commons-geometry-core/pom.xml | 6 +
.../commons/geometry/core/EmbeddingTest.java | 18 +-
.../commons/geometry/core/GeometryTestUtils.java | 34 +-
.../apache/commons/geometry/core/SizedTest.java | 16 +-
.../core/internal/GeometryInternalErrorTest.java | 6 +-
.../core/internal/HyperplaneSubsetsTest.java | 16 +-
.../core/internal/IteratorTransformTest.java | 14 +-
.../core/internal/SimpleTupleFormatTest.java | 119 +++--
.../AbstractConvexHyperplaneBoundedRegionTest.java | 118 ++---
.../core/partitioning/AbstractHyperplaneTest.java | 26 +-
.../geometry/core/partitioning/SplitTest.java | 18 +-
.../bsp/AbstractBSPTreeMergeOperatorTest.java | 272 +++++-----
.../core/partitioning/bsp/AbstractBSPTreeTest.java | 540 +++++++++----------
.../bsp/AbstractPartitionedRegionBuilderTest.java | 58 +-
.../bsp/AbstractRegionBSPTreeBooleanTest.java | 2 +-
.../bsp/AbstractRegionBSPTreeTest.java | 582 ++++++++++-----------
.../core/partitioning/bsp/BSPTreeVisitorTest.java | 14 +-
.../core/partitioning/bsp/MergeChecker.java | 16 +-
.../partitioning/bsp/RegionCutBoundaryTest.java | 50 +-
.../core/partitioning/test/PartitionTestUtils.java | 56 +-
.../core/precision/DoublePrecisionContextTest.java | 106 ++--
.../EpsilonDoublePrecisionContextTest.java | 132 ++---
commons-geometry-enclosing/pom.xml | 6 +
.../enclosing/DocumentationExamplesTest.java | 10 +-
.../geometry/enclosing/EnclosingBallTest.java | 80 +--
.../euclidean/threed/SphereGeneratorTest.java | 118 ++---
.../euclidean/threed/WelzlEncloser3DTest.java | 16 +-
.../euclidean/twod/DiskGeneratorTest.java | 68 +--
.../euclidean/twod/WelzlEncloser2DTest.java | 22 +-
commons-geometry-euclidean/pom.xml | 6 +
.../euclidean/DocumentationExamplesTest.java | 64 +--
.../geometry/euclidean/EuclideanTestUtils.java | 40 +-
.../geometry/euclidean/internal/MatricesTest.java | 36 +-
.../geometry/euclidean/internal/VectorsTest.java | 138 ++---
.../oned/AffineTransformMatrix1DTest.java | 102 ++--
.../geometry/euclidean/oned/IntervalTest.java | 162 +++---
.../geometry/euclidean/oned/OrientedPointTest.java | 186 +++----
.../euclidean/oned/RegionBSPTree1DTest.java | 200 +++----
.../geometry/euclidean/oned/Vector1DTest.java | 213 ++++----
.../threed/AffineTransformMatrix3DTest.java | 114 ++--
.../euclidean/threed/BoundarySource3DTest.java | 32 +-
.../threed/BoundarySourceBoundsBuilder3DTest.java | 14 +-
.../threed/BoundarySourceLinecaster3DTest.java | 2 +-
.../geometry/euclidean/threed/Bounds3DTest.java | 130 ++---
.../euclidean/threed/ConvexVolumeTest.java | 70 +--
.../threed/EmbeddedAreaPlaneConvexSubsetTest.java | 100 ++--
.../threed/EmbeddedTreePlaneSubsetTest.java | 118 ++---
.../euclidean/threed/EmbeddingPlaneTest.java | 128 ++---
.../euclidean/threed/LinecastChecker3D.java | 14 +-
.../euclidean/threed/PlaneConvexSubsetTest.java | 110 ++--
.../geometry/euclidean/threed/PlaneTest.java | 292 +++++------
.../geometry/euclidean/threed/PlanesTest.java | 232 ++++----
.../euclidean/threed/RegionBSPTree3DTest.java | 348 ++++++------
.../euclidean/threed/SimpleTriangle3DTest.java | 70 +--
.../euclidean/threed/SphericalCoordinatesTest.java | 183 +++----
.../geometry/euclidean/threed/Vector3DTest.java | 360 ++++++-------
.../threed/VertexListConvexPolygon3DTest.java | 82 +--
.../threed/line/EmbeddedTreeLineSubset3DTest.java | 76 +--
.../geometry/euclidean/threed/line/Line3DTest.java | 205 ++++----
.../threed/line/LineConvexSubset3DTest.java | 58 +-
.../euclidean/threed/line/LinecastPoint3DTest.java | 62 +--
.../geometry/euclidean/threed/line/Ray3DTest.java | 60 +--
.../euclidean/threed/line/ReverseRay3DTest.java | 60 +--
.../euclidean/threed/line/Segment3DTest.java | 94 ++--
.../threed/mesh/SimpleTriangleMeshTest.java | 218 ++++----
.../threed/rotation/AxisAngleSequenceTest.java | 82 +--
.../threed/rotation/AxisSequenceTest.java | 12 +-
.../threed/rotation/QuaternionRotationTest.java | 195 ++++---
.../euclidean/threed/shape/ParallelepipedTest.java | 42 +-
.../euclidean/threed/shape/SphereTest.java | 132 ++---
.../twod/AffineTransformMatrix2DTest.java | 116 ++--
.../euclidean/twod/BoundarySource2DTest.java | 32 +-
.../twod/BoundarySourceBoundsBuilder2DTest.java | 18 +-
.../twod/BoundarySourceLinecaster2DTest.java | 2 +-
.../geometry/euclidean/twod/Bounds2DTest.java | 116 ++--
.../geometry/euclidean/twod/ConvexAreaTest.java | 370 ++++++-------
.../euclidean/twod/EmbeddedTreeLineSubsetTest.java | 158 +++---
.../euclidean/twod/LineConvexSubsetTest.java | 162 +++---
.../euclidean/twod/LineSpanningSubsetTest.java | 42 +-
.../geometry/euclidean/twod/LineSubsetTest.java | 2 +-
.../commons/geometry/euclidean/twod/LineTest.java | 434 +++++++--------
.../geometry/euclidean/twod/LinecastChecker2D.java | 14 +-
.../euclidean/twod/LinecastPoint2DTest.java | 62 +--
.../euclidean/twod/PolarCoordinatesTest.java | 152 +++---
.../commons/geometry/euclidean/twod/RayTest.java | 70 +--
.../euclidean/twod/RegionBSPTree2DTest.java | 342 ++++++------
.../geometry/euclidean/twod/ReverseRayTest.java | 70 +--
.../geometry/euclidean/twod/SegmentTest.java | 116 ++--
.../geometry/euclidean/twod/Vector2DTest.java | 325 ++++++------
.../twod/path/AbstractLinePathConnectorTest.java | 126 ++---
.../path/InteriorAngleLinePathConnectorTest.java | 42 +-
.../geometry/euclidean/twod/path/LinePathTest.java | 450 ++++++++--------
.../euclidean/twod/rotation/Rotation2DTest.java | 42 +-
.../geometry/euclidean/twod/shape/CircleTest.java | 96 ++--
.../euclidean/twod/shape/ParallelogramTest.java | 60 +--
commons-geometry-examples/examples-io/pom.xml | 9 +
.../threed/DefaultModelIOHandlerRegistryTest.java | 12 +-
.../io/threed/ModelIOHandlerRegistryTest.java | 56 +-
.../geometry/examples/io/threed/ModelIOTest.java | 29 +-
.../io/threed/obj/OBJModelIOHandlerTest.java | 56 +-
.../examples/io/threed/obj/OBJReaderTest.java | 30 +-
.../examples/io/threed/obj/OBJWriterTest.java | 32 +-
commons-geometry-examples/examples-jmh/pom.xml | 7 +
.../examples-tutorials/pom.xml | 7 +
.../tutorials/bsp/BSPTreeTutorialsTest.java | 2 +-
commons-geometry-examples/pom.xml | 1 -
commons-geometry-hull/pom.xml | 6 +
.../geometry/hull/DocumentationExamplesTest.java | 8 +-
.../hull/euclidean/twod/ConvexHull2DTest.java | 46 +-
.../twod/ConvexHullGenerator2DAbstractTest.java | 50 +-
.../hull/euclidean/twod/MonotoneChainTest.java | 8 +-
commons-geometry-spherical/pom.xml | 6 +
.../spherical/DocumentationExamplesTest.java | 20 +-
.../geometry/spherical/SphericalTestUtils.java | 18 +-
.../spherical/oned/AngularIntervalTest.java | 164 +++---
.../geometry/spherical/oned/CutAngleTest.java | 156 +++---
.../geometry/spherical/oned/Point1STest.java | 200 +++----
.../spherical/oned/RegionBSPTree1STest.java | 288 +++++-----
.../geometry/spherical/oned/Transform1STest.java | 68 +--
.../twod/AbstractGreatArcPathConnectorTest.java | 76 +--
.../spherical/twod/BoundarySource2STest.java | 16 +-
.../geometry/spherical/twod/ConvexArea2STest.java | 210 ++++----
.../twod/EmbeddedTreeSubGreatCircleTest.java | 116 ++--
.../geometry/spherical/twod/GreatArcPathTest.java | 136 ++---
.../geometry/spherical/twod/GreatArcTest.java | 82 +--
.../geometry/spherical/twod/GreatCircleTest.java | 258 ++++-----
.../twod/InteriorAngleGreatArcConnectorTest.java | 20 +-
.../geometry/spherical/twod/Point2STest.java | 152 +++---
.../spherical/twod/RegionBSPTree2STest.java | 238 ++++-----
.../geometry/spherical/twod/Transform2STest.java | 30 +-
pom.xml | 18 +-
131 files changed, 6747 insertions(+), 6684 deletions(-)
diff --git a/commons-geometry-core/pom.xml b/commons-geometry-core/pom.xml
index 5fc52b4..053ed0b 100644
--- a/commons-geometry-core/pom.xml
+++ b/commons-geometry-core/pom.xml
@@ -46,6 +46,12 @@
<groupId>org.apache.commons</groupId>
<artifactId>commons-numbers-core</artifactId>
</dependency>
+ <!-- testing -->
+ <dependency>
+ <groupId>org.junit.jupiter</groupId>
+ <artifactId>junit-jupiter</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<build>
diff --git a/commons-geometry-core/src/test/java/org/apache/commons/geometry/core/EmbeddingTest.java b/commons-geometry-core/src/test/java/org/apache/commons/geometry/core/EmbeddingTest.java
index e155f46..60d9740 100644
--- a/commons-geometry-core/src/test/java/org/apache/commons/geometry/core/EmbeddingTest.java
+++ b/commons-geometry-core/src/test/java/org/apache/commons/geometry/core/EmbeddingTest.java
@@ -24,8 +24,8 @@ import org.apache.commons.geometry.core.partitioning.test.PartitionTestUtils;
import org.apache.commons.geometry.core.partitioning.test.TestLine;
import org.apache.commons.geometry.core.partitioning.test.TestPoint1D;
import org.apache.commons.geometry.core.partitioning.test.TestPoint2D;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
public class EmbeddingTest {
@@ -38,7 +38,7 @@ public class EmbeddingTest {
final List<TestPoint1D> result = line.toSubspace(new ArrayList<>());
// assert
- Assert.assertEquals(0, result.size());
+ Assertions.assertEquals(0, result.size());
}
@Test
@@ -56,10 +56,10 @@ public class EmbeddingTest {
final List<TestPoint1D> result = line.toSubspace(pts);
// assert
- Assert.assertEquals(3, result.size());
- Assert.assertEquals(0, result.get(0).getX(), PartitionTestUtils.EPS);
- Assert.assertEquals(0.25, result.get(1).getX(), PartitionTestUtils.EPS);
- Assert.assertEquals(1, result.get(2).getX(), PartitionTestUtils.EPS);
+ Assertions.assertEquals(3, result.size());
+ Assertions.assertEquals(0, result.get(0).getX(), PartitionTestUtils.EPS);
+ Assertions.assertEquals(0.25, result.get(1).getX(), PartitionTestUtils.EPS);
+ Assertions.assertEquals(1, result.get(2).getX(), PartitionTestUtils.EPS);
}
@Test
@@ -71,7 +71,7 @@ public class EmbeddingTest {
final List<TestPoint2D> result = line.toSpace(new ArrayList<>());
// assert
- Assert.assertEquals(0, result.size());
+ Assertions.assertEquals(0, result.size());
}
@Test
@@ -89,7 +89,7 @@ public class EmbeddingTest {
final List<TestPoint2D> result = line.toSpace(pts);
// assert
- Assert.assertEquals(3, result.size());
+ Assertions.assertEquals(3, result.size());
PartitionTestUtils.assertPointsEqual(new TestPoint2D(0, 0), result.get(0));
PartitionTestUtils.assertPointsEqual(new TestPoint2D(0, 1), result.get(1));
PartitionTestUtils.assertPointsEqual(new TestPoint2D(0, 0.5), result.get(2));
diff --git a/commons-geometry-core/src/test/java/org/apache/commons/geometry/core/GeometryTestUtils.java b/commons-geometry-core/src/test/java/org/apache/commons/geometry/core/GeometryTestUtils.java
index ed20b9e..908cc02 100644
--- a/commons-geometry-core/src/test/java/org/apache/commons/geometry/core/GeometryTestUtils.java
+++ b/commons-geometry-core/src/test/java/org/apache/commons/geometry/core/GeometryTestUtils.java
@@ -22,7 +22,7 @@ import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.util.regex.Pattern;
-import org.junit.Assert;
+import org.junit.jupiter.api.Assertions;
/** Class containing various geometry-related test utilities.
*/
@@ -37,8 +37,8 @@ public final class GeometryTestUtils {
*/
public static void assertPositiveInfinity(final double value) {
final String msg = "Expected value to be positive infinity but was " + value;
- Assert.assertTrue(msg, Double.isInfinite(value));
- Assert.assertTrue(msg, value > 0);
+ Assertions.assertTrue(Double.isInfinite(value), msg);
+ Assertions.assertTrue(value > 0, msg);
}
/** Asserts that the given value is negative infinity..
@@ -46,8 +46,8 @@ public final class GeometryTestUtils {
*/
public static void assertNegativeInfinity(final double value) {
final String msg = "Expected value to be negative infinity but was " + value;
- Assert.assertTrue(msg, Double.isInfinite(value));
- Assert.assertTrue(msg, value < 0);
+ Assertions.assertTrue(Double.isInfinite(value), msg);
+ Assertions.assertTrue(value < 0, msg);
}
/** Asserts that the given Runnable throws an exception of the given type.
@@ -68,15 +68,15 @@ public final class GeometryTestUtils {
public static void assertThrows(final Runnable r, final Class<?> exceptionType, final String message) {
try {
r.run();
- Assert.fail("Operation should have thrown an exception");
+ Assertions.fail("Operation should have thrown an exception");
} catch (final Exception exc) {
final Class<?> actualType = exc.getClass();
- Assert.assertTrue("Expected exception of type " + exceptionType.getName() + " but was " + actualType.getName(),
- exceptionType.isAssignableFrom(actualType));
+ Assertions.assertTrue(exceptionType.isAssignableFrom(actualType),
+ "Expected exception of type " + exceptionType.getName() + " but was " + actualType.getName());
if (message != null) {
- Assert.assertEquals(message, exc.getMessage());
+ Assertions.assertEquals(message, exc.getMessage());
}
}
}
@@ -91,18 +91,18 @@ public final class GeometryTestUtils {
public static void assertThrows(final Runnable r, final Class<?> exceptionType, final Pattern pattern) {
try {
r.run();
- Assert.fail("Operation should have thrown an exception");
+ Assertions.fail("Operation should have thrown an exception");
} catch (final Exception exc) {
final Class<?> actualType = exc.getClass();
- Assert.assertTrue("Expected exception of type " + exceptionType.getName() + " but was " + actualType.getName(),
- exceptionType.isAssignableFrom(actualType));
+ Assertions.assertTrue(exceptionType.isAssignableFrom(actualType),
+ "Expected exception of type " + exceptionType.getName() + " but was " + actualType.getName());
if (pattern != null) {
final String message = exc.getMessage();
final String err = "Expected exception message to match /" + pattern + "/ but was [" + message + "]";
- Assert.assertTrue(err, pattern.matcher(message).matches());
+ Assertions.assertTrue(pattern.matcher(message).matches(), err);
}
}
}
@@ -113,7 +113,7 @@ public final class GeometryTestUtils {
*/
public static void assertContains(final String substr, final String actual) {
final String msg = "Expected string to contain [" + substr + "] but was [" + actual + "]";
- Assert.assertTrue(msg, actual.contains(substr));
+ Assertions.assertTrue(actual.contains(substr), msg);
}
/** Assert that the {@code equals} method of the argument meets the following requirements:
@@ -128,13 +128,13 @@ public final class GeometryTestUtils {
// Use the JUnit boolean assertions here to ensure that the equals methods are actually
// invoked and no assertion shortcuts are taken
- Assert.assertFalse("Object should not equal null", obj.equals(null));
+ Assertions.assertFalse(obj.equals(null), "Object should not equal null");
if (obj.getClass().getSuperclass() != null) {
- Assert.assertFalse("Object should not equal an instance of different type", obj.equals(new Object()));
+ Assertions.assertFalse(obj.equals(new Object()), "Object should not equal an instance of different type");
}
- Assert.assertTrue("Object should equal itself", obj.equals(obj));
+ Assertions.assertTrue(obj.equals(obj), "Object should equal itself");
}
/**
diff --git a/commons-geometry-core/src/test/java/org/apache/commons/geometry/core/SizedTest.java b/commons-geometry-core/src/test/java/org/apache/commons/geometry/core/SizedTest.java
index 355f8ca..52a1587 100644
--- a/commons-geometry-core/src/test/java/org/apache/commons/geometry/core/SizedTest.java
+++ b/commons-geometry-core/src/test/java/org/apache/commons/geometry/core/SizedTest.java
@@ -16,8 +16,8 @@
*/
package org.apache.commons.geometry.core;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
public class SizedTest {
@@ -29,14 +29,14 @@ public class SizedTest {
final Sized nan = new StubSized(Double.NaN);
// act/assert
- Assert.assertTrue(finite.isFinite());
- Assert.assertFalse(finite.isInfinite());
+ Assertions.assertTrue(finite.isFinite());
+ Assertions.assertFalse(finite.isInfinite());
- Assert.assertFalse(infinite.isFinite());
- Assert.assertTrue(infinite.isInfinite());
+ Assertions.assertFalse(infinite.isFinite());
+ Assertions.assertTrue(infinite.isInfinite());
- Assert.assertFalse(nan.isFinite());
- Assert.assertFalse(nan.isInfinite());
+ Assertions.assertFalse(nan.isFinite());
+ Assertions.assertFalse(nan.isInfinite());
}
private static class StubSized implements Sized {
diff --git a/commons-geometry-core/src/test/java/org/apache/commons/geometry/core/internal/GeometryInternalErrorTest.java b/commons-geometry-core/src/test/java/org/apache/commons/geometry/core/internal/GeometryInternalErrorTest.java
index 87198e1..7306f71 100644
--- a/commons-geometry-core/src/test/java/org/apache/commons/geometry/core/internal/GeometryInternalErrorTest.java
+++ b/commons-geometry-core/src/test/java/org/apache/commons/geometry/core/internal/GeometryInternalErrorTest.java
@@ -16,8 +16,8 @@
*/
package org.apache.commons.geometry.core.internal;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
public class GeometryInternalErrorTest {
@@ -31,6 +31,6 @@ public class GeometryInternalErrorTest {
"error in the algorithm implementation than in the calling code or data. Please file a bug report " +
"with the developers.";
- Assert.assertEquals(msg, err.getMessage());
+ Assertions.assertEquals(msg, err.getMessage());
}
}
diff --git a/commons-geometry-core/src/test/java/org/apache/commons/geometry/core/internal/HyperplaneSubsetsTest.java b/commons-geometry-core/src/test/java/org/apache/commons/geometry/core/internal/HyperplaneSubsetsTest.java
index b7b8eda..69f3554 100644
--- a/commons-geometry-core/src/test/java/org/apache/commons/geometry/core/internal/HyperplaneSubsetsTest.java
+++ b/commons-geometry-core/src/test/java/org/apache/commons/geometry/core/internal/HyperplaneSubsetsTest.java
@@ -24,8 +24,8 @@ import org.apache.commons.geometry.core.partitioning.test.PartitionTestUtils;
import org.apache.commons.geometry.core.partitioning.test.TestLine;
import org.apache.commons.geometry.core.partitioning.test.TestPoint1D;
import org.apache.commons.geometry.core.partitioning.test.TestPoint2D;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
public class HyperplaneSubsetsTest {
@@ -36,16 +36,16 @@ public class HyperplaneSubsetsTest {
final StubRegion1D region = new StubRegion1D();
// act/assert
- Assert.assertEquals(RegionLocation.INSIDE,
+ Assertions.assertEquals(RegionLocation.INSIDE,
HyperplaneSubsets.classifyAgainstEmbeddedRegion(new TestPoint2D(-1, 0), line, region));
- Assert.assertEquals(RegionLocation.BOUNDARY,
+ Assertions.assertEquals(RegionLocation.BOUNDARY,
HyperplaneSubsets.classifyAgainstEmbeddedRegion(new TestPoint2D(0, 0), line, region));
- Assert.assertEquals(RegionLocation.OUTSIDE,
+ Assertions.assertEquals(RegionLocation.OUTSIDE,
HyperplaneSubsets.classifyAgainstEmbeddedRegion(new TestPoint2D(0, 1), line, region));
- Assert.assertEquals(RegionLocation.OUTSIDE,
+ Assertions.assertEquals(RegionLocation.OUTSIDE,
HyperplaneSubsets.classifyAgainstEmbeddedRegion(new TestPoint2D(-1, 1), line, region));
- Assert.assertEquals(RegionLocation.OUTSIDE,
+ Assertions.assertEquals(RegionLocation.OUTSIDE,
HyperplaneSubsets.classifyAgainstEmbeddedRegion(new TestPoint2D(-1, -1), line, region));
}
@@ -74,7 +74,7 @@ public class HyperplaneSubsetsTest {
PartitionTestUtils.assertPointsEqual(new TestPoint2D(-1, 0),
HyperplaneSubsets.closestToEmbeddedRegion(new TestPoint2D(-1, -1), line, region));
- Assert.assertNull(HyperplaneSubsets.closestToEmbeddedRegion(TestPoint2D.ZERO, line, emptyRegion));
+ Assertions.assertNull(HyperplaneSubsets.closestToEmbeddedRegion(TestPoint2D.ZERO, line, emptyRegion));
}
/** Stub region implementation. Negative numbers are on the inside of the region.
diff --git a/commons-geometry-core/src/test/java/org/apache/commons/geometry/core/internal/IteratorTransformTest.java b/commons-geometry-core/src/test/java/org/apache/commons/geometry/core/internal/IteratorTransformTest.java
index 7ec2ff2..827c117 100644
--- a/commons-geometry-core/src/test/java/org/apache/commons/geometry/core/internal/IteratorTransformTest.java
+++ b/commons-geometry-core/src/test/java/org/apache/commons/geometry/core/internal/IteratorTransformTest.java
@@ -23,8 +23,10 @@ import java.util.Iterator;
import java.util.List;
import java.util.NoSuchElementException;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertThrows;
public class IteratorTransformTest {
@@ -37,18 +39,18 @@ public class IteratorTransformTest {
final List<String> result = toList(new EvenCharIterator(input.iterator()));
// assert
- Assert.assertEquals(Arrays.asList("2", "4", "1", "2"), result);
+ Assertions.assertEquals(Arrays.asList("2", "4", "1", "2"), result);
}
- @Test(expected = NoSuchElementException.class)
+ @Test
public void testThrowsNoSuchElement() {
// arrange
final List<Integer> input = Collections.emptyList();
final EvenCharIterator it = new EvenCharIterator(input.iterator());
// act/assert
- Assert.assertFalse(it.hasNext());
- it.next();
+ Assertions.assertFalse(it.hasNext());
+ assertThrows(NoSuchElementException.class, it::next);
}
private static <T> List<T> toList(final Iterator<T> it) {
diff --git a/commons-geometry-core/src/test/java/org/apache/commons/geometry/core/internal/SimpleTupleFormatTest.java b/commons-geometry-core/src/test/java/org/apache/commons/geometry/core/internal/SimpleTupleFormatTest.java
index ff45db9..a91f21c 100644
--- a/commons-geometry-core/src/test/java/org/apache/commons/geometry/core/internal/SimpleTupleFormatTest.java
+++ b/commons-geometry-core/src/test/java/org/apache/commons/geometry/core/internal/SimpleTupleFormatTest.java
@@ -16,8 +16,8 @@
*/
package org.apache.commons.geometry.core.internal;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
public class SimpleTupleFormatTest {
@@ -56,9 +56,9 @@ public class SimpleTupleFormatTest {
final SimpleTupleFormat formatter = new SimpleTupleFormat("|", "{", "}");
// assert
- Assert.assertEquals("|", formatter.getSeparator());
- Assert.assertEquals("{", formatter.getPrefix());
- Assert.assertEquals("}", formatter.getSuffix());
+ Assertions.assertEquals("|", formatter.getSeparator());
+ Assertions.assertEquals("{", formatter.getPrefix());
+ Assertions.assertEquals("}", formatter.getSuffix());
}
@Test
@@ -67,9 +67,9 @@ public class SimpleTupleFormatTest {
final SimpleTupleFormat formatter = new SimpleTupleFormat("{", "}");
// assert
- Assert.assertEquals(",", formatter.getSeparator());
- Assert.assertEquals("{", formatter.getPrefix());
- Assert.assertEquals("}", formatter.getSuffix());
+ Assertions.assertEquals(",", formatter.getSeparator());
+ Assertions.assertEquals("{", formatter.getPrefix());
+ Assertions.assertEquals("}", formatter.getSuffix());
}
@Test
@@ -78,11 +78,11 @@ public class SimpleTupleFormatTest {
final SimpleTupleFormat formatter = new SimpleTupleFormat(OPEN_PAREN, CLOSE_PAREN);
// act/assert
- Assert.assertEquals("(1.0)", formatter.format(1.0));
- Assert.assertEquals("(-1.0)", formatter.format(-1.0));
- Assert.assertEquals("(NaN)", formatter.format(Double.NaN));
- Assert.assertEquals("(-Infinity)", formatter.format(Double.NEGATIVE_INFINITY));
- Assert.assertEquals("(Infinity)", formatter.format(Double.POSITIVE_INFINITY));
+ Assertions.assertEquals("(1.0)", formatter.format(1.0));
+ Assertions.assertEquals("(-1.0)", formatter.format(-1.0));
+ Assertions.assertEquals("(NaN)", formatter.format(Double.NaN));
+ Assertions.assertEquals("(-Infinity)", formatter.format(Double.NEGATIVE_INFINITY));
+ Assertions.assertEquals("(Infinity)", formatter.format(Double.POSITIVE_INFINITY));
}
@Test
@@ -91,11 +91,11 @@ public class SimpleTupleFormatTest {
final SimpleTupleFormat formatter = new SimpleTupleFormat(null, null);
// act/assert
- Assert.assertEquals("1.0", formatter.format(1.0));
- Assert.assertEquals("-1.0", formatter.format(-1.0));
- Assert.assertEquals("NaN", formatter.format(Double.NaN));
- Assert.assertEquals("-Infinity", formatter.format(Double.NEGATIVE_INFINITY));
- Assert.assertEquals("Infinity", formatter.format(Double.POSITIVE_INFINITY));
+ Assertions.assertEquals("1.0", formatter.format(1.0));
+ Assertions.assertEquals("-1.0", formatter.format(-1.0));
+ Assertions.assertEquals("NaN", formatter.format(Double.NaN));
+ Assertions.assertEquals("-Infinity", formatter.format(Double.NEGATIVE_INFINITY));
+ Assertions.assertEquals("Infinity", formatter.format(Double.POSITIVE_INFINITY));
}
@Test
@@ -104,10 +104,10 @@ public class SimpleTupleFormatTest {
final SimpleTupleFormat formatter = new SimpleTupleFormat(OPEN_PAREN, CLOSE_PAREN);
// act/assert
- Assert.assertEquals("(1.0, -1.0)", formatter.format(1.0, -1.0));
- Assert.assertEquals("(-1.0, 1.0)", formatter.format(-1.0, 1.0));
- Assert.assertEquals("(NaN, -Infinity)", formatter.format(Double.NaN, Double.NEGATIVE_INFINITY));
- Assert.assertEquals("(-Infinity, Infinity)", formatter.format(Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY));
+ Assertions.assertEquals("(1.0, -1.0)", formatter.format(1.0, -1.0));
+ Assertions.assertEquals("(-1.0, 1.0)", formatter.format(-1.0, 1.0));
+ Assertions.assertEquals("(NaN, -Infinity)", formatter.format(Double.NaN, Double.NEGATIVE_INFINITY));
+ Assertions.assertEquals("(-Infinity, Infinity)", formatter.format(Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY));
}
@Test
@@ -116,10 +116,10 @@ public class SimpleTupleFormatTest {
final SimpleTupleFormat formatter = new SimpleTupleFormat(null, null);
// act/assert
- Assert.assertEquals("1.0, -1.0", formatter.format(1.0, -1.0));
- Assert.assertEquals("-1.0, 1.0", formatter.format(-1.0, 1.0));
- Assert.assertEquals("NaN, -Infinity", formatter.format(Double.NaN, Double.NEGATIVE_INFINITY));
- Assert.assertEquals("-Infinity, Infinity", formatter.format(Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY));
+ Assertions.assertEquals("1.0, -1.0", formatter.format(1.0, -1.0));
+ Assertions.assertEquals("-1.0, 1.0", formatter.format(-1.0, 1.0));
+ Assertions.assertEquals("NaN, -Infinity", formatter.format(Double.NaN, Double.NEGATIVE_INFINITY));
+ Assertions.assertEquals("-Infinity, Infinity", formatter.format(Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY));
}
@Test
@@ -128,9 +128,9 @@ public class SimpleTupleFormatTest {
final SimpleTupleFormat formatter = new SimpleTupleFormat(OPEN_PAREN, CLOSE_PAREN);
// act/assert
- Assert.assertEquals("(1.0, 0.0, -1.0)", formatter.format(1.0, 0.0, -1.0));
- Assert.assertEquals("(-1.0, 1.0, 0.0)", formatter.format(-1.0, 1.0, 0.0));
- Assert.assertEquals("(NaN, -Infinity, Infinity)", formatter.format(Double.NaN, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY));
+ Assertions.assertEquals("(1.0, 0.0, -1.0)", formatter.format(1.0, 0.0, -1.0));
+ Assertions.assertEquals("(-1.0, 1.0, 0.0)", formatter.format(-1.0, 1.0, 0.0));
+ Assertions.assertEquals("(NaN, -Infinity, Infinity)", formatter.format(Double.NaN, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY));
}
@Test
@@ -139,9 +139,9 @@ public class SimpleTupleFormatTest {
final SimpleTupleFormat formatter = new SimpleTupleFormat(null, null);
// act/assert
- Assert.assertEquals("1.0, 0.0, -1.0", formatter.format(1.0, 0.0, -1.0));
- Assert.assertEquals("-1.0, 1.0, 0.0", formatter.format(-1.0, 1.0, 0.0));
- Assert.assertEquals("NaN, -Infinity, Infinity", formatter.format(Double.NaN, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY));
+ Assertions.assertEquals("1.0, 0.0, -1.0", formatter.format(1.0, 0.0, -1.0));
+ Assertions.assertEquals("-1.0, 1.0, 0.0", formatter.format(-1.0, 1.0, 0.0));
+ Assertions.assertEquals("NaN, -Infinity, Infinity", formatter.format(Double.NaN, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY));
}
@Test
@@ -150,9 +150,9 @@ public class SimpleTupleFormatTest {
final SimpleTupleFormat formatter = new SimpleTupleFormat(OPEN_PAREN, CLOSE_PAREN);
// act/assert
- Assert.assertEquals("(1.0, 0.0, -1.0, 2.0)", formatter.format(1.0, 0.0, -1.0, 2.0));
- Assert.assertEquals("(-1.0, 1.0, 0.0, 2.0)", formatter.format(-1.0, 1.0, 0.0, 2.0));
- Assert.assertEquals("(NaN, -Infinity, Infinity, NaN)", formatter.format(Double.NaN, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, Double.NaN));
+ Assertions.assertEquals("(1.0, 0.0, -1.0, 2.0)", formatter.format(1.0, 0.0, -1.0, 2.0));
+ Assertions.assertEquals("(-1.0, 1.0, 0.0, 2.0)", formatter.format(-1.0, 1.0, 0.0, 2.0));
+ Assertions.assertEquals("(NaN, -Infinity, Infinity, NaN)", formatter.format(Double.NaN, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, Double.NaN));
}
@Test
@@ -161,9 +161,9 @@ public class SimpleTupleFormatTest {
final SimpleTupleFormat formatter = new SimpleTupleFormat(null, null);
// act/assert
- Assert.assertEquals("1.0, 0.0, -1.0, 2.0", formatter.format(1.0, 0.0, -1.0, 2.0));
- Assert.assertEquals("-1.0, 1.0, 0.0, 2.0", formatter.format(-1.0, 1.0, 0.0, 2.0));
- Assert.assertEquals("NaN, -Infinity, Infinity, NaN", formatter.format(Double.NaN, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, Double.NaN));
+ Assertions.assertEquals("1.0, 0.0, -1.0, 2.0", formatter.format(1.0, 0.0, -1.0, 2.0));
+ Assertions.assertEquals("-1.0, 1.0, 0.0, 2.0", formatter.format(-1.0, 1.0, 0.0, 2.0));
+ Assertions.assertEquals("NaN, -Infinity, Infinity, NaN", formatter.format(Double.NaN, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, Double.NaN));
}
@Test
@@ -172,9 +172,9 @@ public class SimpleTupleFormatTest {
final SimpleTupleFormat formatter = new SimpleTupleFormat("||", "<<", ">>");
// act/assert
- Assert.assertEquals("<<1.0>>", formatter.format(1.0));
- Assert.assertEquals("<<1.0|| 2.0>>", formatter.format(1.0, 2.0));
- Assert.assertEquals("<<1.0|| 2.0|| 3.0>>", formatter.format(1.0, 2.0, 3.0));
+ Assertions.assertEquals("<<1.0>>", formatter.format(1.0));
+ Assertions.assertEquals("<<1.0|| 2.0>>", formatter.format(1.0, 2.0));
+ Assertions.assertEquals("<<1.0|| 2.0|| 3.0>>", formatter.format(1.0, 2.0, 3.0));
}
@Test
@@ -394,64 +394,63 @@ public class SimpleTupleFormatTest {
final SimpleTupleFormat formatter = SimpleTupleFormat.getDefault();
// assert
- Assert.assertEquals(",", formatter.getSeparator());
- Assert.assertEquals("(", formatter.getPrefix());
- Assert.assertEquals(")", formatter.getSuffix());
+ Assertions.assertEquals(",", formatter.getSeparator());
+ Assertions.assertEquals("(", formatter.getPrefix());
+ Assertions.assertEquals(")", formatter.getSuffix());
- Assert.assertEquals("(1.0, 2.0)", formatter.format(1, 2));
+ Assertions.assertEquals("(1.0, 2.0)", formatter.format(1, 2));
}
private void checkParse1D(final SimpleTupleFormat formatter, final String str, final double v) {
final Stub1D result = formatter.parse(str, FACTORY_1D);
- Assert.assertEquals(v, result.v, EPS);
+ Assertions.assertEquals(v, result.v, EPS);
}
private void checkParse1DFailure(final SimpleTupleFormat formatter, final String str, final String msgSubstr) {
try {
formatter.parse(str, FACTORY_1D);
- Assert.fail("Operation should have failed");
+ Assertions.fail("Operation should have failed");
} catch (final IllegalArgumentException exc) {
final String excMsg = exc.getMessage();
- Assert.assertTrue("Expected message to contain [" + msgSubstr + "] but was [" + excMsg + "]",
- excMsg.contains(msgSubstr));
+ Assertions.assertTrue(excMsg.contains(msgSubstr), "Expected message to contain [" + msgSubstr + "] but was [" + excMsg + "]");
}
}
private void checkParse2D(final SimpleTupleFormat formatter, final String str, final double v1, final double v2) {
final Stub2D result = formatter.parse(str, FACTORY_2D);
- Assert.assertEquals(v1, result.v1, EPS);
- Assert.assertEquals(v2, result.v2, EPS);
+ Assertions.assertEquals(v1, result.v1, EPS);
+ Assertions.assertEquals(v2, result.v2, EPS);
}
private void checkParse2DFailure(final SimpleTupleFormat formatter, final String str, final String msgSubstr) {
try {
formatter.parse(str, FACTORY_2D);
- Assert.fail("Operation should have failed");
+ Assertions.fail("Operation should have failed");
} catch (final IllegalArgumentException exc) {
final String excMsg = exc.getMessage();
- Assert.assertTrue("Expected message to contain [" + msgSubstr + "] but was [" + excMsg + "]",
- excMsg.contains(msgSubstr));
+ Assertions.assertTrue(excMsg.contains(msgSubstr),
+ "Expected message to contain [" + msgSubstr + "] but was [" + excMsg + "]");
}
}
private void checkParse3D(final SimpleTupleFormat formatter, final String str, final double v1, final double v2, final double v3) {
final Stub3D result = formatter.parse(str, FACTORY_3D);
- Assert.assertEquals(v1, result.v1, EPS);
- Assert.assertEquals(v2, result.v2, EPS);
- Assert.assertEquals(v3, result.v3, EPS);
+ Assertions.assertEquals(v1, result.v1, EPS);
+ Assertions.assertEquals(v2, result.v2, EPS);
+ Assertions.assertEquals(v3, result.v3, EPS);
}
private void checkParse3DFailure(final SimpleTupleFormat formatter, final String str, final String msgSubstr) {
try {
formatter.parse(str, FACTORY_3D);
- Assert.fail("Operation should have failed");
+ Assertions.fail("Operation should have failed");
} catch (final IllegalArgumentException exc) {
final String excMsg = exc.getMessage();
- Assert.assertTrue("Expected message to contain [" + msgSubstr + "] but was [" + excMsg + "]",
- excMsg.contains(msgSubstr));
+ Assertions.assertTrue(excMsg.contains(msgSubstr),
+ "Expected message to contain [" + msgSubstr + "] but was [" + excMsg + "]");
}
}
diff --git a/commons-geometry-core/src/test/java/org/apache/commons/geometry/core/partitioning/AbstractConvexHyperplaneBoundedRegionTest.java b/commons-geometry-core/src/test/java/org/apache/commons/geometry/core/partitioning/AbstractConvexHyperplaneBoundedRegionTest.java
index 0a9ebbb..750287d 100644
--- a/commons-geometry-core/src/test/java/org/apache/commons/geometry/core/partitioning/AbstractConvexHyperplaneBoundedRegionTest.java
+++ b/commons-geometry-core/src/test/java/org/apache/commons/geometry/core/partitioning/AbstractConvexHyperplaneBoundedRegionTest.java
@@ -30,8 +30,8 @@ import org.apache.commons.geometry.core.partitioning.test.TestLine;
import org.apache.commons.geometry.core.partitioning.test.TestLineSegment;
import org.apache.commons.geometry.core.partitioning.test.TestPoint2D;
import org.apache.commons.geometry.core.partitioning.test.TestTransform2D;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
public class AbstractConvexHyperplaneBoundedRegionTest {
@@ -52,8 +52,8 @@ public class AbstractConvexHyperplaneBoundedRegionTest {
final StubRegion region = new StubRegion(Collections.emptyList());
// assert
- Assert.assertTrue(region.isFull());
- Assert.assertFalse(region.isEmpty());
+ Assertions.assertTrue(region.isFull());
+ Assertions.assertFalse(region.isEmpty());
}
@Test
@@ -64,9 +64,9 @@ public class AbstractConvexHyperplaneBoundedRegionTest {
final TestPoint2D p3 = new TestPoint2D(1, 1);
// act/assert
- Assert.assertEquals(0, new StubRegion(Collections.emptyList()).getBoundarySize(), PartitionTestUtils.EPS);
+ Assertions.assertEquals(0, new StubRegion(Collections.emptyList()).getBoundarySize(), PartitionTestUtils.EPS);
GeometryTestUtils.assertPositiveInfinity(new StubRegion(Collections.singletonList(TestLine.X_AXIS.span())).getBoundarySize());
- Assert.assertEquals(2 + Math.sqrt(2), new StubRegion(Arrays.asList(
+ Assertions.assertEquals(2 + Math.sqrt(2), new StubRegion(Arrays.asList(
new TestLineSegment(p1, p2),
new TestLineSegment(p2, p3),
new TestLineSegment(p3, p1)
@@ -117,8 +117,8 @@ public class AbstractConvexHyperplaneBoundedRegionTest {
));
// act/assert
- Assert.assertNull(full.project(TestPoint2D.ZERO));
- Assert.assertNull(full.project(new TestPoint2D(1, 1)));
+ Assertions.assertNull(full.project(TestPoint2D.ZERO));
+ Assertions.assertNull(full.project(new TestPoint2D(1, 1)));
PartitionTestUtils.assertPointsEqual(TestPoint2D.ZERO, halfSpace.project(new TestPoint2D(0, 1)));
PartitionTestUtils.assertPointsEqual(TestPoint2D.ZERO, halfSpace.project(new TestPoint2D(0, 0)));
@@ -149,7 +149,7 @@ public class AbstractConvexHyperplaneBoundedRegionTest {
final TestLineSegment segment = new TestLineSegment(new TestPoint2D(-1, 0.5), new TestPoint2D(4, 0.5));
// act/assert
- Assert.assertSame(segment, full.trim(segment));
+ Assertions.assertSame(segment, full.trim(segment));
final TestLineSegment trimmedA = halfSpace.trim(segment);
PartitionTestUtils.assertPointsEqual(new TestPoint2D(-1, 0.5), trimmedA.getStartPoint());
@@ -171,16 +171,16 @@ public class AbstractConvexHyperplaneBoundedRegionTest {
final Split<StubRegion> split = region.split(splitter);
// assert
- Assert.assertEquals(SplitLocation.BOTH, split.getLocation());
+ Assertions.assertEquals(SplitLocation.BOTH, split.getLocation());
final StubRegion minus = split.getMinus();
- Assert.assertEquals(1, minus.getBoundaries().size());
+ Assertions.assertEquals(1, minus.getBoundaries().size());
checkClassify(minus, RegionLocation.INSIDE, new TestPoint2D(0, 1));
checkClassify(minus, RegionLocation.BOUNDARY, new TestPoint2D(0, 0));
checkClassify(minus, RegionLocation.OUTSIDE, new TestPoint2D(0, -1));
final StubRegion plus = split.getPlus();
- Assert.assertEquals(1, plus.getBoundaries().size());
+ Assertions.assertEquals(1, plus.getBoundaries().size());
checkClassify(plus, RegionLocation.OUTSIDE, new TestPoint2D(0, 1));
checkClassify(plus, RegionLocation.BOUNDARY, new TestPoint2D(0, 0));
checkClassify(plus, RegionLocation.INSIDE, new TestPoint2D(0, -1));
@@ -198,10 +198,10 @@ public class AbstractConvexHyperplaneBoundedRegionTest {
final Split<StubRegion> split = region.split(splitter);
// assert
- Assert.assertEquals(SplitLocation.PLUS, split.getLocation());
+ Assertions.assertEquals(SplitLocation.PLUS, split.getLocation());
- Assert.assertNull(split.getMinus());
- Assert.assertSame(region, split.getPlus());
+ Assertions.assertNull(split.getMinus());
+ Assertions.assertSame(region, split.getPlus());
}
@Test
@@ -216,10 +216,10 @@ public class AbstractConvexHyperplaneBoundedRegionTest {
final Split<StubRegion> split = region.split(splitter);
// assert
- Assert.assertEquals(SplitLocation.MINUS, split.getLocation());
+ Assertions.assertEquals(SplitLocation.MINUS, split.getLocation());
- Assert.assertSame(region, split.getMinus());
- Assert.assertNull(split.getPlus());
+ Assertions.assertSame(region, split.getMinus());
+ Assertions.assertNull(split.getPlus());
}
@Test
@@ -234,19 +234,19 @@ public class AbstractConvexHyperplaneBoundedRegionTest {
final Split<StubRegion> split = region.split(splitter);
// assert
- Assert.assertEquals(SplitLocation.BOTH, split.getLocation());
+ Assertions.assertEquals(SplitLocation.BOTH, split.getLocation());
final TestPoint2D p1 = new TestPoint2D(0, 1.5);
final TestPoint2D p2 = new TestPoint2D(0, 0.5);
final TestPoint2D p3 = new TestPoint2D(0, -0.5);
final StubRegion minus = split.getMinus();
- Assert.assertEquals(2, minus.getBoundaries().size());
+ Assertions.assertEquals(2, minus.getBoundaries().size());
checkClassify(minus, RegionLocation.INSIDE, p2);
checkClassify(minus, RegionLocation.OUTSIDE, p1, p3);
final StubRegion plus = split.getPlus();
- Assert.assertEquals(1, plus.getBoundaries().size());
+ Assertions.assertEquals(1, plus.getBoundaries().size());
checkClassify(plus, RegionLocation.INSIDE, p3);
checkClassify(plus, RegionLocation.OUTSIDE, p1, p2);
}
@@ -262,10 +262,10 @@ public class AbstractConvexHyperplaneBoundedRegionTest {
final Split<StubRegion> split = region.split(splitter);
// assert
- Assert.assertEquals(SplitLocation.MINUS, split.getLocation());
+ Assertions.assertEquals(SplitLocation.MINUS, split.getLocation());
- Assert.assertSame(region, split.getMinus());
- Assert.assertNull(split.getPlus());
+ Assertions.assertSame(region, split.getMinus());
+ Assertions.assertNull(split.getPlus());
}
@Test
@@ -279,10 +279,10 @@ public class AbstractConvexHyperplaneBoundedRegionTest {
final Split<StubRegion> split = region.split(splitter);
// assert
- Assert.assertEquals(SplitLocation.PLUS, split.getLocation());
+ Assertions.assertEquals(SplitLocation.PLUS, split.getLocation());
- Assert.assertNull(split.getMinus());
- Assert.assertSame(region, split.getPlus());
+ Assertions.assertNull(split.getMinus());
+ Assertions.assertSame(region, split.getPlus());
}
@Test
@@ -306,16 +306,16 @@ public class AbstractConvexHyperplaneBoundedRegionTest {
final Split<StubRegion> split = region.split(splitter);
// assert
- Assert.assertEquals(SplitLocation.BOTH, split.getLocation());
+ Assertions.assertEquals(SplitLocation.BOTH, split.getLocation());
final StubRegion minus = split.getMinus();
- Assert.assertEquals(4, minus.getBoundaries().size());
+ Assertions.assertEquals(4, minus.getBoundaries().size());
checkClassify(minus, RegionLocation.INSIDE, new TestPoint2D(1.5, 0.25));
checkClassify(minus, RegionLocation.BOUNDARY, new TestPoint2D(1.5, 0));
checkClassify(minus, RegionLocation.OUTSIDE, new TestPoint2D(1.5, -0.25));
final StubRegion plus = split.getPlus();
- Assert.assertEquals(4, plus.getBoundaries().size());
+ Assertions.assertEquals(4, plus.getBoundaries().size());
checkClassify(plus, RegionLocation.OUTSIDE, new TestPoint2D(1.5, 0.25));
checkClassify(plus, RegionLocation.BOUNDARY, new TestPoint2D(1.5, 0));
checkClassify(plus, RegionLocation.INSIDE, new TestPoint2D(1.5, -0.25));
@@ -348,9 +348,9 @@ public class AbstractConvexHyperplaneBoundedRegionTest {
final Split<StubRegion> split = region.split(splitter);
// assert
- Assert.assertEquals(SplitLocation.MINUS, split.getLocation());
- Assert.assertSame(region, split.getMinus());
- Assert.assertNull(split.getPlus());
+ Assertions.assertEquals(SplitLocation.MINUS, split.getLocation());
+ Assertions.assertSame(region, split.getMinus());
+ Assertions.assertNull(split.getPlus());
}
@Test
@@ -373,9 +373,9 @@ public class AbstractConvexHyperplaneBoundedRegionTest {
final Split<StubRegion> split = region.split(splitter);
// assert
- Assert.assertEquals(SplitLocation.PLUS, split.getLocation());
- Assert.assertNull(split.getMinus());
- Assert.assertSame(region, split.getPlus());
+ Assertions.assertEquals(SplitLocation.PLUS, split.getLocation());
+ Assertions.assertNull(split.getMinus());
+ Assertions.assertSame(region, split.getPlus());
}
@Test
@@ -398,9 +398,9 @@ public class AbstractConvexHyperplaneBoundedRegionTest {
final Split<StubRegion> split = region.split(splitter);
// assert
- Assert.assertEquals(SplitLocation.MINUS, split.getLocation());
- Assert.assertSame(region, split.getMinus());
- Assert.assertNull(split.getPlus());
+ Assertions.assertEquals(SplitLocation.MINUS, split.getLocation());
+ Assertions.assertSame(region, split.getMinus());
+ Assertions.assertNull(split.getPlus());
}
@Test
@@ -423,9 +423,9 @@ public class AbstractConvexHyperplaneBoundedRegionTest {
final Split<StubRegion> split = region.split(splitter);
// assert
- Assert.assertEquals(SplitLocation.PLUS, split.getLocation());
- Assert.assertNull(split.getMinus());
- Assert.assertSame(region, split.getPlus());
+ Assertions.assertEquals(SplitLocation.PLUS, split.getLocation());
+ Assertions.assertNull(split.getMinus());
+ Assertions.assertSame(region, split.getPlus());
}
@Test
@@ -448,9 +448,9 @@ public class AbstractConvexHyperplaneBoundedRegionTest {
final Split<StubRegion> split = region.split(splitter);
// assert
- Assert.assertEquals(SplitLocation.NEITHER, split.getLocation());
- Assert.assertNull(split.getMinus());
- Assert.assertNull(split.getPlus());
+ Assertions.assertEquals(SplitLocation.NEITHER, split.getLocation());
+ Assertions.assertNull(split.getMinus());
+ Assertions.assertNull(split.getPlus());
}
@Test
@@ -464,8 +464,8 @@ public class AbstractConvexHyperplaneBoundedRegionTest {
final StubRegion transformed = region.transform(transform);
// assert
- Assert.assertTrue(transformed.isFull());
- Assert.assertFalse(transformed.isEmpty());
+ Assertions.assertTrue(transformed.isFull());
+ Assertions.assertFalse(transformed.isEmpty());
}
@Test
@@ -483,13 +483,13 @@ public class AbstractConvexHyperplaneBoundedRegionTest {
// assert
final List<TestLineSegment> boundaries = transformed.getBoundaries();
- Assert.assertEquals(1, boundaries.size());
+ Assertions.assertEquals(1, boundaries.size());
final TestLineSegment a = boundaries.get(0);
final TestLine aLine = a.getHyperplane();
PartitionTestUtils.assertPointsEqual(aLine.getOrigin(), new TestPoint2D(1, 0));
- Assert.assertEquals(0.0, aLine.getDirectionX(), PartitionTestUtils.EPS);
- Assert.assertEquals(1.0, aLine.getDirectionY(), PartitionTestUtils.EPS);
+ Assertions.assertEquals(0.0, aLine.getDirectionX(), PartitionTestUtils.EPS);
+ Assertions.assertEquals(1.0, aLine.getDirectionY(), PartitionTestUtils.EPS);
GeometryTestUtils.assertNegativeInfinity(a.getStart());
GeometryTestUtils.assertPositiveInfinity(a.getEnd());
@@ -516,7 +516,7 @@ public class AbstractConvexHyperplaneBoundedRegionTest {
// assert
final List<TestLineSegment> boundaries = transformed.getBoundaries();
- Assert.assertEquals(3, boundaries.size());
+ Assertions.assertEquals(3, boundaries.size());
final TestLineSegment a = boundaries.get(0);
PartitionTestUtils.assertPointsEqual(new TestPoint2D(2, 2), a.getStartPoint());
@@ -552,7 +552,7 @@ public class AbstractConvexHyperplaneBoundedRegionTest {
// assert
final List<TestLineSegment> boundaries = transformed.getBoundaries();
- Assert.assertEquals(3, boundaries.size());
+ Assertions.assertEquals(3, boundaries.size());
final TestLineSegment a = boundaries.get(0);
PartitionTestUtils.assertPointsEqual(new TestPoint2D(-2, 0), a.getStartPoint());
@@ -573,7 +573,7 @@ public class AbstractConvexHyperplaneBoundedRegionTest {
final StubRegion region = StubRegion.fromBounds(Collections.emptyList());
// assert
- Assert.assertSame(StubRegion.FULL, region);
+ Assertions.assertSame(StubRegion.FULL, region);
}
@Test
@@ -582,7 +582,7 @@ public class AbstractConvexHyperplaneBoundedRegionTest {
final StubRegion region = StubRegion.fromBounds(Collections.singletonList(TestLine.Y_AXIS));
// assert
- Assert.assertEquals(1, region.getBoundaries().size());
+ Assertions.assertEquals(1, region.getBoundaries().size());
checkClassify(region, RegionLocation.INSIDE, new TestPoint2D(-1, 0));
checkClassify(region, RegionLocation.BOUNDARY, new TestPoint2D(0, 0));
@@ -599,7 +599,7 @@ public class AbstractConvexHyperplaneBoundedRegionTest {
));
// assert
- Assert.assertEquals(3, region.getBoundaries().size());
+ Assertions.assertEquals(3, region.getBoundaries().size());
checkClassify(region, RegionLocation.INSIDE, new TestPoint2D(0.25, 0.25));
@@ -621,7 +621,7 @@ public class AbstractConvexHyperplaneBoundedRegionTest {
TestLine.Y_AXIS));
// assert
- Assert.assertEquals(1, region.getBoundaries().size());
+ Assertions.assertEquals(1, region.getBoundaries().size());
checkClassify(region, RegionLocation.INSIDE, new TestPoint2D(-1, 0));
checkClassify(region, RegionLocation.BOUNDARY, new TestPoint2D(0, 0));
@@ -653,13 +653,13 @@ public class AbstractConvexHyperplaneBoundedRegionTest {
final String str = region.toString();
// assert
- Assert.assertTrue(str.contains("StubRegion"));
- Assert.assertTrue(str.contains("boundaries= "));
+ Assertions.assertTrue(str.contains("StubRegion"));
+ Assertions.assertTrue(str.contains("boundaries= "));
}
private static void checkClassify(final Region<TestPoint2D> region, final RegionLocation loc, final TestPoint2D... pts) {
for (final TestPoint2D pt : pts) {
- Assert.assertEquals("Unexpected location for point " + pt, loc, region.classify(pt));
+ Assertions.assertEquals(loc, region.classify(pt), "Unexpected location for point " + pt);
}
}
diff --git a/commons-geometry-core/src/test/java/org/apache/commons/geometry/core/partitioning/AbstractHyperplaneTest.java b/commons-geometry-core/src/test/java/org/apache/commons/geometry/core/partitioning/AbstractHyperplaneTest.java
index 0df3964..051b50d 100644
--- a/commons-geometry-core/src/test/java/org/apache/commons/geometry/core/partitioning/AbstractHyperplaneTest.java
+++ b/commons-geometry-core/src/test/java/org/apache/commons/geometry/core/partitioning/AbstractHyperplaneTest.java
@@ -21,8 +21,8 @@ import org.apache.commons.geometry.core.partitioning.test.TestLine;
import org.apache.commons.geometry.core.partitioning.test.TestPoint2D;
import org.apache.commons.geometry.core.precision.DoublePrecisionContext;
import org.apache.commons.geometry.core.precision.EpsilonDoublePrecisionContext;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
public class AbstractHyperplaneTest {
@@ -33,7 +33,7 @@ public class AbstractHyperplaneTest {
final StubHyperplane hyper = new StubHyperplane(precision);
// act/assert
- Assert.assertSame(precision, hyper.getPrecision());
+ Assertions.assertSame(precision, hyper.getPrecision());
}
@Test
@@ -43,13 +43,13 @@ public class AbstractHyperplaneTest {
final StubHyperplane hyper = new StubHyperplane(precision);
// act/assert
- Assert.assertEquals(HyperplaneLocation.MINUS, hyper.classify(new TestPoint2D(1, 1)));
+ Assertions.assertEquals(HyperplaneLocation.MINUS, hyper.classify(new TestPoint2D(1, 1)));
- Assert.assertEquals(HyperplaneLocation.ON, hyper.classify(new TestPoint2D(1, 0.09)));
- Assert.assertEquals(HyperplaneLocation.ON, hyper.classify(new TestPoint2D(1, 0)));
- Assert.assertEquals(HyperplaneLocation.ON, hyper.classify(new TestPoint2D(1, -0.09)));
+ Assertions.assertEquals(HyperplaneLocation.ON, hyper.classify(new TestPoint2D(1, 0.09)));
+ Assertions.assertEquals(HyperplaneLocation.ON, hyper.classify(new TestPoint2D(1, 0)));
+ Assertions.assertEquals(HyperplaneLocation.ON, hyper.classify(new TestPoint2D(1, -0.09)));
- Assert.assertEquals(HyperplaneLocation.PLUS, hyper.classify(new TestPoint2D(1, -1)));
+ Assertions.assertEquals(HyperplaneLocation.PLUS, hyper.classify(new TestPoint2D(1, -1)));
}
@Test
@@ -59,13 +59,13 @@ public class AbstractHyperplaneTest {
final StubHyperplane hyper = new StubHyperplane(precision);
// act/assert
- Assert.assertFalse(hyper.contains(new TestPoint2D(1, 1)));
+ Assertions.assertFalse(hyper.contains(new TestPoint2D(1, 1)));
- Assert.assertTrue(hyper.contains(new TestPoint2D(1, 0.09)));
- Assert.assertTrue(hyper.contains(new TestPoint2D(1, 0)));
- Assert.assertTrue(hyper.contains(new TestPoint2D(1, -0.09)));
+ Assertions.assertTrue(hyper.contains(new TestPoint2D(1, 0.09)));
+ Assertions.assertTrue(hyper.contains(new TestPoint2D(1, 0)));
+ Assertions.assertTrue(hyper.contains(new TestPoint2D(1, -0.09)));
- Assert.assertFalse(hyper.contains(new TestPoint2D(1, -1)));
+ Assertions.assertFalse(hyper.contains(new TestPoint2D(1, -1)));
}
public static class StubHyperplane extends AbstractHyperplane<TestPoint2D> {
diff --git a/commons-geometry-core/src/test/java/org/apache/commons/geometry/core/partitioning/SplitTest.java b/commons-geometry-core/src/test/java/org/apache/commons/geometry/core/partitioning/SplitTest.java
index 82d84e1..1bbdcf6 100644
--- a/commons-geometry-core/src/test/java/org/apache/commons/geometry/core/partitioning/SplitTest.java
+++ b/commons-geometry-core/src/test/java/org/apache/commons/geometry/core/partitioning/SplitTest.java
@@ -16,8 +16,8 @@
*/
package org.apache.commons.geometry.core.partitioning;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
public class SplitTest {
@@ -31,8 +31,8 @@ public class SplitTest {
final Split<Object> split = new Split<>(a, b);
// assert
- Assert.assertSame(a, split.getMinus());
- Assert.assertSame(b, split.getPlus());
+ Assertions.assertSame(a, split.getMinus());
+ Assertions.assertSame(b, split.getPlus());
}
@Test
@@ -42,10 +42,10 @@ public class SplitTest {
final Object b = new Object();
// act/assert
- Assert.assertEquals(SplitLocation.NEITHER, new Split<Object>(null, null).getLocation());
- Assert.assertEquals(SplitLocation.MINUS, new Split<Object>(a, null).getLocation());
- Assert.assertEquals(SplitLocation.PLUS, new Split<Object>(null, b).getLocation());
- Assert.assertEquals(SplitLocation.BOTH, new Split<Object>(a, b).getLocation());
+ Assertions.assertEquals(SplitLocation.NEITHER, new Split<Object>(null, null).getLocation());
+ Assertions.assertEquals(SplitLocation.MINUS, new Split<Object>(a, null).getLocation());
+ Assertions.assertEquals(SplitLocation.PLUS, new Split<Object>(null, b).getLocation());
+ Assertions.assertEquals(SplitLocation.BOTH, new Split<Object>(a, b).getLocation());
}
@Test
@@ -57,6 +57,6 @@ public class SplitTest {
final String str = split.toString();
// assert
- Assert.assertEquals("Split[location= BOTH, minus= a, plus= b]", str);
+ Assertions.assertEquals("Split[location= BOTH, minus= a, plus= b]", str);
}
}
diff --git a/commons-geometry-core/src/test/java/org/apache/commons/geometry/core/partitioning/bsp/AbstractBSPTreeMergeOperatorTest.java b/commons-geometry-core/src/test/java/org/apache/commons/geometry/core/partitioning/bsp/AbstractBSPTreeMergeOperatorTest.java
index e29fb43..df068bb 100644
--- a/commons-geometry-core/src/test/java/org/apache/commons/geometry/core/partitioning/bsp/AbstractBSPTreeMergeOperatorTest.java
+++ b/commons-geometry-core/src/test/java/org/apache/commons/geometry/core/partitioning/bsp/AbstractBSPTreeMergeOperatorTest.java
@@ -23,8 +23,8 @@ import org.apache.commons.geometry.core.partitioning.test.AttributeBSPTree.Attri
import org.apache.commons.geometry.core.partitioning.test.PartitionTestUtils;
import org.apache.commons.geometry.core.partitioning.test.TestLine;
import org.apache.commons.geometry.core.partitioning.test.TestPoint2D;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
public class AbstractBSPTreeMergeOperatorTest {
@@ -45,20 +45,20 @@ public class AbstractBSPTreeMergeOperatorTest {
mergeOp.apply(a, b, c);
// assert
- Assert.assertEquals(1, a.count());
- Assert.assertEquals(1, b.count());
- Assert.assertEquals(1, c.count());
+ Assertions.assertEquals(1, a.count());
+ Assertions.assertEquals(1, b.count());
+ Assertions.assertEquals(1, c.count());
- Assert.assertEquals("A", a.findNode(new TestPoint2D(0, 1)).getAttribute());
- Assert.assertEquals("A", a.findNode(new TestPoint2D(0, -1)).getAttribute());
+ Assertions.assertEquals("A", a.findNode(new TestPoint2D(0, 1)).getAttribute());
+ Assertions.assertEquals("A", a.findNode(new TestPoint2D(0, -1)).getAttribute());
- Assert.assertEquals("B", b.findNode(new TestPoint2D(0, 1)).getAttribute());
- Assert.assertEquals("B", b.findNode(new TestPoint2D(0, -1)).getAttribute());
+ Assertions.assertEquals("B", b.findNode(new TestPoint2D(0, 1)).getAttribute());
+ Assertions.assertEquals("B", b.findNode(new TestPoint2D(0, -1)).getAttribute());
- Assert.assertEquals("AB", c.findNode(new TestPoint2D(1, 1)).getAttribute());
- Assert.assertEquals("AB", c.findNode(new TestPoint2D(-1, 1)).getAttribute());
- Assert.assertEquals("AB", c.findNode(new TestPoint2D(-1, -1)).getAttribute());
- Assert.assertEquals("AB", c.findNode(new TestPoint2D(1, -1)).getAttribute());
+ Assertions.assertEquals("AB", c.findNode(new TestPoint2D(1, 1)).getAttribute());
+ Assertions.assertEquals("AB", c.findNode(new TestPoint2D(-1, 1)).getAttribute());
+ Assertions.assertEquals("AB", c.findNode(new TestPoint2D(-1, -1)).getAttribute());
+ Assertions.assertEquals("AB", c.findNode(new TestPoint2D(1, -1)).getAttribute());
PartitionTestUtils.assertTreeStructure(a);
PartitionTestUtils.assertTreeStructure(b);
@@ -85,20 +85,20 @@ public class AbstractBSPTreeMergeOperatorTest {
mergeOp.apply(a, b, c);
// assert
- Assert.assertEquals(3, a.count());
- Assert.assertEquals(1, b.count());
- Assert.assertEquals(3, c.count());
+ Assertions.assertEquals(3, a.count());
+ Assertions.assertEquals(1, b.count());
+ Assertions.assertEquals(3, c.count());
- Assert.assertEquals("a", a.findNode(new TestPoint2D(0, 1)).getAttribute());
- Assert.assertEquals("A", a.findNode(new TestPoint2D(0, -1)).getAttribute());
+ Assertions.assertEquals("a", a.findNode(new TestPoint2D(0, 1)).getAttribute());
+ Assertions.assertEquals("A", a.findNode(new TestPoint2D(0, -1)).getAttribute());
- Assert.assertEquals("B", b.findNode(new TestPoint2D(0, 1)).getAttribute());
- Assert.assertEquals("B", b.findNode(new TestPoint2D(0, -1)).getAttribute());
+ Assertions.assertEquals("B", b.findNode(new TestPoint2D(0, 1)).getAttribute());
+ Assertions.assertEquals("B", b.findNode(new TestPoint2D(0, -1)).getAttribute());
- Assert.assertEquals("Ba", c.findNode(new TestPoint2D(1, 1)).getAttribute());
- Assert.assertEquals("Ba", c.findNode(new TestPoint2D(-1, 1)).getAttribute());
- Assert.assertEquals("BA", c.findNode(new TestPoint2D(-1, -1)).getAttribute());
- Assert.assertEquals("BA", c.findNode(new TestPoint2D(1, -1)).getAttribute());
+ Assertions.assertEquals("Ba", c.findNode(new TestPoint2D(1, 1)).getAttribute());
+ Assertions.assertEquals("Ba", c.findNode(new TestPoint2D(-1, 1)).getAttribute());
+ Assertions.assertEquals("BA", c.findNode(new TestPoint2D(-1, -1)).getAttribute());
+ Assertions.assertEquals("BA", c.findNode(new TestPoint2D(1, -1)).getAttribute());
PartitionTestUtils.assertTreeStructure(a);
PartitionTestUtils.assertTreeStructure(b);
@@ -125,20 +125,20 @@ public class AbstractBSPTreeMergeOperatorTest {
mergeOp.apply(a, b, c);
// assert
- Assert.assertEquals(1, a.count());
- Assert.assertEquals(3, b.count());
- Assert.assertEquals(3, c.count());
+ Assertions.assertEquals(1, a.count());
+ Assertions.assertEquals(3, b.count());
+ Assertions.assertEquals(3, c.count());
- Assert.assertEquals("A", a.findNode(new TestPoint2D(0, 1)).getAttribute());
- Assert.assertEquals("A", a.findNode(new TestPoint2D(0, -1)).getAttribute());
+ Assertions.assertEquals("A", a.findNode(new TestPoint2D(0, 1)).getAttribute());
+ Assertions.assertEquals("A", a.findNode(new TestPoint2D(0, -1)).getAttribute());
- Assert.assertEquals("b", b.findNode(new TestPoint2D(0, 1)).getAttribute());
- Assert.assertEquals("B", b.findNode(new TestPoint2D(0, -1)).getAttribute());
+ Assertions.assertEquals("b", b.findNode(new TestPoint2D(0, 1)).getAttribute());
+ Assertions.assertEquals("B", b.findNode(new TestPoint2D(0, -1)).getAttribute());
- Assert.assertEquals("Ab", c.findNode(new TestPoint2D(1, 1)).getAttribute());
- Assert.assertEquals("Ab", c.findNode(new TestPoint2D(-1, 1)).getAttribute());
- Assert.assertEquals("AB", c.findNode(new TestPoint2D(-1, -1)).getAttribute());
- Assert.assertEquals("AB", c.findNode(new TestPoint2D(1, -1)).getAttribute());
+ Assertions.assertEquals("Ab", c.findNode(new TestPoint2D(1, 1)).getAttribute());
+ Assertions.assertEquals("Ab", c.findNode(new TestPoint2D(-1, 1)).getAttribute());
+ Assertions.assertEquals("AB", c.findNode(new TestPoint2D(-1, -1)).getAttribute());
+ Assertions.assertEquals("AB", c.findNode(new TestPoint2D(1, -1)).getAttribute());
PartitionTestUtils.assertTreeStructure(a);
PartitionTestUtils.assertTreeStructure(b);
@@ -168,20 +168,20 @@ public class AbstractBSPTreeMergeOperatorTest {
mergeOp.apply(a, b, c);
// assert
- Assert.assertEquals(3, a.count());
- Assert.assertEquals(3, b.count());
- Assert.assertEquals(7, c.count());
+ Assertions.assertEquals(3, a.count());
+ Assertions.assertEquals(3, b.count());
+ Assertions.assertEquals(7, c.count());
- Assert.assertEquals("a", a.findNode(new TestPoint2D(0, 1)).getAttribute());
- Assert.assertEquals("A", a.findNode(new TestPoint2D(0, -1)).getAttribute());
+ Assertions.assertEquals("a", a.findNode(new TestPoint2D(0, 1)).getAttribute());
+ Assertions.assertEquals("A", a.findNode(new TestPoint2D(0, -1)).getAttribute());
- Assert.assertEquals("B", b.findNode(new TestPoint2D(1, 0)).getAttribute());
- Assert.assertEquals("b", b.findNode(new TestPoint2D(-1, 0)).getAttribute());
+ Assertions.assertEquals("B", b.findNode(new TestPoint2D(1, 0)).getAttribute());
+ Assertions.assertEquals("b", b.findNode(new TestPoint2D(-1, 0)).getAttribute());
- Assert.assertEquals("aB", c.findNode(new TestPoint2D(1, 1)).getAttribute());
- Assert.assertEquals("ab", c.findNode(new TestPoint2D(-1, 1)).getAttribute());
- Assert.assertEquals("Ab", c.findNode(new TestPoint2D(-1, -1)).getAttribute());
- Assert.assertEquals("AB", c.findNode(new TestPoint2D(1, -1)).getAttribute());
+ Assertions.assertEquals("aB", c.findNode(new TestPoint2D(1, 1)).getAttribute());
+ Assertions.assertEquals("ab", c.findNode(new TestPoint2D(-1, 1)).getAttribute());
+ Assertions.assertEquals("Ab", c.findNode(new TestPoint2D(-1, -1)).getAttribute());
+ Assertions.assertEquals("AB", c.findNode(new TestPoint2D(1, -1)).getAttribute());
PartitionTestUtils.assertTreeStructure(a);
PartitionTestUtils.assertTreeStructure(b);
@@ -211,20 +211,20 @@ public class AbstractBSPTreeMergeOperatorTest {
mergeOp.apply(a, b, c);
// assert
- Assert.assertEquals(3, a.count());
- Assert.assertEquals(3, b.count());
- Assert.assertEquals(3, c.count());
+ Assertions.assertEquals(3, a.count());
+ Assertions.assertEquals(3, b.count());
+ Assertions.assertEquals(3, c.count());
- Assert.assertEquals("a", a.findNode(new TestPoint2D(0, 1)).getAttribute());
- Assert.assertEquals("A", a.findNode(new TestPoint2D(0, -1)).getAttribute());
+ Assertions.assertEquals("a", a.findNode(new TestPoint2D(0, 1)).getAttribute());
+ Assertions.assertEquals("A", a.findNode(new TestPoint2D(0, -1)).getAttribute());
- Assert.assertEquals("b", b.findNode(new TestPoint2D(0, 1)).getAttribute());
- Assert.assertEquals("B", b.findNode(new TestPoint2D(0, -1)).getAttribute());
+ Assertions.assertEquals("b", b.findNode(new TestPoint2D(0, 1)).getAttribute());
+ Assertions.assertEquals("B", b.findNode(new TestPoint2D(0, -1)).getAttribute());
- Assert.assertEquals("ab", c.findNode(new TestPoint2D(1, 1)).getAttribute());
- Assert.assertEquals("ab", c.findNode(new TestPoint2D(-1, 1)).getAttribute());
- Assert.assertEquals("AB", c.findNode(new TestPoint2D(-1, -1)).getAttribute());
- Assert.assertEquals("AB", c.findNode(new TestPoint2D(1, -1)).getAttribute());
+ Assertions.assertEquals("ab", c.findNode(new TestPoint2D(1, 1)).getAttribute());
+ Assertions.assertEquals("ab", c.findNode(new TestPoint2D(-1, 1)).getAttribute());
+ Assertions.assertEquals("AB", c.findNode(new TestPoint2D(-1, -1)).getAttribute());
+ Assertions.assertEquals("AB", c.findNode(new TestPoint2D(1, -1)).getAttribute());
PartitionTestUtils.assertTreeStructure(a);
PartitionTestUtils.assertTreeStructure(b);
@@ -254,20 +254,20 @@ public class AbstractBSPTreeMergeOperatorTest {
mergeOp.apply(a, b, c);
// assert
- Assert.assertEquals(3, a.count());
- Assert.assertEquals(3, b.count());
- Assert.assertEquals(3, c.count());
+ Assertions.assertEquals(3, a.count());
+ Assertions.assertEquals(3, b.count());
+ Assertions.assertEquals(3, c.count());
- Assert.assertEquals("a", a.findNode(new TestPoint2D(0, 1)).getAttribute());
- Assert.assertEquals("A", a.findNode(new TestPoint2D(0, -1)).getAttribute());
+ Assertions.assertEquals("a", a.findNode(new TestPoint2D(0, 1)).getAttribute());
+ Assertions.assertEquals("A", a.findNode(new TestPoint2D(0, -1)).getAttribute());
- Assert.assertEquals("B", b.findNode(new TestPoint2D(0, 1)).getAttribute());
- Assert.assertEquals("b", b.findNode(new TestPoint2D(0, -1)).getAttribute());
+ Assertions.assertEquals("B", b.findNode(new TestPoint2D(0, 1)).getAttribute());
+ Assertions.assertEquals("b", b.findNode(new TestPoint2D(0, -1)).getAttribute());
- Assert.assertEquals("aB", c.findNode(new TestPoint2D(1, 1)).getAttribute());
- Assert.assertEquals("aB", c.findNode(new TestPoint2D(-1, 1)).getAttribute());
- Assert.assertEquals("Ab", c.findNode(new TestPoint2D(-1, -1)).getAttribute());
- Assert.assertEquals("Ab", c.findNode(new TestPoint2D(1, -1)).getAttribute());
+ Assertions.assertEquals("aB", c.findNode(new TestPoint2D(1, 1)).getAttribute());
+ Assertions.assertEquals("aB", c.findNode(new TestPoint2D(-1, 1)).getAttribute());
+ Assertions.assertEquals("Ab", c.findNode(new TestPoint2D(-1, -1)).getAttribute());
+ Assertions.assertEquals("Ab", c.findNode(new TestPoint2D(1, -1)).getAttribute());
PartitionTestUtils.assertTreeStructure(a);
PartitionTestUtils.assertTreeStructure(b);
@@ -297,23 +297,23 @@ public class AbstractBSPTreeMergeOperatorTest {
mergeOp.apply(a, b, c);
// assert
- Assert.assertEquals(3, a.count());
- Assert.assertEquals(3, b.count());
- Assert.assertEquals(5, c.count());
+ Assertions.assertEquals(3, a.count());
+ Assertions.assertEquals(3, b.count());
+ Assertions.assertEquals(5, c.count());
- Assert.assertEquals("a", a.findNode(new TestPoint2D(0, 1)).getAttribute());
- Assert.assertEquals("A", a.findNode(new TestPoint2D(0, -1)).getAttribute());
+ Assertions.assertEquals("a", a.findNode(new TestPoint2D(0, 1)).getAttribute());
+ Assertions.assertEquals("A", a.findNode(new TestPoint2D(0, -1)).getAttribute());
- Assert.assertEquals("b", b.findNode(new TestPoint2D(0, -1)).getAttribute());
- Assert.assertEquals("B", b.findNode(new TestPoint2D(0, -3)).getAttribute());
+ Assertions.assertEquals("b", b.findNode(new TestPoint2D(0, -1)).getAttribute());
+ Assertions.assertEquals("B", b.findNode(new TestPoint2D(0, -3)).getAttribute());
- Assert.assertEquals("ab", c.findNode(new TestPoint2D(1, 1)).getAttribute());
- Assert.assertEquals("ab", c.findNode(new TestPoint2D(-1, 1)).getAttribute());
- Assert.assertEquals("Ab", c.findNode(new TestPoint2D(-1, -1)).getAttribute());
- Assert.assertEquals("Ab", c.findNode(new TestPoint2D(1, -1)).getAttribute());
+ Assertions.assertEquals("ab", c.findNode(new TestPoint2D(1, 1)).getAttribute());
+ Assertions.assertEquals("ab", c.findNode(new TestPoint2D(-1, 1)).getAttribute());
+ Assertions.assertEquals("Ab", c.findNode(new TestPoint2D(-1, -1)).getAttribute());
+ Assertions.assertEquals("Ab", c.findNode(new TestPoint2D(1, -1)).getAttribute());
- Assert.assertEquals("AB", c.findNode(new TestPoint2D(-1, -3)).getAttribute());
- Assert.assertEquals("AB", c.findNode(new TestPoint2D(1, -3)).getAttribute());
+ Assertions.assertEquals("AB", c.findNode(new TestPoint2D(-1, -3)).getAttribute());
+ Assertions.assertEquals("AB", c.findNode(new TestPoint2D(1, -3)).getAttribute());
PartitionTestUtils.assertTreeStructure(a);
PartitionTestUtils.assertTreeStructure(b);
@@ -343,23 +343,23 @@ public class AbstractBSPTreeMergeOperatorTest {
mergeOp.apply(a, b, c);
// assert
- Assert.assertEquals(3, a.count());
- Assert.assertEquals(3, b.count());
- Assert.assertEquals(5, c.count());
+ Assertions.assertEquals(3, a.count());
+ Assertions.assertEquals(3, b.count());
+ Assertions.assertEquals(5, c.count());
- Assert.assertEquals("a", a.findNode(new TestPoint2D(0, 1)).getAttribute());
- Assert.assertEquals("A", a.findNode(new TestPoint2D(0, -1)).getAttribute());
+ Assertions.assertEquals("a", a.findNode(new TestPoint2D(0, 1)).getAttribute());
+ Assertions.assertEquals("A", a.findNode(new TestPoint2D(0, -1)).getAttribute());
- Assert.assertEquals("B", b.findNode(new TestPoint2D(0, -1)).getAttribute());
- Assert.assertEquals("b", b.findNode(new TestPoint2D(0, -3)).getAttribute());
+ Assertions.assertEquals("B", b.findNode(new TestPoint2D(0, -1)).getAttribute());
+ Assertions.assertEquals("b", b.findNode(new TestPoint2D(0, -3)).getAttribute());
- Assert.assertEquals("aB", c.findNode(new TestPoint2D(1, 1)).getAttribute());
- Assert.assertEquals("aB", c.findNode(new TestPoint2D(-1, 1)).getAttribute());
- Assert.assertEquals("AB", c.findNode(new TestPoint2D(-1, -1)).getAttribute());
- Assert.assertEquals("AB", c.findNode(new TestPoint2D(1, -1)).getAttribute());
+ Assertions.assertEquals("aB", c.findNode(new TestPoint2D(1, 1)).getAttribute());
+ Assertions.assertEquals("aB", c.findNode(new TestPoint2D(-1, 1)).getAttribute());
+ Assertions.assertEquals("AB", c.findNode(new TestPoint2D(-1, -1)).getAttribute());
+ Assertions.assertEquals("AB", c.findNode(new TestPoint2D(1, -1)).getAttribute());
- Assert.assertEquals("Ab", c.findNode(new TestPoint2D(-1, -3)).getAttribute());
- Assert.assertEquals("Ab", c.findNode(new TestPoint2D(1, -3)).getAttribute());
+ Assertions.assertEquals("Ab", c.findNode(new TestPoint2D(-1, -3)).getAttribute());
+ Assertions.assertEquals("Ab", c.findNode(new TestPoint2D(1, -3)).getAttribute());
PartitionTestUtils.assertTreeStructure(a);
PartitionTestUtils.assertTreeStructure(b);
@@ -389,23 +389,23 @@ public class AbstractBSPTreeMergeOperatorTest {
mergeOp.apply(a, b, c);
// assert
- Assert.assertEquals(3, a.count());
- Assert.assertEquals(3, b.count());
- Assert.assertEquals(5, c.count());
+ Assertions.assertEquals(3, a.count());
+ Assertions.assertEquals(3, b.count());
+ Assertions.assertEquals(5, c.count());
- Assert.assertEquals("a", a.findNode(new TestPoint2D(0, 1)).getAttribute());
- Assert.assertEquals("A", a.findNode(new TestPoint2D(0, -1)).getAttribute());
+ Assertions.assertEquals("a", a.findNode(new TestPoint2D(0, 1)).getAttribute());
+ Assertions.assertEquals("A", a.findNode(new TestPoint2D(0, -1)).getAttribute());
- Assert.assertEquals("B", b.findNode(new TestPoint2D(0, 1)).getAttribute());
- Assert.assertEquals("b", b.findNode(new TestPoint2D(0, 3)).getAttribute());
+ Assertions.assertEquals("B", b.findNode(new TestPoint2D(0, 1)).getAttribute());
+ Assertions.assertEquals("b", b.findNode(new TestPoint2D(0, 3)).getAttribute());
- Assert.assertEquals("aB", c.findNode(new TestPoint2D(1, 1)).getAttribute());
- Assert.assertEquals("aB", c.findNode(new TestPoint2D(-1, 1)).getAttribute());
- Assert.assertEquals("AB", c.findNode(new TestPoint2D(-1, -1)).getAttribute());
- Assert.assertEquals("AB", c.findNode(new TestPoint2D(1, -1)).getAttribute());
+ Assertions.assertEquals("aB", c.findNode(new TestPoint2D(1, 1)).getAttribute());
+ Assertions.assertEquals("aB", c.findNode(new TestPoint2D(-1, 1)).getAttribute());
+ Assertions.assertEquals("AB", c.findNode(new TestPoint2D(-1, -1)).getAttribute());
+ Assertions.assertEquals("AB", c.findNode(new TestPoint2D(1, -1)).getAttribute());
- Assert.assertEquals("ab", c.findNode(new TestPoint2D(-1, 3)).getAttribute());
- Assert.assertEquals("ab", c.findNode(new TestPoint2D(1, 3)).getAttribute());
+ Assertions.assertEquals("ab", c.findNode(new TestPoint2D(-1, 3)).getAttribute());
+ Assertions.assertEquals("ab", c.findNode(new TestPoint2D(1, 3)).getAttribute());
PartitionTestUtils.assertTreeStructure(a);
PartitionTestUtils.assertTreeStructure(b);
@@ -435,23 +435,23 @@ public class AbstractBSPTreeMergeOperatorTest {
mergeOp.apply(a, b, c);
// assert
- Assert.assertEquals(3, a.count());
- Assert.assertEquals(3, b.count());
- Assert.assertEquals(5, c.count());
+ Assertions.assertEquals(3, a.count());
+ Assertions.assertEquals(3, b.count());
+ Assertions.assertEquals(5, c.count());
- Assert.assertEquals("a", a.findNode(new TestPoint2D(0, 1)).getAttribute());
- Assert.assertEquals("A", a.findNode(new TestPoint2D(0, -1)).getAttribute());
+ Assertions.assertEquals("a", a.findNode(new TestPoint2D(0, 1)).getAttribute());
+ Assertions.assertEquals("A", a.findNode(new TestPoint2D(0, -1)).getAttribute());
- Assert.assertEquals("b", b.findNode(new TestPoint2D(0, 1)).getAttribute());
- Assert.assertEquals("B", b.findNode(new TestPoint2D(0, 3)).getAttribute());
+ Assertions.assertEquals("b", b.findNode(new TestPoint2D(0, 1)).getAttribute());
+ Assertions.assertEquals("B", b.findNode(new TestPoint2D(0, 3)).getAttribute());
- Assert.assertEquals("ab", c.findNode(new TestPoint2D(1, 1)).getAttribute());
- Assert.assertEquals("ab", c.findNode(new TestPoint2D(-1, 1)).getAttribute());
- Assert.assertEquals("Ab", c.findNode(new TestPoint2D(-1, -1)).getAttribute());
- Assert.assertEquals("Ab", c.findNode(new TestPoint2D(1, -1)).getAttribute());
+ Assertions.assertEquals("ab", c.findNode(new TestPoint2D(1, 1)).getAttribute());
+ Assertions.assertEquals("ab", c.findNode(new TestPoint2D(-1, 1)).getAttribute());
+ Assertions.assertEquals("Ab", c.findNode(new TestPoint2D(-1, -1)).getAttribute());
+ Assertions.assertEquals("Ab", c.findNode(new TestPoint2D(1, -1)).getAttribute());
- Assert.assertEquals("aB", c.findNode(new TestPoint2D(-1, 3)).getAttribute());
- Assert.assertEquals("aB", c.findNode(new TestPoint2D(1, 3)).getAttribute());
+ Assertions.assertEquals("aB", c.findNode(new TestPoint2D(-1, 3)).getAttribute());
+ Assertions.assertEquals("aB", c.findNode(new TestPoint2D(1, 3)).getAttribute());
PartitionTestUtils.assertTreeStructure(a);
PartitionTestUtils.assertTreeStructure(b);
@@ -479,16 +479,16 @@ public class AbstractBSPTreeMergeOperatorTest {
mergeOp.apply(a, b, a);
// assert
- Assert.assertEquals(7, a.count());
- Assert.assertEquals(3, b.count());
+ Assertions.assertEquals(7, a.count());
+ Assertions.assertEquals(3, b.count());
- Assert.assertEquals("B", b.findNode(new TestPoint2D(1, 0)).getAttribute());
- Assert.assertEquals("b", b.findNode(new TestPoint2D(-1, 0)).getAttribute());
+ Assertions.assertEquals("B", b.findNode(new TestPoint2D(1, 0)).getAttribute());
+ Assertions.assertEquals("b", b.findNode(new TestPoint2D(-1, 0)).getAttribute());
- Assert.assertEquals("aB", a.findNode(new TestPoint2D(1, 1)).getAttribute());
- Assert.assertEquals("ab", a.findNode(new TestPoint2D(-1, 1)).getAttribute());
- Assert.assertEquals("Ab", a.findNode(new TestPoint2D(-1, -1)).getAttribute());
- Assert.assertEquals("AB", a.findNode(new TestPoint2D(1, -1)).getAttribute());
+ Assertions.assertEquals("aB", a.findNode(new TestPoint2D(1, 1)).getAttribute());
+ Assertions.assertEquals("ab", a.findNode(new TestPoint2D(-1, 1)).getAttribute());
+ Assertions.assertEquals("Ab", a.findNode(new TestPoint2D(-1, -1)).getAttribute());
+ Assertions.assertEquals("AB", a.findNode(new TestPoint2D(1, -1)).getAttribute());
PartitionTestUtils.assertTreeStructure(a);
PartitionTestUtils.assertTreeStructure(b);
@@ -515,16 +515,16 @@ public class AbstractBSPTreeMergeOperatorTest {
mergeOp.apply(a, b, b);
// assert
- Assert.assertEquals(3, a.count());
- Assert.assertEquals(7, b.count());
+ Assertions.assertEquals(3, a.count());
+ Assertions.assertEquals(7, b.count());
- Assert.assertEquals("a", a.findNode(new TestPoint2D(0, 1)).getAttribute());
- Assert.assertEquals("A", a.findNode(new TestPoint2D(0, -1)).getAttribute());
+ Assertions.assertEquals("a", a.findNode(new TestPoint2D(0, 1)).getAttribute());
+ Assertions.assertEquals("A", a.findNode(new TestPoint2D(0, -1)).getAttribute());
- Assert.assertEquals("aB", b.findNode(new TestPoint2D(1, 1)).getAttribute());
- Assert.assertEquals("ab", b.findNode(new TestPoint2D(-1, 1)).getAttribute());
- Assert.assertEquals("Ab", b.findNode(new TestPoint2D(-1, -1)).getAttribute());
- Assert.assertEquals("AB", b.findNode(new TestPoint2D(1, -1)).getAttribute());
+ Assertions.assertEquals("aB", b.findNode(new TestPoint2D(1, 1)).getAttribute());
+ Assertions.assertEquals("ab", b.findNode(new TestPoint2D(-1, 1)).getAttribute());
+ Assertions.assertEquals("Ab", b.findNode(new TestPoint2D(-1, -1)).getAttribute());
+ Assertions.assertEquals("AB", b.findNode(new TestPoint2D(1, -1)).getAttribute());
PartitionTestUtils.assertTreeStructure(a);
PartitionTestUtils.assertTreeStructure(b);
diff --git a/commons-geometry-core/src/test/java/org/apache/commons/geometry/core/partitioning/bsp/AbstractBSPTreeTest.java b/commons-geometry-core/src/test/java/org/apache/commons/geometry/core/partitioning/bsp/AbstractBSPTreeTest.java
index 2c04112..3ab7aa2 100644
--- a/commons-geometry-core/src/test/java/org/apache/commons/geometry/core/partitioning/bsp/AbstractBSPTreeTest.java
+++ b/commons-geometry-core/src/test/java/org/apache/commons/geometry/core/partitioning/bsp/AbstractBSPTreeTest.java
@@ -38,8 +38,8 @@ import org.apache.commons.geometry.core.partitioning.test.TestLineSegment;
import org.apache.commons.geometry.core.partitioning.test.TestLineSegmentCollection;
import org.apache.commons.geometry.core.partitioning.test.TestPoint2D;
import org.apache.commons.geometry.core.partitioning.test.TestTransform2D;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
public class AbstractBSPTreeTest {
@@ -51,14 +51,14 @@ public class AbstractBSPTreeTest {
// assert
final TestNode root = tree.getRoot();
- Assert.assertNotNull(root);
- Assert.assertNull(root.getParent());
+ Assertions.assertNotNull(root);
+ Assertions.assertNull(root.getParent());
PartitionTestUtils.assertIsLeafNode(root);
- Assert.assertFalse(root.isPlus());
- Assert.assertFalse(root.isMinus());
+ Assertions.assertFalse(root.isPlus());
+ Assertions.assertFalse(root.isMinus());
- Assert.assertSame(tree, root.getTree());
+ Assertions.assertSame(tree, root.getTree());
}
@Test
@@ -73,20 +73,20 @@ public class AbstractBSPTreeTest {
final TestNode minus = root.getMinus();
// act/assert
- Assert.assertFalse(root.isLeaf());
- Assert.assertTrue(root.isInternal());
- Assert.assertFalse(root.isPlus());
- Assert.assertFalse(root.isMinus());
+ Assertions.assertFalse(root.isLeaf());
+ Assertions.assertTrue(root.isInternal());
+ Assertions.assertFalse(root.isPlus());
+ Assertions.assertFalse(root.isMinus());
- Assert.assertTrue(plus.isLeaf());
- Assert.assertFalse(plus.isInternal());
- Assert.assertTrue(plus.isPlus());
- Assert.assertFalse(plus.isMinus());
+ Assertions.assertTrue(plus.isLeaf());
+ Assertions.assertFalse(plus.isInternal());
+ Assertions.assertTrue(plus.isPlus());
+ Assertions.assertFalse(plus.isMinus());
- Assert.assertTrue(minus.isLeaf());
- Assert.assertFalse(minus.isInternal());
- Assert.assertFalse(minus.isPlus());
- Assert.assertTrue(minus.isMinus());
+ Assertions.assertTrue(minus.isLeaf());
+ Assertions.assertFalse(minus.isInternal());
+ Assertions.assertFalse(minus.isPlus());
+ Assertions.assertTrue(minus.isMinus());
}
@Test
@@ -99,12 +99,12 @@ public class AbstractBSPTreeTest {
final boolean result = tree.getRoot().insertCut(line);
// assert
- Assert.assertTrue(result);
+ Assertions.assertTrue(result);
final TestNode root = tree.getRoot();
PartitionTestUtils.assertIsInternalNode(root);
- Assert.assertSame(line, root.getCut().getHyperplane());
+ Assertions.assertSame(line, root.getCut().getHyperplane());
PartitionTestUtils.assertIsLeafNode(root.getMinus());
PartitionTestUtils.assertIsLeafNode(root.getPlus());
@@ -125,7 +125,7 @@ public class AbstractBSPTreeTest {
final boolean result = node.insertCut(new TestLine(0.5, 1.5, 1.5, 0.5));
// assert
- Assert.assertTrue(result);
+ Assertions.assertTrue(result);
PartitionTestUtils.assertIsInternalNode(node);
final TestLineSegment segment = (TestLineSegment) node.getCut();
@@ -149,7 +149,7 @@ public class AbstractBSPTreeTest {
final boolean result = node.insertCut(new TestLine(-2, 0, 0, -2));
// assert
- Assert.assertFalse(result);
+ Assertions.assertFalse(result);
PartitionTestUtils.assertIsLeafNode(node);
}
@@ -166,7 +166,7 @@ public class AbstractBSPTreeTest {
final boolean result = node.insertCut(new TestLine(0, -1, 1, -1));
// assert
- Assert.assertFalse(result);
+ Assertions.assertFalse(result);
PartitionTestUtils.assertIsLeafNode(node);
}
@@ -186,7 +186,7 @@ public class AbstractBSPTreeTest {
final boolean result = node.insertCut(new TestLine(-2, 0, 0, -2));
// assert
- Assert.assertFalse(result);
+ Assertions.assertFalse(result);
PartitionTestUtils.assertIsLeafNode(node);
}
@@ -206,7 +206,7 @@ public class AbstractBSPTreeTest {
final boolean result = node.insertCut(new TestLine(0, 2, 0, 3));
// assert
- Assert.assertFalse(result);
+ Assertions.assertFalse(result);
PartitionTestUtils.assertIsLeafNode(node);
}
@@ -226,7 +226,7 @@ public class AbstractBSPTreeTest {
final boolean result = node.insertCut(new TestLine(0, 3, 0, 2));
// assert
- Assert.assertTrue(result);
+ Assertions.assertTrue(result);
PartitionTestUtils.assertIsInternalNode(node);
}
@@ -243,11 +243,11 @@ public class AbstractBSPTreeTest {
final boolean result = node.insertCut(new TestLine(0, 0, -1, 0));
// assert
- Assert.assertTrue(result);
+ Assertions.assertTrue(result);
- Assert.assertSame(tree.getRoot().getPlus(), tree.findNode(new TestPoint2D(0, -1e-2)));
- Assert.assertSame(node.getMinus(), tree.findNode(new TestPoint2D(0, 0)));
- Assert.assertSame(node.getPlus(), tree.findNode(new TestPoint2D(0, 1e-2)));
+ Assertions.assertSame(tree.getRoot().getPlus(), tree.findNode(new TestPoint2D(0, -1e-2)));
+ Assertions.assertSame(node.getMinus(), tree.findNode(new TestPoint2D(0, 0)));
+ Assertions.assertSame(node.getPlus(), tree.findNode(new TestPoint2D(0, 1e-2)));
}
@Test
@@ -264,10 +264,10 @@ public class AbstractBSPTreeTest {
final boolean result = node.clearCut();
// assert
- Assert.assertTrue(result);
- Assert.assertTrue(node.isLeaf());
- Assert.assertNull(node.getPlus());
- Assert.assertNull(node.getMinus());
+ Assertions.assertTrue(result);
+ Assertions.assertTrue(node.isLeaf());
+ Assertions.assertNull(node.getPlus());
+ Assertions.assertNull(node.getMinus());
}
@Test
@@ -285,10 +285,10 @@ public class AbstractBSPTreeTest {
final boolean result = node.clearCut();
// assert
- Assert.assertFalse(result);
- Assert.assertTrue(node.isLeaf());
- Assert.assertNull(node.getPlus());
- Assert.assertNull(node.getMinus());
+ Assertions.assertFalse(result);
+ Assertions.assertTrue(node.isLeaf());
+ Assertions.assertNull(node.getPlus());
+ Assertions.assertNull(node.getMinus());
}
@Test
@@ -306,12 +306,12 @@ public class AbstractBSPTreeTest {
final boolean result = tree.getRoot().clearCut();
// assert
- Assert.assertTrue(result);
- Assert.assertTrue(node.isLeaf());
- Assert.assertNull(node.getPlus());
- Assert.assertNull(node.getMinus());
+ Assertions.assertTrue(result);
+ Assertions.assertTrue(node.isLeaf());
+ Assertions.assertNull(node.getPlus());
+ Assertions.assertNull(node.getMinus());
- Assert.assertEquals(1, tree.count());
+ Assertions.assertEquals(1, tree.count());
}
@Test
@@ -324,12 +324,12 @@ public class AbstractBSPTreeTest {
final boolean result = node.clearCut();
// assert
- Assert.assertFalse(result);
- Assert.assertTrue(node.isLeaf());
- Assert.assertNull(node.getPlus());
- Assert.assertNull(node.getMinus());
+ Assertions.assertFalse(result);
+ Assertions.assertTrue(node.isLeaf());
+ Assertions.assertNull(node.getPlus());
+ Assertions.assertNull(node.getMinus());
- Assert.assertEquals(1, tree.count());
+ Assertions.assertEquals(1, tree.count());
}
@Test
@@ -352,19 +352,19 @@ public class AbstractBSPTreeTest {
// act/assert
for (final TestPoint2D pt : testPoints) {
- Assert.assertSame(root, tree.findNode(pt));
+ Assertions.assertSame(root, tree.findNode(pt));
}
for (final TestPoint2D pt : testPoints) {
- Assert.assertSame(root, tree.findNode(pt, FindNodeCutRule.NODE));
+ Assertions.assertSame(root, tree.findNode(pt, FindNodeCutRule.NODE));
}
for (final TestPoint2D pt : testPoints) {
- Assert.assertSame(root, tree.findNode(pt, FindNodeCutRule.MINUS));
+ Assertions.assertSame(root, tree.findNode(pt, FindNodeCutRule.MINUS));
}
for (final TestPoint2D pt : testPoints) {
- Assert.assertSame(root, tree.findNode(pt, FindNodeCutRule.PLUS));
+ Assertions.assertSame(root, tree.findNode(pt, FindNodeCutRule.PLUS));
}
}
@@ -391,19 +391,19 @@ public class AbstractBSPTreeTest {
final TestNode aboveDiagonal = diagonalCut.getMinus();
// act/assert
- Assert.assertSame(minusXPlusY, tree.findNode(new TestPoint2D(0, 0)));
+ Assertions.assertSame(minusXPlusY, tree.findNode(new TestPoint2D(0, 0)));
- Assert.assertSame(underDiagonal, tree.findNode(new TestPoint2D(1, 0)));
- Assert.assertSame(aboveDiagonal, tree.findNode(new TestPoint2D(1, 1)));
- Assert.assertSame(minusXPlusY, tree.findNode(new TestPoint2D(0, 1)));
- Assert.assertSame(minusXPlusY, tree.findNode(new TestPoint2D(-1, 1)));
- Assert.assertSame(minusXPlusY, tree.findNode(new TestPoint2D(-1, 0)));
- Assert.assertSame(minusY, tree.findNode(new TestPoint2D(-1, -1)));
- Assert.assertSame(minusY, tree.findNode(new TestPoint2D(0, -1)));
- Assert.assertSame(minusY, tree.findNode(new TestPoint2D(1, -1)));
+ Assertions.assertSame(underDiagonal, tree.findNode(new TestPoint2D(1, 0)));
+ Assertions.assertSame(aboveDiagonal, tree.findNode(new TestPoint2D(1, 1)));
+ Assertions.assertSame(minusXPlusY, tree.findNode(new TestPoint2D(0, 1)));
+ Assertions.assertSame(minusXPlusY, tree.findNode(new TestPoint2D(-1, 1)));
+ Assertions.assertSame(minusXPlusY, tree.findNode(new TestPoint2D(-1, 0)));
+ Assertions.assertSame(minusY, tree.findNode(new TestPoint2D(-1, -1)));
+ Assertions.assertSame(minusY, tree.findNode(new TestPoint2D(0, -1)));
+ Assertions.assertSame(minusY, tree.findNode(new TestPoint2D(1, -1)));
- Assert.assertSame(underDiagonal, tree.findNode(new TestPoint2D(0.5, 0.5)));
- Assert.assertSame(aboveDiagonal, tree.findNode(new TestPoint2D(3, 3)));
+ Assertions.assertSame(underDiagonal, tree.findNode(new TestPoint2D(0.5, 0.5)));
+ Assertions.assertSame(aboveDiagonal, tree.findNode(new TestPoint2D(3, 3)));
}
@Test
@@ -431,19 +431,19 @@ public class AbstractBSPTreeTest {
final FindNodeCutRule cutBehavior = FindNodeCutRule.NODE;
// act/assert
- Assert.assertSame(root, tree.findNode(new TestPoint2D(0, 0), cutBehavior));
+ Assertions.assertSame(root, tree.findNode(new TestPoint2D(0, 0), cutBehavior));
- Assert.assertSame(root, tree.findNode(new TestPoint2D(1, 0), cutBehavior));
- Assert.assertSame(diagonalCut, tree.findNode(new TestPoint2D(1, 1), cutBehavior));
- Assert.assertSame(yCut, tree.findNode(new TestPoint2D(0, 1), cutBehavior));
- Assert.assertSame(minusXPlusY, tree.findNode(new TestPoint2D(-1, 1), cutBehavior));
- Assert.assertSame(root, tree.findNode(new TestPoint2D(-1, 0), cutBehavior));
- Assert.assertSame(minusY, tree.findNode(new TestPoint2D(-1, -1), cutBehavior));
- Assert.assertSame(minusY, tree.findNode(new TestPoint2D(0, -1), cutBehavior));
- Assert.assertSame(minusY, tree.findNode(new TestPoint2D(1, -1), cutBehavior));
+ Assertions.assertSame(root, tree.findNode(new TestPoint2D(1, 0), cutBehavior));
+ Assertions.assertSame(diagonalCut, tree.findNode(new TestPoint2D(1, 1), cutBehavior));
+ Assertions.assertSame(yCut, tree.findNode(new TestPoint2D(0, 1), cutBehavior));
+ Assertions.assertSame(minusXPlusY, tree.findNode(new TestPoint2D(-1, 1), cutBehavior));
+ Assertions.assertSame(root, tree.findNode(new TestPoint2D(-1, 0), cutBehavior));
+ Assertions.assertSame(minusY, tree.findNode(new TestPoint2D(-1, -1), cutBehavior));
+ Assertions.assertSame(minusY, tree.findNode(new TestPoint2D(0, -1), cutBehavior));
+ Assertions.assertSame(minusY, tree.findNode(new TestPoint2D(1, -1), cutBehavior));
- Assert.assertSame(underDiagonal, tree.findNode(new TestPoint2D(0.5, 0.5), cutBehavior));
- Assert.assertSame(aboveDiagonal, tree.findNode(new TestPoint2D(3, 3), cutBehavior));
+ Assertions.assertSame(underDiagonal, tree.findNode(new TestPoint2D(0.5, 0.5), cutBehavior));
+ Assertions.assertSame(aboveDiagonal, tree.findNode(new TestPoint2D(3, 3), cutBehavior));
}
@Test
@@ -471,19 +471,19 @@ public class AbstractBSPTreeTest {
final FindNodeCutRule cutBehavior = FindNodeCutRule.MINUS;
// act/assert
- Assert.assertSame(minusXPlusY, tree.findNode(new TestPoint2D(0, 0), cutBehavior));
+ Assertions.assertSame(minusXPlusY, tree.findNode(new TestPoint2D(0, 0), cutBehavior));
- Assert.assertSame(underDiagonal, tree.findNode(new TestPoint2D(1, 0), cutBehavior));
- Assert.assertSame(aboveDiagonal, tree.findNode(new TestPoint2D(1, 1), cutBehavior));
- Assert.assertSame(minusXPlusY, tree.findNode(new TestPoint2D(0, 1), cutBehavior));
- Assert.assertSame(minusXPlusY, tree.findNode(new TestPoint2D(-1, 1), cutBehavior));
- Assert.assertSame(minusXPlusY, tree.findNode(new TestPoint2D(-1, 0), cutBehavior));
- Assert.assertSame(minusY, tree.findNode(new TestPoint2D(-1, -1), cutBehavior));
- Assert.assertSame(minusY, tree.findNode(new TestPoint2D(0, -1), cutBehavior));
- Assert.assertSame(minusY, tree.findNode(new TestPoint2D(1, -1), cutBehavior));
+ Assertions.assertSame(underDiagonal, tree.findNode(new TestPoint2D(1, 0), cutBehavior));
+ Assertions.assertSame(aboveDiagonal, tree.findNode(new TestPoint2D(1, 1), cutBehavior));
+ Assertions.assertSame(minusXPlusY, tree.findNode(new TestPoint2D(0, 1), cutBehavior));
+ Assertions.assertSame(minusXPlusY, tree.findNode(new TestPoint2D(-1, 1), cutBehavior));
+ Assertions.assertSame(minusXPlusY, tree.findNode(new TestPoint2D(-1, 0), cutBehavior));
+ Assertions.assertSame(minusY, tree.findNode(new TestPoint2D(-1, -1), cutBehavior));
+ Assertions.assertSame(minusY, tree.findNode(new TestPoint2D(0, -1), cutBehavior));
+ Assertions.assertSame(minusY, tree.findNode(new TestPoint2D(1, -1), cutBehavior));
- Assert.assertSame(underDiagonal, tree.findNode(new TestPoint2D(0.5, 0.5), cutBehavior));
- Assert.assertSame(aboveDiagonal, tree.findNode(new TestPoint2D(3, 3), cutBehavior));
+ Assertions.assertSame(underDiagonal, tree.findNode(new TestPoint2D(0.5, 0.5), cutBehavior));
+ Assertions.assertSame(aboveDiagonal, tree.findNode(new TestPoint2D(3, 3), cutBehavior));
}
@Test
@@ -511,19 +511,19 @@ public class AbstractBSPTreeTest {
final FindNodeCutRule cutBehavior = FindNodeCutRule.PLUS;
// act/assert
- Assert.assertSame(minusY, tree.findNode(new TestPoint2D(0, 0), cutBehavior));
+ Assertions.assertSame(minusY, tree.findNode(new TestPoint2D(0, 0), cutBehavior));
- Assert.assertSame(minusY, tree.findNode(new TestPoint2D(1, 0), cutBehavior));
- Assert.assertSame(underDiagonal, tree.findNode(new TestPoint2D(1, 1), cutBehavior));
- Assert.assertSame(underDiagonal, tree.findNode(new TestPoint2D(0, 1), cutBehavior));
- Assert.assertSame(minusXPlusY, tree.findNode(new TestPoint2D(-1, 1), cutBehavior));
- Assert.assertSame(minusY, tree.findNode(new TestPoint2D(-1, 0), cutBehavior));
- Assert.assertSame(minusY, tree.findNode(new TestPoint2D(-1, -1), cutBehavior));
- Assert.assertSame(minusY, tree.findNode(new TestPoint2D(0, -1), cutBehavior));
- Assert.assertSame(minusY, tree.findNode(new TestPoint2D(1, -1), cutBehavior));
+ Assertions.assertSame(minusY, tree.findNode(new TestPoint2D(1, 0), cutBehavior));
+ Assertions.assertSame(underDiagonal, tree.findNode(new TestPoint2D(1, 1), cutBehavior));
+ Assertions.assertSame(underDiagonal, tree.findNode(new TestPoint2D(0, 1), cutBehavior));
+ Assertions.assertSame(minusXPlusY, tree.findNode(new TestPoint2D(-1, 1), cutBehavior));
+ Assertions.assertSame(minusY, tree.findNode(new TestPoint2D(-1, 0), cutBehavior));
+ Assertions.assertSame(minusY, tree.findNode(new TestPoint2D(-1, -1), cutBehavior));
+ Assertions.assertSame(minusY, tree.findNode(new TestPoint2D(0, -1), cutBehavior));
+ Assertions.assertSame(minusY, tree.findNode(new TestPoint2D(1, -1), cutBehavior));
- Assert.assertSame(underDiagonal, tree.findNode(new TestPoint2D(0.5, 0.5), cutBehavior));
- Assert.assertSame(aboveDiagonal, tree.findNode(new TestPoint2D(3, 3), cutBehavior));
+ Assertions.assertSame(underDiagonal, tree.findNode(new TestPoint2D(0.5, 0.5), cutBehavior));
+ Assertions.assertSame(aboveDiagonal, tree.findNode(new TestPoint2D(3, 3), cutBehavior));
}
@Test
@@ -536,9 +536,9 @@ public class AbstractBSPTreeTest {
// assert
final TestNode root = tree.getRoot();
- Assert.assertFalse(root.isLeaf());
- Assert.assertTrue(root.getMinus().isLeaf());
- Assert.assertTrue(root.getPlus().isLeaf());
+ Assertions.assertFalse(root.isLeaf());
+ Assertions.assertTrue(root.getMinus().isLeaf());
+ Assertions.assertTrue(root.getPlus().isLeaf());
final TestLineSegment seg = (TestLineSegment) root.getCut();
PartitionTestUtils.assertPointsEqual(
@@ -563,7 +563,7 @@ public class AbstractBSPTreeTest {
// assert
final TestNode root = tree.getRoot();
- Assert.assertFalse(root.isLeaf());
+ Assertions.assertFalse(root.isLeaf());
final TestNode node = tree.findNode(new TestPoint2D(0.5, 0.5));
final TestLineSegment seg = (TestLineSegment) node.getParent().getCut();
@@ -571,8 +571,8 @@ public class AbstractBSPTreeTest {
PartitionTestUtils.assertPointsEqual(new TestPoint2D(0, 2), seg.getStartPoint());
PartitionTestUtils.assertPointsEqual(new TestPoint2D(2, 0), seg.getEndPoint());
- Assert.assertTrue(tree.getRoot().getPlus().isLeaf());
- Assert.assertTrue(tree.getRoot().getMinus().getMinus().isLeaf());
+ Assertions.assertTrue(tree.getRoot().getPlus().isLeaf());
+ Assertions.assertTrue(tree.getRoot().getMinus().getMinus().isLeaf());
}
@Test
@@ -589,7 +589,7 @@ public class AbstractBSPTreeTest {
// assert
final TestNode root = tree.getRoot();
- Assert.assertFalse(root.isLeaf());
+ Assertions.assertFalse(root.isLeaf());
final TestNode plusXPlusY = tree.getRoot().getMinus().getPlus();
final TestLineSegment plusXPlusYSeg = (TestLineSegment) plusXPlusY.getCut();
@@ -627,7 +627,7 @@ public class AbstractBSPTreeTest {
// assert
final List<TestLineSegment> segments = getLineSegments(tree);
- Assert.assertEquals(3, segments.size());
+ Assertions.assertEquals(3, segments.size());
PartitionTestUtils.assertSegmentsEqual(
new TestLineSegment(Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, TestLine.X_AXIS),
@@ -655,7 +655,7 @@ public class AbstractBSPTreeTest {
// assert
final List<TestLineSegment> segments = getLineSegments(tree);
- Assert.assertEquals(5, segments.size());
+ Assertions.assertEquals(5, segments.size());
PartitionTestUtils.assertSegmentsEqual(
new TestLineSegment(Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, new TestLine(-1, -1, 1, -1)),
@@ -695,7 +695,7 @@ public class AbstractBSPTreeTest {
// assert
final List<TestLineSegment> segments = getLineSegments(tree);
- Assert.assertEquals(5, segments.size());
+ Assertions.assertEquals(5, segments.size());
PartitionTestUtils.assertSegmentsEqual(
new TestLineSegment(Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, new TestLine(-1, -1, 1, -1)),
@@ -734,7 +734,7 @@ public class AbstractBSPTreeTest {
// assert
final List<TestLineSegment> segments = getLineSegments(tree);
- Assert.assertEquals(5, segments.size());
+ Assertions.assertEquals(5, segments.size());
PartitionTestUtils.assertSegmentsEqual(
new TestLineSegment(Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, new TestLine(-1, -1, 1, -1)),
@@ -765,7 +765,7 @@ public class AbstractBSPTreeTest {
tree.insert(src);
// assert
- Assert.assertEquals(1, tree.count());
+ Assertions.assertEquals(1, tree.count());
}
@Test
@@ -774,28 +774,28 @@ public class AbstractBSPTreeTest {
final TestBSPTree tree = new TestBSPTree();
// act/assert
- Assert.assertEquals(1, tree.count());
- Assert.assertEquals(1, tree.getRoot().count());
+ Assertions.assertEquals(1, tree.count());
+ Assertions.assertEquals(1, tree.getRoot().count());
tree.getRoot().insertCut(TestLine.X_AXIS);
- Assert.assertEquals(1, tree.getRoot().getMinus().count());
- Assert.assertEquals(1, tree.getRoot().getPlus().count());
- Assert.assertEquals(3, tree.count());
+ Assertions.assertEquals(1, tree.getRoot().getMinus().count());
+ Assertions.assertEquals(1, tree.getRoot().getPlus().count());
+ Assertions.assertEquals(3, tree.count());
tree.getRoot().getPlus().insertCut(TestLine.Y_AXIS);
- Assert.assertEquals(1, tree.getRoot().getMinus().count());
- Assert.assertEquals(3, tree.getRoot().getPlus().count());
- Assert.assertEquals(5, tree.count());
+ Assertions.assertEquals(1, tree.getRoot().getMinus().count());
+ Assertions.assertEquals(3, tree.getRoot().getPlus().count());
+ Assertions.assertEquals(5, tree.count());
tree.getRoot().getMinus().insertCut(TestLine.Y_AXIS);
- Assert.assertEquals(3, tree.getRoot().getMinus().count());
- Assert.assertEquals(3, tree.getRoot().getPlus().count());
- Assert.assertEquals(7, tree.count());
+ Assertions.assertEquals(3, tree.getRoot().getMinus().count());
+ Assertions.assertEquals(3, tree.getRoot().getPlus().count());
+ Assertions.assertEquals(7, tree.count());
tree.getRoot().getMinus().insertCut(new TestLine(new TestPoint2D(-1, -1), new TestPoint2D(1, -1)));
- Assert.assertEquals(1, tree.getRoot().getMinus().count());
- Assert.assertEquals(3, tree.getRoot().getPlus().count());
- Assert.assertEquals(5, tree.count());
+ Assertions.assertEquals(1, tree.getRoot().getMinus().count());
+ Assertions.assertEquals(3, tree.getRoot().getPlus().count());
+ Assertions.assertEquals(5, tree.count());
}
@Test
@@ -804,35 +804,35 @@ public class AbstractBSPTreeTest {
final TestBSPTree tree = new TestBSPTree();
// act/assert
- Assert.assertEquals(0, tree.height());
- Assert.assertEquals(0, tree.getRoot().height());
+ Assertions.assertEquals(0, tree.height());
+ Assertions.assertEquals(0, tree.getRoot().height());
tree.getRoot().insertCut(TestLine.X_AXIS);
- Assert.assertEquals(0, tree.getRoot().getMinus().height());
- Assert.assertEquals(0, tree.getRoot().getPlus().height());
- Assert.assertEquals(1, tree.height());
+ Assertions.assertEquals(0, tree.getRoot().getMinus().height());
+ Assertions.assertEquals(0, tree.getRoot().getPlus().height());
+ Assertions.assertEquals(1, tree.height());
tree.getRoot().getPlus().insertCut(TestLine.Y_AXIS);
- Assert.assertEquals(0, tree.getRoot().getMinus().height());
- Assert.assertEquals(1, tree.getRoot().getPlus().height());
- Assert.assertEquals(2, tree.height());
+ Assertions.assertEquals(0, tree.getRoot().getMinus().height());
+ Assertions.assertEquals(1, tree.getRoot().getPlus().height());
+ Assertions.assertEquals(2, tree.height());
tree.getRoot().getMinus().insertCut(TestLine.Y_AXIS);
- Assert.assertEquals(1, tree.getRoot().getMinus().height());
- Assert.assertEquals(1, tree.getRoot().getPlus().height());
- Assert.assertEquals(2, tree.height());
+ Assertions.assertEquals(1, tree.getRoot().getMinus().height());
+ Assertions.assertEquals(1, tree.getRoot().getPlus().height());
+ Assertions.assertEquals(2, tree.height());
tree.getRoot().getMinus().clearCut();
- Assert.assertEquals(0, tree.getRoot().getMinus().height());
- Assert.assertEquals(1, tree.getRoot().getPlus().height());
- Assert.assertEquals(2, tree.height());
+ Assertions.assertEquals(0, tree.getRoot().getMinus().height());
+ Assertions.assertEquals(1, tree.getRoot().getPlus().height());
+ Assertions.assertEquals(2, tree.height());
tree.getRoot().getPlus().getPlus()
.insertCut(new TestLine(new TestPoint2D(0, -1), new TestPoint2D(1, -1)));
- Assert.assertEquals(0, tree.getRoot().getMinus().height());
- Assert.assertEquals(2, tree.getRoot().getPlus().height());
- Assert.assertEquals(3, tree.height());
+ Assertions.assertEquals(0, tree.getRoot().getMinus().height());
+ Assertions.assertEquals(2, tree.getRoot().getPlus().height());
+ Assertions.assertEquals(3, tree.height());
}
@Test
@@ -846,13 +846,13 @@ public class AbstractBSPTreeTest {
.cut(TestLine.Y_AXIS);
// act/assert
- Assert.assertEquals(0, root.depth());
+ Assertions.assertEquals(0, root.depth());
- Assert.assertEquals(1, root.getPlus().depth());
+ Assertions.assertEquals(1, root.getPlus().depth());
- Assert.assertEquals(1, root.getMinus().depth());
- Assert.assertEquals(2, root.getMinus().getPlus().depth());
- Assert.assertEquals(2, root.getMinus().getMinus().depth());
+ Assertions.assertEquals(1, root.getMinus().depth());
+ Assertions.assertEquals(2, root.getMinus().getPlus().depth());
+ Assertions.assertEquals(2, root.getMinus().getMinus().depth());
}
@Test
@@ -877,7 +877,7 @@ public class AbstractBSPTreeTest {
});
// assert
- Assert.assertEquals(
+ Assertions.assertEquals(
Arrays.asList(root, minus, minusMinus, minusPlus, plus),
nodes);
}
@@ -898,37 +898,37 @@ public class AbstractBSPTreeTest {
// act/assert
final TestVisitor plusMinusNode = new TestVisitor(BSPTreeVisitor.Order.PLUS_MINUS_NODE);
tree.accept(plusMinusNode);
- Assert.assertEquals(
+ Assertions.assertEquals(
Arrays.asList(plus, minusPlus, minusMinus, minus, root),
plusMinusNode.getVisited());
final TestVisitor plusNodeMinus = new TestVisitor(BSPTreeVisitor.Order.PLUS_NODE_MINUS);
tree.accept(plusNodeMinus);
- Assert.assertEquals(
+ Assertions.assertEquals(
Arrays.asList(plus, root, minusPlus, minus, minusMinus),
plusNodeMinus.getVisited());
final TestVisitor minusPlusNode = new TestVisitor(BSPTreeVisitor.Order.MINUS_PLUS_NODE);
tree.accept(minusPlusNode);
- Assert.assertEquals(
+ Assertions.assertEquals(
Arrays.asList(minusMinus, minusPlus, minus, plus, root),
minusPlusNode.getVisited());
final TestVisitor minusNodePlus = new TestVisitor(BSPTreeVisitor.Order.MINUS_NODE_PLUS);
tree.accept(minusNodePlus);
- Assert.assertEquals(
+ Assertions.assertEquals(
Arrays.asList(minusMinus, minus, minusPlus, root, plus),
minusNodePlus.getVisited());
final TestVisitor nodeMinusPlus = new TestVisitor(BSPTreeVisitor.Order.NODE_MINUS_PLUS);
tree.accept(nodeMinusPlus);
- Assert.assertEquals(
+ Assertions.assertEquals(
Arrays.asList(root, minus, minusMinus, minusPlus, plus),
nodeMinusPlus.getVisited());
final TestVisitor nodePlusMinus = new TestVisitor(BSPTreeVisitor.Order.NODE_PLUS_MINUS);
tree.accept(nodePlusMinus);
- Assert.assertEquals(
+ Assertions.assertEquals(
Arrays.asList(root, plus, minus, minusPlus, minusMinus),
nodePlusMinus.getVisited());
}
@@ -958,7 +958,7 @@ public class AbstractBSPTreeTest {
tree.accept(visitor);
// assert
- Assert.assertEquals(
+ Assertions.assertEquals(
Arrays.asList(root, plus),
visitor.getVisited());
}
@@ -988,7 +988,7 @@ public class AbstractBSPTreeTest {
tree.accept(visitor);
// assert
- Assert.assertEquals(
+ Assertions.assertEquals(
Arrays.asList(root, plus),
visitor.getVisited());
}
@@ -1021,7 +1021,7 @@ public class AbstractBSPTreeTest {
tree.accept(visitor);
// assert
- Assert.assertEquals(
+ Assertions.assertEquals(
Arrays.asList(minusMinus, minusPlus, minus),
visitor.getVisited());
}
@@ -1054,7 +1054,7 @@ public class AbstractBSPTreeTest {
tree.accept(visitor);
// assert
- Assert.assertEquals(
+ Assertions.assertEquals(
Arrays.asList(minusMinus, minusPlus, minus),
visitor.getVisited());
}
@@ -1075,37 +1075,37 @@ public class AbstractBSPTreeTest {
// act/assert
final TestVisitor plusMinusNode = new TestVisitor(BSPTreeVisitor.Order.PLUS_MINUS_NODE).withTerminationNode(minus);
tree.accept(plusMinusNode);
- Assert.assertEquals(
+ Assertions.assertEquals(
Arrays.asList(plus, minusPlus, minusMinus, minus),
plusMinusNode.getVisited());
final TestVisitor plusNodeMinus = new TestVisitor(BSPTreeVisitor.Order.PLUS_NODE_MINUS).withTerminationNode(minus);
tree.accept(plusNodeMinus);
- Assert.assertEquals(
+ Assertions.assertEquals(
Arrays.asList(plus, root, minusPlus, minus),
plusNodeMinus.getVisited());
final TestVisitor minusPlusNode = new TestVisitor(BSPTreeVisitor.Order.MINUS_PLUS_NODE).withTerminationNode(minus);
tree.accept(minusPlusNode);
- Assert.assertEquals(
+ Assertions.assertEquals(
Arrays.asList(minusMinus, minusPlus, minus),
minusPlusNode.getVisited());
final TestVisitor minusNodePlus = new TestVisitor(BSPTreeVisitor.Order.MINUS_NODE_PLUS).withTerminationNode(minus);
tree.accept(minusNodePlus);
- Assert.assertEquals(
+ Assertions.assertEquals(
Arrays.asList(minusMinus, minus),
minusNodePlus.getVisited());
final TestVisitor nodeMinusPlus = new TestVisitor(BSPTreeVisitor.Order.NODE_MINUS_PLUS).withTerminationNode(minus);
tree.accept(nodeMinusPlus);
- Assert.assertEquals(
+ Assertions.assertEquals(
Arrays.asList(root, minus),
nodeMinusPlus.getVisited());
final TestVisitor nodePlusMinus = new TestVisitor(BSPTreeVisitor.Order.NODE_PLUS_MINUS).withTerminationNode(minus);
tree.accept(nodePlusMinus);
- Assert.assertEquals(
+ Assertions.assertEquals(
Arrays.asList(root, plus, minus),
nodePlusMinus.getVisited());
}
@@ -1131,7 +1131,7 @@ public class AbstractBSPTreeTest {
});
// assert
- Assert.assertEquals(
+ Assertions.assertEquals(
Arrays.asList(minus, minusMinus, minusPlus),
nodes);
}
@@ -1148,8 +1148,8 @@ public class AbstractBSPTreeTest {
}
// assert
- Assert.assertEquals(1, nodes.size());
- Assert.assertSame(tree.getRoot(), nodes.get(0));
+ Assertions.assertEquals(1, nodes.size());
+ Assertions.assertSame(tree.getRoot(), nodes.get(0));
}
@Test
@@ -1173,16 +1173,16 @@ public class AbstractBSPTreeTest {
}
// assert
- Assert.assertEquals(7, nodes.size());
- Assert.assertSame(root, nodes.get(0));
+ Assertions.assertEquals(7, nodes.size());
+ Assertions.assertSame(root, nodes.get(0));
- Assert.assertSame(root.getMinus(), nodes.get(1));
- Assert.assertSame(root.getMinus().getMinus(), nodes.get(2));
- Assert.assertSame(root.getMinus().getPlus(), nodes.get(3));
+ Assertions.assertSame(root.getMinus(), nodes.get(1));
+ Assertions.assertSame(root.getMinus().getMinus(), nodes.get(2));
+ Assertions.assertSame(root.getMinus().getPlus(), nodes.get(3));
- Assert.assertSame(root.getPlus(), nodes.get(4));
- Assert.assertSame(root.getPlus().getMinus(), nodes.get(5));
- Assert.assertSame(root.getPlus().getPlus(), nodes.get(6));
+ Assertions.assertSame(root.getPlus(), nodes.get(4));
+ Assertions.assertSame(root.getPlus().getMinus(), nodes.get(5));
+ Assertions.assertSame(root.getPlus().getPlus(), nodes.get(6));
}
@@ -1197,7 +1197,7 @@ public class AbstractBSPTreeTest {
// act
try {
it.next();
- Assert.fail("Operation should have thrown an exception");
+ Assertions.fail("Operation should have thrown an exception");
} catch (final NoSuchElementException exc) {
// expected
}
@@ -1219,8 +1219,8 @@ public class AbstractBSPTreeTest {
}
// assert
- Assert.assertEquals(1, nodes.size());
- Assert.assertSame(node, nodes.get(0));
+ Assertions.assertEquals(1, nodes.size());
+ Assertions.assertSame(node, nodes.get(0));
}
@Test
@@ -1238,10 +1238,10 @@ public class AbstractBSPTreeTest {
}
// assert
- Assert.assertEquals(3, nodes.size());
- Assert.assertSame(node, nodes.get(0));
- Assert.assertSame(node.getMinus(), nodes.get(1));
- Assert.assertSame(node.getPlus(), nodes.get(2));
+ Assertions.assertEquals(3, nodes.size());
+ Assertions.assertSame(node, nodes.get(0));
+ Assertions.assertSame(node.getMinus(), nodes.get(1));
+ Assertions.assertSame(node.getPlus(), nodes.get(2));
}
@Test
@@ -1263,15 +1263,15 @@ public class AbstractBSPTreeTest {
final TestLineSegment shortSeg = new TestLineSegment(new TestPoint2D(2, 0), new TestPoint2D(2, 2));
// act/assert
- Assert.assertSame(xAxisSeg, root.trim(xAxisSeg));
- Assert.assertSame(shortSeg, root.trim(shortSeg));
+ Assertions.assertSame(xAxisSeg, root.trim(xAxisSeg));
+ Assertions.assertSame(shortSeg, root.trim(shortSeg));
PartitionTestUtils.assertSegmentsEqual(new TestLineSegment(0, Double.POSITIVE_INFINITY, TestLine.X_AXIS),
(TestLineSegment) plus.trim(xAxisSeg));
- Assert.assertSame(shortSeg, plus.trim(shortSeg));
+ Assertions.assertSame(shortSeg, plus.trim(shortSeg));
- Assert.assertNull(plusMinus.trim(xAxisSeg));
- Assert.assertNull(plusMinus.trim(shortSeg));
+ Assertions.assertNull(plusMinus.trim(xAxisSeg));
+ Assertions.assertNull(plusMinus.trim(shortSeg));
PartitionTestUtils.assertSegmentsEqual(new TestLineSegment(0, 3, TestLine.X_AXIS),
(TestLineSegment) plusPlusPlus.trim(xAxisSeg));
@@ -1289,10 +1289,10 @@ public class AbstractBSPTreeTest {
copy.copy(tree);
// assert
- Assert.assertNotSame(tree, copy);
- Assert.assertNotSame(tree.getRoot(), copy.getRoot());
+ Assertions.assertNotSame(tree, copy);
+ Assertions.assertNotSame(tree.getRoot(), copy.getRoot());
- Assert.assertEquals(tree.count(), copy.count());
+ Assertions.assertEquals(tree.count(), copy.count());
}
@Test
@@ -1309,9 +1309,9 @@ public class AbstractBSPTreeTest {
copy.copy(tree);
// assert
- Assert.assertNotSame(tree, copy);
+ Assertions.assertNotSame(tree, copy);
assertNodesCopiedRecursive(tree.getRoot(), copy.getRoot());
- Assert.assertEquals(tree.count(), copy.count());
+ Assertions.assertEquals(tree.count(), copy.count());
}
@Test
@@ -1329,8 +1329,8 @@ public class AbstractBSPTreeTest {
tree.getRoot().clearCut();
// assert
- Assert.assertEquals(1, tree.count());
- Assert.assertEquals(5, copy.count());
+ Assertions.assertEquals(1, tree.count());
+ Assertions.assertEquals(5, copy.count());
}
@Test
@@ -1346,7 +1346,7 @@ public class AbstractBSPTreeTest {
tree.copy(tree);
// assert
- Assert.assertEquals(5, tree.count());
+ Assertions.assertEquals(5, tree.count());
}
@Test
@@ -1361,9 +1361,9 @@ public class AbstractBSPTreeTest {
result.extract(tree.getRoot());
// assert
- Assert.assertNotSame(tree.getRoot(), result.getRoot());
- Assert.assertEquals(1, tree.count());
- Assert.assertEquals(1, result.count());
+ Assertions.assertNotSame(tree.getRoot(), result.getRoot());
+ Assertions.assertEquals(1, tree.count());
+ Assertions.assertEquals(1, result.count());
PartitionTestUtils.assertTreeStructure(tree);
PartitionTestUtils.assertTreeStructure(result);
@@ -1382,9 +1382,9 @@ public class AbstractBSPTreeTest {
result.extract(tree.getRoot());
// assert
- Assert.assertNotSame(tree.getRoot(), result.getRoot());
- Assert.assertEquals(1, tree.count());
- Assert.assertEquals(1, result.count());
+ Assertions.assertNotSame(tree.getRoot(), result.getRoot());
+ Assertions.assertEquals(1, tree.count());
+ Assertions.assertEquals(1, result.count());
PartitionTestUtils.assertTreeStructure(tree);
PartitionTestUtils.assertTreeStructure(result);
@@ -1408,10 +1408,10 @@ public class AbstractBSPTreeTest {
result.extract(tree.getRoot().getPlus());
// assert
- Assert.assertEquals(7, result.count());
+ Assertions.assertEquals(7, result.count());
final List<TestLineSegment> resultSegments = getLineSegments(result);
- Assert.assertEquals(3, resultSegments.size());
+ Assertions.assertEquals(3, resultSegments.size());
PartitionTestUtils.assertSegmentsEqual(
new TestLineSegment(Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, TestLine.X_AXIS),
@@ -1423,10 +1423,10 @@ public class AbstractBSPTreeTest {
new TestLineSegment(0, Double.POSITIVE_INFINITY, new TestLine(new TestPoint2D(0, -2), new TestPoint2D(1, -2))),
resultSegments.get(2));
- Assert.assertEquals(13, tree.count());
+ Assertions.assertEquals(13, tree.count());
final List<TestLineSegment> inputSegment = getLineSegments(tree);
- Assert.assertEquals(6, inputSegment.size());
+ Assertions.assertEquals(6, inputSegment.size());
PartitionTestUtils.assertTreeStructure(tree);
PartitionTestUtils.assertTreeStructure(result);
@@ -1454,13 +1454,13 @@ public class AbstractBSPTreeTest {
// assert
final TestNode resultNode = result.findNode(pt);
- Assert.assertNotNull(resultNode);
- Assert.assertNotSame(node, resultNode);
+ Assertions.assertNotNull(resultNode);
+ Assertions.assertNotSame(node, resultNode);
- Assert.assertEquals(7, result.count());
+ Assertions.assertEquals(7, result.count());
final List<TestLineSegment> resultSegments = getLineSegments(result);
- Assert.assertEquals(3, resultSegments.size());
+ Assertions.assertEquals(3, resultSegments.size());
PartitionTestUtils.assertSegmentsEqual(
new TestLineSegment(Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, TestLine.X_AXIS),
@@ -1472,10 +1472,10 @@ public class AbstractBSPTreeTest {
new TestLineSegment(new TestPoint2D(0, 3), new TestPoint2D(3, 0)),
resultSegments.get(2));
- Assert.assertEquals(13, tree.count());
+ Assertions.assertEquals(13, tree.count());
final List<TestLineSegment> inputSegment = getLineSegments(tree);
- Assert.assertEquals(6, inputSegment.size());
+ Assertions.assertEquals(6, inputSegment.size());
PartitionTestUtils.assertTreeStructure(tree);
PartitionTestUtils.assertTreeStructure(result);
@@ -1502,13 +1502,13 @@ public class AbstractBSPTreeTest {
// assert
final TestNode resultNode = tree.findNode(pt);
- Assert.assertNotNull(resultNode);
- Assert.assertSame(node, resultNode);
+ Assertions.assertNotNull(resultNode);
+ Assertions.assertSame(node, resultNode);
- Assert.assertEquals(7, tree.count());
+ Assertions.assertEquals(7, tree.count());
final List<TestLineSegment> resultSegments = getLineSegments(tree);
- Assert.assertEquals(3, resultSegments.size());
+ Assertions.assertEquals(3, resultSegments.size());
PartitionTestUtils.assertSegmentsEqual(
new TestLineSegment(Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, TestLine.X_AXIS),
@@ -1534,8 +1534,8 @@ public class AbstractBSPTreeTest {
tree.transform(t);
// assert
- Assert.assertEquals(1, tree.count());
- Assert.assertTrue(tree.getRoot().isLeaf());
+ Assertions.assertEquals(1, tree.count());
+ Assertions.assertTrue(tree.getRoot().isLeaf());
}
@Test
@@ -1550,10 +1550,10 @@ public class AbstractBSPTreeTest {
tree.transform(t);
// assert
- Assert.assertEquals(3, tree.count());
+ Assertions.assertEquals(3, tree.count());
final List<TestLineSegment> segments = getLineSegments(tree);
- Assert.assertEquals(1, segments.size());
+ Assertions.assertEquals(1, segments.size());
final TestLineSegment seg = segments.get(0);
PartitionTestUtils.assertPointsEqual(new TestPoint2D(Double.NEGATIVE_INFINITY, 2), seg.getStartPoint());
@@ -1576,10 +1576,10 @@ public class AbstractBSPTreeTest {
tree.transform(t);
// assert
- Assert.assertEquals(9, tree.count());
+ Assertions.assertEquals(9, tree.count());
final List<TestLineSegment> segments = getLineSegments(tree);
- Assert.assertEquals(4, segments.size());
+ Assertions.assertEquals(4, segments.size());
final TestLineSegment segment1 = segments.get(0);
PartitionTestUtils.assertPointsEqual(new TestPoint2D(Double.NEGATIVE_INFINITY, 2), segment1.getStartPoint());
@@ -1619,7 +1619,7 @@ public class AbstractBSPTreeTest {
checkTransformedPointNodeMap(tree, t, pointNodeMap);
final List<TestLineSegment> segments = getLineSegments(tree);
- Assert.assertEquals(4, segments.size());
+ Assertions.assertEquals(4, segments.size());
}
@Test
@@ -1643,7 +1643,7 @@ public class AbstractBSPTreeTest {
checkTransformedPointNodeMap(tree, t, pointNodeMap);
final List<TestLineSegment> segments = getLineSegments(tree);
- Assert.assertEquals(4, segments.size());
+ Assertions.assertEquals(4, segments.size());
}
@Test
@@ -1667,7 +1667,7 @@ public class AbstractBSPTreeTest {
checkTransformedPointNodeMap(tree, t, pointNodeMap);
final List<TestLineSegment> segments = getLineSegments(tree);
- Assert.assertEquals(4, segments.size());
+ Assertions.assertEquals(4, segments.size());
}
@Test
@@ -1682,12 +1682,12 @@ public class AbstractBSPTreeTest {
// assert
final String[] lines = str.split("\n");
- Assert.assertEquals(5, lines.length);
- Assert.assertTrue(lines[0].startsWith("TestNode[cut= TestLineSegment"));
- Assert.assertTrue(lines[1].startsWith(" [-] TestNode[cut= TestLineSegment"));
- Assert.assertEquals(" [-] TestNode[cut= null]", lines[2]);
- Assert.assertEquals(" [+] TestNode[cut= null]", lines[3]);
- Assert.assertEquals(" [+] TestNode[cut= null]", lines[4]);
+ Assertions.assertEquals(5, lines.length);
+ Assertions.assertTrue(lines[0].startsWith("TestNode[cut= TestLineSegment"));
+ Assertions.assertTrue(lines[1].startsWith(" [-] TestNode[cut= TestLineSegment"));
+ Assertions.assertEquals(" [-] TestNode[cut= null]", lines[2]);
+ Assertions.assertEquals(" [+] TestNode[cut= null]", lines[3]);
+ Assertions.assertEquals(" [+] TestNode[cut= null]", lines[4]);
}
@Test
@@ -1699,7 +1699,7 @@ public class AbstractBSPTreeTest {
final String str = tree.treeString();
// assert
- Assert.assertEquals("TestNode[cut= null]", str);
+ Assertions.assertEquals("TestNode[cut= null]", str);
}
@Test
@@ -1715,11 +1715,11 @@ public class AbstractBSPTreeTest {
// assert
final String[] lines = str.split("\n");
- Assert.assertEquals(4, lines.length);
- Assert.assertTrue(lines[0].startsWith("TestNode[cut= TestLineSegment"));
- Assert.assertTrue(lines[1].startsWith(" [-] TestNode[cut= TestLineSegment"));
- Assert.assertEquals(" ...", lines[2]);
- Assert.assertEquals(" [+] TestNode[cut= null]", lines[3]);
+ Assertions.assertEquals(4, lines.length);
+ Assertions.assertTrue(lines[0].startsWith("TestNode[cut= TestLineSegment"));
+ Assertions.assertTrue(lines[1].startsWith(" [-] TestNode[cut= TestLineSegment"));
+ Assertions.assertEquals(" ...", lines[2]);
+ Assertions.assertEquals(" [+] TestNode[cut= null]", lines[3]);
}
@Test
@@ -1735,9 +1735,9 @@ public class AbstractBSPTreeTest {
// assert
final String[] lines = str.split("\n");
- Assert.assertEquals(2, lines.length);
- Assert.assertTrue(lines[0].startsWith("TestNode[cut= TestLineSegment"));
- Assert.assertTrue(lines[1].startsWith(" ..."));
+ Assertions.assertEquals(2, lines.length);
+ Assertions.assertTrue(lines[0].startsWith("TestNode[cut= TestLineSegment"));
+ Assertions.assertTrue(lines[1].startsWith(" ..."));
}
@Test
@@ -1752,7 +1752,7 @@ public class AbstractBSPTreeTest {
final String str = tree.treeString(-1);
// assert
- Assert.assertEquals("", str);
+ Assertions.assertEquals("", str);
}
@Test
@@ -1767,9 +1767,9 @@ public class AbstractBSPTreeTest {
// assert
final String msg = "Unexpected toString() representation: " + str;
- Assert.assertTrue(msg, str.contains("TestBSPTree"));
- Assert.assertTrue(msg, str.contains("count= 3"));
- Assert.assertTrue(msg, str.contains("height= 1"));
+ Assertions.assertTrue(str.contains("TestBSPTree"), msg);
+ Assertions.assertTrue(str.contains("count= 3"), msg);
+ Assertions.assertTrue(str.contains("height= 1"), msg);
}
@Test
@@ -1782,8 +1782,8 @@ public class AbstractBSPTreeTest {
final String str = tree.getRoot().toString();
// assert
- Assert.assertTrue(str.contains("TestNode"));
- Assert.assertTrue(str.contains("cut= TestLineSegment"));
+ Assertions.assertTrue(str.contains("TestNode"));
+ Assertions.assertTrue(str.contains("cut= TestLineSegment"));
}
@Test
@@ -1807,23 +1807,23 @@ public class AbstractBSPTreeTest {
final TestLineSegment splitSegment = new TestLineSegment(Double.NEGATIVE_INFINITY,
Double.POSITIVE_INFINITY, splitter);
- Assert.assertEquals(5, tree.count());
- Assert.assertEquals(2, tree.height());
+ Assertions.assertEquals(5, tree.count());
+ Assertions.assertEquals(2, tree.height());
- Assert.assertEquals(5, minus.count());
- Assert.assertEquals(2, minus.height());
+ Assertions.assertEquals(5, minus.count());
+ Assertions.assertEquals(2, minus.height());
final List<TestLineSegment> minusSegments = getLineSegments(minus);
- Assert.assertEquals(2, minusSegments.size());
+ Assertions.assertEquals(2, minusSegments.size());
PartitionTestUtils.assertSegmentsEqual(splitSegment, minusSegments.get(0));
PartitionTestUtils.assertSegmentsEqual(new TestLineSegment(Double.NEGATIVE_INFINITY, 0, TestLine.X_AXIS),
minusSegments.get(1));
- Assert.assertEquals(7, plus.count());
- Assert.assertEquals(3, plus.height());
+ Assertions.assertEquals(7, plus.count());
+ Assertions.assertEquals(3, plus.height());
final List<TestLineSegment> plusSegments = getLineSegments(plus);
- Assert.assertEquals(3, plusSegments.size());
+ Assertions.assertEquals(3, plusSegments.size());
PartitionTestUtils.assertSegmentsEqual(splitSegment, plusSegments.get(0));
PartitionTestUtils.assertSegmentsEqual(new TestLineSegment(0, Double.POSITIVE_INFINITY, TestLine.X_AXIS),
plusSegments.get(1));
@@ -1851,14 +1851,14 @@ public class AbstractBSPTreeTest {
final TestLineSegment splitSegment = new TestLineSegment(Double.NEGATIVE_INFINITY,
Double.POSITIVE_INFINITY, splitter);
- Assert.assertEquals(5, tree.count());
- Assert.assertEquals(2, tree.height());
+ Assertions.assertEquals(5, tree.count());
+ Assertions.assertEquals(2, tree.height());
- Assert.assertEquals(5, minus.count());
- Assert.assertEquals(2, minus.height());
+ Assertions.assertEquals(5, minus.count());
+ Assertions.assertEquals(2, minus.height());
final List<TestLineSegment> minusSegments = getLineSegments(minus);
- Assert.assertEquals(2, minusSegments.size());
+ Assertions.assertEquals(2, minusSegments.size());
PartitionTestUtils.assertSegmentsEqual(splitSegment, minusSegments.get(0));
PartitionTestUtils.assertSegmentsEqual(new TestLineSegment(Double.NEGATIVE_INFINITY, 0, TestLine.X_AXIS),
minusSegments.get(1));
@@ -1884,14 +1884,14 @@ public class AbstractBSPTreeTest {
final TestLineSegment splitSegment = new TestLineSegment(Double.NEGATIVE_INFINITY,
Double.POSITIVE_INFINITY, splitter);
- Assert.assertEquals(5, tree.count());
- Assert.assertEquals(2, tree.height());
+ Assertions.assertEquals(5, tree.count());
+ Assertions.assertEquals(2, tree.height());
- Assert.assertEquals(7, plus.count());
- Assert.assertEquals(3, plus.height());
+ Assertions.assertEquals(7, plus.count());
+ Assertions.assertEquals(3, plus.height());
final List<TestLineSegment> plusSegments = getLineSegments(plus);
- Assert.assertEquals(3, plusSegments.size());
+ Assertions.assertEquals(3, plusSegments.size());
PartitionTestUtils.assertSegmentsEqual(splitSegment, plusSegments.get(0));
PartitionTestUtils.assertSegmentsEqual(new TestLineSegment(0, Double.POSITIVE_INFINITY, TestLine.X_AXIS),
plusSegments.get(1));
@@ -1900,23 +1900,23 @@ public class AbstractBSPTreeTest {
}
private void assertNodesCopiedRecursive(final TestNode orig, final TestNode copy) {
- Assert.assertNotSame(orig, copy);
+ Assertions.assertNotSame(orig, copy);
- Assert.assertEquals(orig.getCut(), copy.getCut());
+ Assertions.assertEquals(orig.getCut(), copy.getCut());
if (orig.isLeaf()) {
- Assert.assertNull(copy.getMinus());
- Assert.assertNull(copy.getPlus());
+ Assertions.assertNull(copy.getMinus());
+ Assertions.assertNull(copy.getPlus());
} else {
- Assert.assertNotSame(orig.getMinus(), copy.getMinus());
- Assert.assertNotSame(orig.getPlus(), copy.getPlus());
+ Assertions.assertNotSame(orig.getMinus(), copy.getMinus());
+ Assertions.assertNotSame(orig.getPlus(), copy.getPlus());
assertNodesCopiedRecursive(orig.getMinus(), copy.getMinus());
assertNodesCopiedRecursive(orig.getPlus(), copy.getPlus());
}
- Assert.assertEquals(orig.depth(), copy.depth());
- Assert.assertEquals(orig.count(), copy.count());
+ Assertions.assertEquals(orig.depth(), copy.depth());
+ Assertions.assertEquals(orig.count(), copy.count());
}
private static List<TestLineSegment> getLineSegments(final TestBSPTree tree) {
@@ -1958,7 +1958,7 @@ public class AbstractBSPTreeTest {
final TestPoint2D transformedPt = transform.apply(entry.getKey());
final String msg = "Expected transformed point " + transformedPt + " to resolve to node " + expectedNode;
- Assert.assertSame(msg, expectedNode, transformedTree.findNode(transformedPt, FindNodeCutRule.NODE));
+ Assertions.assertSame(expectedNode, transformedTree.findNode(transformedPt, FindNodeCutRule.NODE), msg);
}
}
diff --git a/commons-geometry-core/src/test/java/org/apache/commons/geometry/core/partitioning/bsp/AbstractPartitionedRegionBuilderTest.java b/commons-geometry-core/src/test/java/org/apache/commons/geometry/core/partitioning/bsp/AbstractPartitionedRegionBuilderTest.java
index 6899ac3..74b510b 100644
--- a/commons-geometry-core/src/test/java/org/apache/commons/geometry/core/partitioning/bsp/AbstractPartitionedRegionBuilderTest.java
+++ b/commons-geometry-core/src/test/java/org/apache/commons/geometry/core/partitioning/bsp/AbstractPartitionedRegionBuilderTest.java
@@ -27,8 +27,8 @@ import org.apache.commons.geometry.core.partitioning.test.TestLine;
import org.apache.commons.geometry.core.partitioning.test.TestLineSegment;
import org.apache.commons.geometry.core.partitioning.test.TestPoint2D;
import org.apache.commons.geometry.core.partitioning.test.TestRegionBSPTree;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
public class AbstractPartitionedRegionBuilderTest {
@@ -52,9 +52,9 @@ public class AbstractPartitionedRegionBuilderTest {
final TestRegionBSPTree tree = builder.build();
// assert
- Assert.assertTrue(tree.isEmpty());
- Assert.assertEquals(1, tree.count());
- Assert.assertEquals(0, tree.height());
+ Assertions.assertTrue(tree.isEmpty());
+ Assertions.assertEquals(1, tree.count());
+ Assertions.assertEquals(0, tree.height());
}
@Test
@@ -80,11 +80,11 @@ public class AbstractPartitionedRegionBuilderTest {
final TestRegionBSPTree tree = builder.build();
// assert
- Assert.assertFalse(tree.isEmpty());
- Assert.assertFalse(tree.isFull());
+ Assertions.assertFalse(tree.isEmpty());
+ Assertions.assertFalse(tree.isFull());
- Assert.assertEquals(3, tree.count());
- Assert.assertEquals(1, tree.height());
+ Assertions.assertEquals(3, tree.count());
+ Assertions.assertEquals(1, tree.height());
PartitionTestUtils.assertPointLocations(tree, RegionLocation.INSIDE,
new TestPoint2D(-5, 1), new TestPoint2D(0, 1), new TestPoint2D(5, 1));
@@ -108,8 +108,8 @@ public class AbstractPartitionedRegionBuilderTest {
final TestRegionBSPTree tree = builder.build();
// assert
- Assert.assertFalse(tree.isEmpty());
- Assert.assertFalse(tree.isFull());
+ Assertions.assertFalse(tree.isEmpty());
+ Assertions.assertFalse(tree.isFull());
PartitionTestUtils.assertPointLocations(tree, RegionLocation.INSIDE,
new TestPoint2D(-5, 1), new TestPoint2D(0, 1), new TestPoint2D(5, 1));
@@ -133,8 +133,8 @@ public class AbstractPartitionedRegionBuilderTest {
final TestRegionBSPTree tree = builder.build();
// assert
- Assert.assertFalse(tree.isEmpty());
- Assert.assertFalse(tree.isFull());
+ Assertions.assertFalse(tree.isEmpty());
+ Assertions.assertFalse(tree.isFull());
PartitionTestUtils.assertPointLocations(tree, RegionLocation.INSIDE,
new TestPoint2D(-5, 1), new TestPoint2D(0, 1), new TestPoint2D(5, 1));
@@ -159,8 +159,8 @@ public class AbstractPartitionedRegionBuilderTest {
final TestRegionBSPTree tree = builder.build();
// assert
- Assert.assertFalse(tree.isEmpty());
- Assert.assertFalse(tree.isFull());
+ Assertions.assertFalse(tree.isEmpty());
+ Assertions.assertFalse(tree.isFull());
PartitionTestUtils.assertPointLocations(tree, RegionLocation.INSIDE, new TestPoint2D(5, 1));
@@ -184,8 +184,8 @@ public class AbstractPartitionedRegionBuilderTest {
final TestRegionBSPTree tree = builder.build();
// assert
- Assert.assertFalse(tree.isEmpty());
- Assert.assertFalse(tree.isFull());
+ Assertions.assertFalse(tree.isEmpty());
+ Assertions.assertFalse(tree.isFull());
PartitionTestUtils.assertPointLocations(tree, RegionLocation.INSIDE, new TestPoint2D(5, 1));
@@ -212,8 +212,8 @@ public class AbstractPartitionedRegionBuilderTest {
final TestRegionBSPTree tree = builder.build();
// assert
- Assert.assertFalse(tree.isEmpty());
- Assert.assertFalse(tree.isFull());
+ Assertions.assertFalse(tree.isEmpty());
+ Assertions.assertFalse(tree.isFull());
PartitionTestUtils.assertPointLocations(tree, RegionLocation.INSIDE,
new TestPoint2D(1, 1), new TestPoint2D(-1, -1));
@@ -237,8 +237,8 @@ public class AbstractPartitionedRegionBuilderTest {
final TestRegionBSPTree tree = builder.build();
// assert
- Assert.assertFalse(tree.isEmpty());
- Assert.assertFalse(tree.isFull());
+ Assertions.assertFalse(tree.isEmpty());
+ Assertions.assertFalse(tree.isFull());
PartitionTestUtils.assertPointLocations(tree, RegionLocation.INSIDE,
new TestPoint2D(-5, 1), new TestPoint2D(0, 1), new TestPoint2D(5, 1));
@@ -264,8 +264,8 @@ public class AbstractPartitionedRegionBuilderTest {
final TestRegionBSPTree tree = builder.build();
// assert
- Assert.assertFalse(tree.isEmpty());
- Assert.assertFalse(tree.isFull());
+ Assertions.assertFalse(tree.isEmpty());
+ Assertions.assertFalse(tree.isFull());
PartitionTestUtils.assertPointLocations(tree, RegionLocation.INSIDE,
new TestPoint2D(2, 2), new TestPoint2D(5, 5));
@@ -303,8 +303,8 @@ public class AbstractPartitionedRegionBuilderTest {
final TestRegionBSPTree tree = builder.build();
// assert
- Assert.assertFalse(tree.isEmpty());
- Assert.assertFalse(tree.isFull());
+ Assertions.assertFalse(tree.isEmpty());
+ Assertions.assertFalse(tree.isFull());
PartitionTestUtils.assertPointLocations(tree, RegionLocation.INSIDE,
new TestPoint2D(0, 0),
@@ -346,8 +346,8 @@ public class AbstractPartitionedRegionBuilderTest {
final TestRegionBSPTree tree = builder.build();
// assert
- Assert.assertFalse(tree.isEmpty());
- Assert.assertFalse(tree.isFull());
+ Assertions.assertFalse(tree.isEmpty());
+ Assertions.assertFalse(tree.isFull());
PartitionTestUtils.assertPointLocations(tree, RegionLocation.INSIDE,
new TestPoint2D(0, 0),
@@ -393,8 +393,8 @@ public class AbstractPartitionedRegionBuilderTest {
final TestRegionBSPTree tree = builder.build();
// assert
- Assert.assertFalse(tree.isEmpty());
- Assert.assertFalse(tree.isFull());
+ Assertions.assertFalse(tree.isEmpty());
+ Assertions.assertFalse(tree.isFull());
PartitionTestUtils.assertPointLocations(tree, RegionLocation.INSIDE,
new TestPoint2D(0, 0),
diff --git a/commons-geometry-core/src/test/java/org/apache/commons/geometry/core/partitioning/bsp/AbstractRegionBSPTreeBooleanTest.java b/commons-geometry-core/src/test/java/org/apache/commons/geometry/core/partitioning/bsp/AbstractRegionBSPTreeBooleanTest.java
index 7f438ab..35c51d7 100644
--- a/commons-geometry-core/src/test/java/org/apache/commons/geometry/core/partitioning/bsp/AbstractRegionBSPTreeBooleanTest.java
+++ b/commons-geometry-core/src/test/java/org/apache/commons/geometry/core/partitioning/bsp/AbstractRegionBSPTreeBooleanTest.java
@@ -24,7 +24,7 @@ import org.apache.commons.geometry.core.partitioning.test.TestLine;
import org.apache.commons.geometry.core.partitioning.test.TestLineSegment;
import org.apache.commons.geometry.core.partitioning.test.TestPoint2D;
import org.apache.commons.geometry.core.partitioning.test.TestRegionBSPTree;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
public class AbstractRegionBSPTreeBooleanTest {
diff --git a/commons-geometry-core/src/test/java/org/apache/commons/geometry/core/partitioning/bsp/AbstractRegionBSPTreeTest.java b/commons-geometry-core/src/test/java/org/apache/commons/geometry/core/partitioning/bsp/AbstractRegionBSPTreeTest.java
index 57305fd..8385a78 100644
--- a/commons-geometry-core/src/test/java/org/apache/commons/geometry/core/partitioning/bsp/AbstractRegionBSPTreeTest.java
+++ b/commons-geometry-core/src/test/java/org/apache/commons/geometry/core/partitioning/bsp/AbstractRegionBSPTreeTest.java
@@ -40,9 +40,9 @@ import org.apache.commons.geometry.core.partitioning.test.TestPoint2D;
import org.apache.commons.geometry.core.partitioning.test.TestRegionBSPTree;
import org.apache.commons.geometry.core.partitioning.test.TestRegionBSPTree.TestRegionNode;
import org.apache.commons.geometry.core.partitioning.test.TestTransform2D;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
public class AbstractRegionBSPTreeTest {
@@ -50,7 +50,7 @@ public class AbstractRegionBSPTreeTest {
private TestRegionNode root;
- @Before
+ @BeforeEach
public void setup() {
tree = new TestRegionBSPTree();
root = tree.getRoot();
@@ -59,16 +59,16 @@ public class AbstractRegionBSPTreeTest {
@Test
public void testDefaultConstructor() {
// assert
- Assert.assertNotNull(root);
- Assert.assertNull(root.getParent());
+ Assertions.assertNotNull(root);
+ Assertions.assertNull(root.getParent());
PartitionTestUtils.assertIsLeafNode(root);
- Assert.assertFalse(root.isPlus());
- Assert.assertFalse(root.isMinus());
+ Assertions.assertFalse(root.isPlus());
+ Assertions.assertFalse(root.isMinus());
- Assert.assertSame(tree, root.getTree());
+ Assertions.assertSame(tree, root.getTree());
- Assert.assertEquals(RegionLocation.INSIDE, root.getLocation());
+ Assertions.assertEquals(RegionLocation.INSIDE, root.getLocation());
}
@Test
@@ -78,16 +78,16 @@ public class AbstractRegionBSPTreeTest {
root = tree.getRoot();
// assert
- Assert.assertNotNull(root);
- Assert.assertNull(root.getParent());
+ Assertions.assertNotNull(root);
+ Assertions.assertNull(root.getParent());
PartitionTestUtils.assertIsLeafNode(root);
- Assert.assertFalse(root.isPlus());
- Assert.assertFalse(root.isMinus());
+ Assertions.assertFalse(root.isPlus());
+ Assertions.assertFalse(root.isMinus());
- Assert.assertSame(tree, root.getTree());
+ Assertions.assertSame(tree, root.getTree());
- Assert.assertEquals(RegionLocation.INSIDE, root.getLocation());
+ Assertions.assertEquals(RegionLocation.INSIDE, root.getLocation());
}
@Test
@@ -97,16 +97,16 @@ public class AbstractRegionBSPTreeTest {
root = tree.getRoot();
// assert
- Assert.assertNotNull(root);
- Assert.assertNull(root.getParent());
+ Assertions.assertNotNull(root);
+ Assertions.assertNull(root.getParent());
PartitionTestUtils.assertIsLeafNode(root);
- Assert.assertFalse(root.isPlus());
- Assert.assertFalse(root.isMinus());
+ Assertions.assertFalse(root.isPlus());
+ Assertions.assertFalse(root.isMinus());
- Assert.assertSame(tree, root.getTree());
+ Assertions.assertSame(tree, root.getTree());
- Assert.assertEquals(RegionLocation.OUTSIDE, root.getLocation());
+ Assertions.assertEquals(RegionLocation.OUTSIDE, root.getLocation());
}
@Test
@@ -185,32 +185,32 @@ public class AbstractRegionBSPTreeTest {
// assert
TestRegionNode node = tree.getRoot();
- Assert.assertEquals(RegionLocation.OUTSIDE, node.getLocation());
+ Assertions.assertEquals(RegionLocation.OUTSIDE, node.getLocation());
- Assert.assertEquals(RegionLocation.OUTSIDE, node.getMinus().getLocation());
- Assert.assertEquals(RegionLocation.INSIDE, node.getPlus().getLocation());
+ Assertions.assertEquals(RegionLocation.OUTSIDE, node.getMinus().getLocation());
+ Assertions.assertEquals(RegionLocation.INSIDE, node.getPlus().getLocation());
node = node.getPlus();
- Assert.assertEquals(RegionLocation.INSIDE, node.getMinus().getLocation());
- Assert.assertEquals(RegionLocation.OUTSIDE, node.getPlus().getLocation());
+ Assertions.assertEquals(RegionLocation.INSIDE, node.getMinus().getLocation());
+ Assertions.assertEquals(RegionLocation.OUTSIDE, node.getPlus().getLocation());
node = node.getMinus();
- Assert.assertEquals(RegionLocation.OUTSIDE, node.getMinus().getLocation());
- Assert.assertEquals(RegionLocation.INSIDE, node.getPlus().getLocation());
+ Assertions.assertEquals(RegionLocation.OUTSIDE, node.getMinus().getLocation());
+ Assertions.assertEquals(RegionLocation.INSIDE, node.getPlus().getLocation());
node = node.getPlus();
- Assert.assertEquals(RegionLocation.INSIDE, node.getMinus().getLocation());
- Assert.assertEquals(RegionLocation.OUTSIDE, node.getPlus().getLocation());
+ Assertions.assertEquals(RegionLocation.INSIDE, node.getMinus().getLocation());
+ Assertions.assertEquals(RegionLocation.OUTSIDE, node.getPlus().getLocation());
node = node.getMinus();
- Assert.assertEquals(RegionLocation.INSIDE, node.getMinus().getLocation());
- Assert.assertEquals(RegionLocation.INSIDE, node.getPlus().getLocation());
+ Assertions.assertEquals(RegionLocation.INSIDE, node.getMinus().getLocation());
+ Assertions.assertEquals(RegionLocation.INSIDE, node.getPlus().getLocation());
}
@Test
public void testGetLocation_emptyRoot() {
// act/assert
- Assert.assertEquals(RegionLocation.INSIDE, root.getLocation());
+ Assertions.assertEquals(RegionLocation.INSIDE, root.getLocation());
}
@Test
@@ -219,19 +219,19 @@ public class AbstractRegionBSPTreeTest {
root.insertCut(TestLine.X_AXIS);
// act/assert
- Assert.assertEquals(RegionLocation.INSIDE, root.getLocation());
- Assert.assertFalse(root.isInside());
- Assert.assertFalse(root.isOutside());
+ Assertions.assertEquals(RegionLocation.INSIDE, root.getLocation());
+ Assertions.assertFalse(root.isInside());
+ Assertions.assertFalse(root.isOutside());
final TestRegionNode minus = root.getMinus();
- Assert.assertEquals(RegionLocation.INSIDE, minus.getLocation());
- Assert.assertTrue(minus.isInside());
- Assert.assertFalse(minus.isOutside());
+ Assertions.assertEquals(RegionLocation.INSIDE, minus.getLocation());
+ Assertions.assertTrue(minus.isInside());
+ Assertions.assertFalse(minus.isOutside());
final TestRegionNode plus = root.getPlus();
- Assert.assertEquals(RegionLocation.OUTSIDE, plus.getLocation());
- Assert.assertFalse(plus.isInside());
- Assert.assertTrue(plus.isOutside());
+ Assertions.assertEquals(RegionLocation.OUTSIDE, plus.getLocation());
+ Assertions.assertFalse(plus.isInside());
+ Assertions.assertTrue(plus.isOutside());
}
@Test
@@ -243,25 +243,25 @@ public class AbstractRegionBSPTreeTest {
new TestLineSegment(TestPoint2D.ZERO, new TestPoint2D(0, -1))));
// act/assert
- Assert.assertEquals(RegionLocation.INSIDE, root.getLocation());
+ Assertions.assertEquals(RegionLocation.INSIDE, root.getLocation());
final TestRegionNode plus = root.getPlus();
- Assert.assertEquals(RegionLocation.OUTSIDE, plus.getLocation());
+ Assertions.assertEquals(RegionLocation.OUTSIDE, plus.getLocation());
final TestRegionNode plusPlus = plus.getPlus();
- Assert.assertEquals(RegionLocation.OUTSIDE, plusPlus.getLocation());
+ Assertions.assertEquals(RegionLocation.OUTSIDE, plusPlus.getLocation());
final TestRegionNode plusMinus = plus.getMinus();
- Assert.assertEquals(RegionLocation.INSIDE, plusMinus.getLocation());
+ Assertions.assertEquals(RegionLocation.INSIDE, plusMinus.getLocation());
final TestRegionNode minus = root.getMinus();
- Assert.assertEquals(RegionLocation.INSIDE, minus.getLocation());
+ Assertions.assertEquals(RegionLocation.INSIDE, minus.getLocation());
final TestRegionNode minusPlus = minus.getPlus();
- Assert.assertEquals(RegionLocation.OUTSIDE, minusPlus.getLocation());
+ Assertions.assertEquals(RegionLocation.OUTSIDE, minusPlus.getLocation());
final TestRegionNode minusMinus = minus.getMinus();
- Assert.assertEquals(RegionLocation.INSIDE, minusMinus.getLocation());
+ Assertions.assertEquals(RegionLocation.INSIDE, minusMinus.getLocation());
}
@Test
@@ -276,8 +276,8 @@ public class AbstractRegionBSPTreeTest {
node.setLocation(RegionLocation.OUTSIDE);
// assert
- Assert.assertEquals(RegionLocation.OUTSIDE, node.getLocation());
- Assert.assertTrue(tree.isEmpty());
+ Assertions.assertEquals(RegionLocation.OUTSIDE, node.getLocation());
+ Assertions.assertTrue(tree.isEmpty());
}
@Test
@@ -294,7 +294,7 @@ public class AbstractRegionBSPTreeTest {
node.setLocation(RegionLocation.OUTSIDE);
// assert
- Assert.assertNotSame(prevProps, tree.getRegionSizeProperties());
+ Assertions.assertNotSame(prevProps, tree.getRegionSizeProperties());
}
@Test
@@ -311,7 +311,7 @@ public class AbstractRegionBSPTreeTest {
node.setLocation(RegionLocation.INSIDE);
// assert
- Assert.assertSame(prevProps, tree.getRegionSizeProperties());
+ Assertions.assertSame(prevProps, tree.getRegionSizeProperties());
}
@Test
@@ -334,12 +334,12 @@ public class AbstractRegionBSPTreeTest {
final boolean result = tree.condense();
// assert
- Assert.assertTrue(result);
+ Assertions.assertTrue(result);
- Assert.assertEquals(3, tree.count());
- Assert.assertEquals(RegionLocation.OUTSIDE, tree.getRoot().getLocation());
- Assert.assertEquals(RegionLocation.INSIDE, tree.getRoot().getMinus().getLocation());
- Assert.assertEquals(RegionLocation.OUTSIDE, tree.getRoot().getPlus().getLocation());
+ Assertions.assertEquals(3, tree.count());
+ Assertions.assertEquals(RegionLocation.OUTSIDE, tree.getRoot().getLocation());
+ Assertions.assertEquals(RegionLocation.INSIDE, tree.getRoot().getMinus().getLocation());
+ Assertions.assertEquals(RegionLocation.OUTSIDE, tree.getRoot().getPlus().getLocation());
}
@Test
@@ -352,12 +352,12 @@ public class AbstractRegionBSPTreeTest {
final boolean result = tree.condense();
// assert
- Assert.assertFalse(result);
+ Assertions.assertFalse(result);
- Assert.assertEquals(3, tree.count());
- Assert.assertEquals(RegionLocation.OUTSIDE, tree.getRoot().getLocation());
- Assert.assertEquals(RegionLocation.INSIDE, tree.getRoot().getMinus().getLocation());
- Assert.assertEquals(RegionLocation.OUTSIDE, tree.getRoot().getPlus().getLocation());
+ Assertions.assertEquals(3, tree.count());
+ Assertions.assertEquals(RegionLocation.OUTSIDE, tree.getRoot().getLocation());
+ Assertions.assertEquals(RegionLocation.INSIDE, tree.getRoot().getMinus().getLocation());
+ Assertions.assertEquals(RegionLocation.OUTSIDE, tree.getRoot().getPlus().getLocation());
}
@Test
@@ -373,9 +373,9 @@ public class AbstractRegionBSPTreeTest {
final boolean result = tree.condense();
// assert
- Assert.assertTrue(result);
+ Assertions.assertTrue(result);
- Assert.assertNotSame(prevProps, tree.getRegionSizeProperties());
+ Assertions.assertNotSame(prevProps, tree.getRegionSizeProperties());
}
@Test
@@ -389,9 +389,9 @@ public class AbstractRegionBSPTreeTest {
final boolean result = tree.condense();
// assert
- Assert.assertFalse(result);
+ Assertions.assertFalse(result);
- Assert.assertSame(prevProps, tree.getRegionSizeProperties());
+ Assertions.assertSame(prevProps, tree.getRegionSizeProperties());
}
@Test
@@ -408,28 +408,28 @@ public class AbstractRegionBSPTreeTest {
// assert
TestRegionNode node = tree.getRoot();
- Assert.assertEquals(RegionLocation.OUTSIDE, node.getLocation());
+ Assertions.assertEquals(RegionLocation.OUTSIDE, node.getLocation());
- Assert.assertEquals(RegionLocation.OUTSIDE, node.getMinus().getLocation());
- Assert.assertEquals(RegionLocation.INSIDE, node.getPlus().getLocation());
+ Assertions.assertEquals(RegionLocation.OUTSIDE, node.getMinus().getLocation());
+ Assertions.assertEquals(RegionLocation.INSIDE, node.getPlus().getLocation());
node = node.getPlus();
- Assert.assertEquals(RegionLocation.INSIDE, node.getMinus().getLocation());
- Assert.assertEquals(RegionLocation.OUTSIDE, node.getPlus().getLocation());
+ Assertions.assertEquals(RegionLocation.INSIDE, node.getMinus().getLocation());
+ Assertions.assertEquals(RegionLocation.OUTSIDE, node.getPlus().getLocation());
node = node.getMinus();
- Assert.assertEquals(RegionLocation.INSIDE, node.getMinus().getLocation());
- Assert.assertEquals(RegionLocation.INSIDE, node.getPlus().getLocation());
+ Assertions.assertEquals(RegionLocation.INSIDE, node.getMinus().getLocation());
+ Assertions.assertEquals(RegionLocation.INSIDE, node.getPlus().getLocation());
}
@Test
public void testBoundaries_fullAndEmpty() {
// act/assert
tree.setFull();
- Assert.assertFalse(tree.boundaries().iterator().hasNext());
+ Assertions.assertFalse(tree.boundaries().iterator().hasNext());
tree.setEmpty();
- Assert.assertFalse(tree.boundaries().iterator().hasNext());
+ Assertions.assertFalse(tree.boundaries().iterator().hasNext());
}
@Test
@@ -444,7 +444,7 @@ public class AbstractRegionBSPTreeTest {
}
// assert
- Assert.assertEquals(4, segments.size());
+ Assertions.assertEquals(4, segments.size());
assertContainsSegment(segments, new TestPoint2D(0, 0), new TestPoint2D(1, 0));
assertContainsSegment(segments, new TestPoint2D(1, 0), new TestPoint2D(1, 1));
@@ -465,7 +465,7 @@ public class AbstractRegionBSPTreeTest {
}
// assert
- Assert.assertEquals(4, segments.size());
+ Assertions.assertEquals(4, segments.size());
assertContainsSegment(segments, new TestPoint2D(0, 0), new TestPoint2D(0, 1));
assertContainsSegment(segments, new TestPoint2D(0, 1), new TestPoint2D(1, 1));
@@ -477,10 +477,10 @@ public class AbstractRegionBSPTreeTest {
public void testGetBoundaries_fullAndEmpty() {
// act/assert
tree.setFull();
- Assert.assertEquals(0, tree.getBoundaries().size());
+ Assertions.assertEquals(0, tree.getBoundaries().size());
tree.setEmpty();
- Assert.assertEquals(0, tree.getBoundaries().size());
+ Assertions.assertEquals(0, tree.getBoundaries().size());
}
@Test
@@ -495,7 +495,7 @@ public class AbstractRegionBSPTreeTest {
}
// assert
- Assert.assertEquals(4, segments.size());
+ Assertions.assertEquals(4, segments.size());
assertContainsSegment(segments, new TestPoint2D(0, 0), new TestPoint2D(1, 0));
assertContainsSegment(segments, new TestPoint2D(1, 0), new TestPoint2D(1, 1));
@@ -516,7 +516,7 @@ public class AbstractRegionBSPTreeTest {
}
// assert
- Assert.assertEquals(4, segments.size());
+ Assertions.assertEquals(4, segments.size());
assertContainsSegment(segments, new TestPoint2D(0, 0), new TestPoint2D(0, 1));
assertContainsSegment(segments, new TestPoint2D(0, 1), new TestPoint2D(1, 1));
@@ -530,38 +530,38 @@ public class AbstractRegionBSPTreeTest {
insertSkewedBowtie(tree);
// act/assert
- Assert.assertEquals(RegionLocation.INSIDE, tree.classify(new TestPoint2D(3, 1)));
- Assert.assertEquals(RegionLocation.INSIDE, tree.classify(new TestPoint2D(-3, -1)));
+ Assertions.assertEquals(RegionLocation.INSIDE, tree.classify(new TestPoint2D(3, 1)));
+ Assertions.assertEquals(RegionLocation.INSIDE, tree.classify(new TestPoint2D(-3, -1)));
- Assert.assertEquals(RegionLocation.OUTSIDE, tree.classify(new TestPoint2D(-3, 1)));
- Assert.assertEquals(RegionLocation.OUTSIDE, tree.classify(new TestPoint2D(3, -1)));
+ Assertions.assertEquals(RegionLocation.OUTSIDE, tree.classify(new TestPoint2D(-3, 1)));
+ Assertions.assertEquals(RegionLocation.OUTSIDE, tree.classify(new TestPoint2D(3, -1)));
- Assert.assertEquals(RegionLocation.BOUNDARY, tree.classify(new TestPoint2D(4, 5)));
- Assert.assertEquals(RegionLocation.BOUNDARY, tree.classify(new TestPoint2D(-4, -5)));
+ Assertions.assertEquals(RegionLocation.BOUNDARY, tree.classify(new TestPoint2D(4, 5)));
+ Assertions.assertEquals(RegionLocation.BOUNDARY, tree.classify(new TestPoint2D(-4, -5)));
- Assert.assertEquals(RegionLocation.OUTSIDE, tree.classify(new TestPoint2D(5, 0)));
- Assert.assertEquals(RegionLocation.BOUNDARY, tree.classify(new TestPoint2D(4, 0)));
- Assert.assertEquals(RegionLocation.BOUNDARY, tree.classify(new TestPoint2D(3, 0)));
- Assert.assertEquals(RegionLocation.BOUNDARY, tree.classify(new TestPoint2D(2, 0)));
- Assert.assertEquals(RegionLocation.BOUNDARY, tree.classify(new TestPoint2D(1, 0)));
- Assert.assertEquals(RegionLocation.INSIDE, tree.classify(new TestPoint2D(0, 0)));
- Assert.assertEquals(RegionLocation.BOUNDARY, tree.classify(new TestPoint2D(-1, 0)));
- Assert.assertEquals(RegionLocation.BOUNDARY, tree.classify(new TestPoint2D(-2, 0)));
- Assert.assertEquals(RegionLocation.BOUNDARY, tree.classify(new TestPoint2D(-3, 0)));
- Assert.assertEquals(RegionLocation.BOUNDARY, tree.classify(new TestPoint2D(-4, 0)));
- Assert.assertEquals(RegionLocation.OUTSIDE, tree.classify(new TestPoint2D(-5, 0)));
+ Assertions.assertEquals(RegionLocation.OUTSIDE, tree.classify(new TestPoint2D(5, 0)));
+ Assertions.assertEquals(RegionLocation.BOUNDARY, tree.classify(new TestPoint2D(4, 0)));
+ Assertions.assertEquals(RegionLocation.BOUNDARY, tree.classify(new TestPoint2D(3, 0)));
+ Assertions.assertEquals(RegionLocation.BOUNDARY, tree.classify(new TestPoint2D(2, 0)));
+ Assertions.assertEquals(RegionLocation.BOUNDARY, tree.classify(new TestPoint2D(1, 0)));
+ Assertions.assertEquals(RegionLocation.INSIDE, tree.classify(new TestPoint2D(0, 0)));
+ Assertions.assertEquals(RegionLocation.BOUNDARY, tree.classify(new TestPoint2D(-1, 0)));
+ Assertions.assertEquals(RegionLocation.BOUNDARY, tree.classify(new TestPoint2D(-2, 0)));
+ Assertions.assertEquals(RegionLocation.BOUNDARY, tree.classify(new TestPoint2D(-3, 0)));
+ Assertions.assertEquals(RegionLocation.BOUNDARY, tree.classify(new TestPoint2D(-4, 0)));
+ Assertions.assertEquals(RegionLocation.OUTSIDE, tree.classify(new TestPoint2D(-5, 0)));
}
@Test
public void testClassify_emptyTree() {
// act/assert
- Assert.assertEquals(RegionLocation.INSIDE, tree.classify(TestPoint2D.ZERO));
+ Assertions.assertEquals(RegionLocation.INSIDE, tree.classify(TestPoint2D.ZERO));
}
@Test
public void testClassify_NaN() {
// act/assert
- Assert.assertEquals(RegionLocation.OUTSIDE, tree.classify(new TestPoint2D(0, Double.NaN)));
+ Assertions.assertEquals(RegionLocation.OUTSIDE, tree.classify(new TestPoint2D(0, Double.NaN)));
}
@Test
@@ -570,28 +570,28 @@ public class AbstractRegionBSPTreeTest {
insertSkewedBowtie(tree);
// act/assert
- Assert.assertTrue(tree.contains(new TestPoint2D(3, 1)));
- Assert.assertTrue(tree.contains(new TestPoint2D(-3, -1)));
+ Assertions.assertTrue(tree.contains(new TestPoint2D(3, 1)));
+ Assertions.assertTrue(tree.contains(new TestPoint2D(-3, -1)));
- Assert.assertFalse(tree.contains(new TestPoint2D(-3, 1)));
- Assert.assertFalse(tree.contains(new TestPoint2D(3, -1)));
+ Assertions.assertFalse(tree.contains(new TestPoint2D(-3, 1)));
+ Assertions.assertFalse(tree.contains(new TestPoint2D(3, -1)));
- Assert.assertTrue(tree.contains(new TestPoint2D(4, 5)));
- Assert.assertTrue(tree.contains(new TestPoint2D(-4, -5)));
+ Assertions.assertTrue(tree.contains(new TestPoint2D(4, 5)));
+ Assertions.assertTrue(tree.contains(new TestPoint2D(-4, -5)));
- Assert.assertFalse(tree.contains(new TestPoint2D(5, 0)));
+ Assertions.assertFalse(tree.contains(new TestPoint2D(5, 0)));
- Assert.assertTrue(tree.contains(new TestPoint2D(4, 0)));
- Assert.assertTrue(tree.contains(new TestPoint2D(3, 0)));
- Assert.assertTrue(tree.contains(new TestPoint2D(2, 0)));
- Assert.assertTrue(tree.contains(new TestPoint2D(1, 0)));
- Assert.assertTrue(tree.contains(new TestPoint2D(0, 0)));
- Assert.assertTrue(tree.contains(new TestPoint2D(-1, 0)));
- Assert.assertTrue(tree.contains(new TestPoint2D(-2, 0)));
- Assert.assertTrue(tree.contains(new TestPoint2D(-3, 0)));
- Assert.assertTrue(tree.contains(new TestPoint2D(-4, 0)));
+ Assertions.assertTrue(tree.contains(new TestPoint2D(4, 0)));
+ Assertions.assertTrue(tree.contains(new TestPoint2D(3, 0)));
+ Assertions.assertTrue(tree.contains(new TestPoint2D(2, 0)));
+ Assertions.assertTrue(tree.contains(new TestPoint2D(1, 0)));
+ Assertions.assertTrue(tree.contains(new TestPoint2D(0, 0)));
+ Assertions.assertTrue(tree.contains(new TestPoint2D(-1, 0)));
+ Assertions.assertTrue(tree.contains(new TestPoint2D(-2, 0)));
+ Assertions.assertTrue(tree.contains(new TestPoint2D(-3, 0)));
+ Assertions.assertTrue(tree.contains(new TestPoint2D(-4, 0)));
- Assert.assertFalse(tree.contains(new TestPoint2D(-5, 0)));
+ Assertions.assertFalse(tree.contains(new TestPoint2D(-5, 0)));
}
@Test
@@ -603,11 +603,11 @@ public class AbstractRegionBSPTreeTest {
tree.setFull();
// assert
- Assert.assertTrue(tree.isFull());
- Assert.assertFalse(tree.isEmpty());
+ Assertions.assertTrue(tree.isFull());
+ Assertions.assertFalse(tree.isEmpty());
- Assert.assertEquals(RegionLocation.INSIDE, tree.classify(TestPoint2D.ZERO));
- Assert.assertTrue(tree.contains(TestPoint2D.ZERO));
+ Assertions.assertEquals(RegionLocation.INSIDE, tree.classify(TestPoint2D.ZERO));
+ Assertions.assertTrue(tree.contains(TestPoint2D.ZERO));
}
@Test
@@ -619,11 +619,11 @@ public class AbstractRegionBSPTreeTest {
tree.setEmpty();
// assert
- Assert.assertFalse(tree.isFull());
- Assert.assertTrue(tree.isEmpty());
+ Assertions.assertFalse(tree.isFull());
+ Assertions.assertTrue(tree.isEmpty());
- Assert.assertEquals(RegionLocation.OUTSIDE, tree.classify(TestPoint2D.ZERO));
- Assert.assertFalse(tree.contains(TestPoint2D.ZERO));
+ Assertions.assertEquals(RegionLocation.OUTSIDE, tree.classify(TestPoint2D.ZERO));
+ Assertions.assertFalse(tree.contains(TestPoint2D.ZERO));
}
@Test
@@ -635,10 +635,10 @@ public class AbstractRegionBSPTreeTest {
final RegionSizeProperties<TestPoint2D> third = tree.getRegionSizeProperties();
// assert
- Assert.assertSame(first, second);
- Assert.assertNotSame(second, third);
+ Assertions.assertSame(first, second);
+ Assertions.assertNotSame(second, third);
- Assert.assertEquals(1234, first.getSize(), PartitionTestUtils.EPS);
+ Assertions.assertEquals(1234, first.getSize(), PartitionTestUtils.EPS);
PartitionTestUtils.assertPointsEqual(new TestPoint2D(12, 34), first.getCentroid());
}
@@ -646,7 +646,7 @@ public class AbstractRegionBSPTreeTest {
public void testGetSize() {
// act/assert
// make sure our stub value is pulled
- Assert.assertEquals(1234, tree.getSize(), PartitionTestUtils.EPS);
+ Assertions.assertEquals(1234, tree.getSize(), PartitionTestUtils.EPS);
}
@Test
@@ -659,8 +659,8 @@ public class AbstractRegionBSPTreeTest {
@Test
public void testGetBoundarySize_fullAndEmpty() {
// act/assert
- Assert.assertEquals(0.0, fullTree().getBoundarySize(), PartitionTestUtils.EPS);
- Assert.assertEquals(0.0, emptyTree().getBoundarySize(), PartitionTestUtils.EPS);
+ Assertions.assertEquals(0.0, fullTree().getBoundarySize(), PartitionTestUtils.EPS);
+ Assertions.assertEquals(0.0, emptyTree().getBoundarySize(), PartitionTestUtils.EPS);
}
@Test
@@ -673,8 +673,8 @@ public class AbstractRegionBSPTreeTest {
halfPosComplement.complement(halfPos);
// act/assert
- Assert.assertEquals(Double.POSITIVE_INFINITY, halfPos.getBoundarySize(), PartitionTestUtils.EPS);
- Assert.assertEquals(Double.POSITIVE_INFINITY, halfPosComplement.getBoundarySize(), PartitionTestUtils.EPS);
+ Assertions.assertEquals(Double.POSITIVE_INFINITY, halfPos.getBoundarySize(), PartitionTestUtils.EPS);
+ Assertions.assertEquals(Double.POSITIVE_INFINITY, halfPosComplement.getBoundarySize(), PartitionTestUtils.EPS);
}
@Test
@@ -697,7 +697,7 @@ public class AbstractRegionBSPTreeTest {
tree.cutNode(node, new TestLineSegment(0, 0, new TestLine(p0, new TestPoint2D(1, 3))));
// act/assert
- Assert.assertEquals(6, tree.getBoundarySize(), PartitionTestUtils.EPS);
+ Assertions.assertEquals(6, tree.getBoundarySize(), PartitionTestUtils.EPS);
}
@Test
@@ -706,7 +706,7 @@ public class AbstractRegionBSPTreeTest {
insertBox(tree, new TestPoint2D(2, 2), new TestPoint2D(4, 1));
// act/assert
- Assert.assertEquals(6.0, tree.getBoundarySize(), PartitionTestUtils.EPS);
+ Assertions.assertEquals(6.0, tree.getBoundarySize(), PartitionTestUtils.EPS);
}
@Test
@@ -716,7 +716,7 @@ public class AbstractRegionBSPTreeTest {
tree.complement();
// act/assert
- Assert.assertEquals(6.0, tree.getBoundarySize(), PartitionTestUtils.EPS);
+ Assertions.assertEquals(6.0, tree.getBoundarySize(), PartitionTestUtils.EPS);
}
@Test
@@ -732,9 +732,9 @@ public class AbstractRegionBSPTreeTest {
final double third = tree.getBoundarySize();
// assert
- Assert.assertEquals(6.0, first, PartitionTestUtils.EPS);
- Assert.assertEquals(4.0, second, PartitionTestUtils.EPS);
- Assert.assertEquals(4.0, third, PartitionTestUtils.EPS);
+ Assertions.assertEquals(6.0, first, PartitionTestUtils.EPS);
+ Assertions.assertEquals(4.0, second, PartitionTestUtils.EPS);
+ Assertions.assertEquals(4.0, third, PartitionTestUtils.EPS);
}
@Test
@@ -743,7 +743,7 @@ public class AbstractRegionBSPTreeTest {
final RegionCutBoundary<TestPoint2D> boundary = root.getCutBoundary();
// assert
- Assert.assertNull(boundary);
+ Assertions.assertNull(boundary);
}
@Test
@@ -755,7 +755,7 @@ public class AbstractRegionBSPTreeTest {
final RegionCutBoundary<TestPoint2D> boundary = root.getCutBoundary();
// assert
- Assert.assertTrue(boundary.getInsideFacing().isEmpty());
+ Assertions.assertTrue(boundary.getInsideFacing().isEmpty());
assertCutBoundarySegment(boundary.getOutsideFacing(),
new TestPoint2D(Double.NEGATIVE_INFINITY, 0.0), new TestPoint2D(Double.POSITIVE_INFINITY, 0.0));
@@ -770,7 +770,7 @@ public class AbstractRegionBSPTreeTest {
final RegionCutBoundary<TestPoint2D> boundary = root.getMinus().getCutBoundary();
// assert
- Assert.assertNull(boundary);
+ Assertions.assertNull(boundary);
}
@Test
@@ -782,12 +782,12 @@ public class AbstractRegionBSPTreeTest {
// act/assert
final RegionCutBoundary<TestPoint2D> rootBoundary = root.getCutBoundary();
- Assert.assertTrue(rootBoundary.getInsideFacing().isEmpty());
+ Assertions.assertTrue(rootBoundary.getInsideFacing().isEmpty());
assertCutBoundarySegment(rootBoundary.getOutsideFacing(),
new TestPoint2D(Double.NEGATIVE_INFINITY, 0.0), TestPoint2D.ZERO);
final RegionCutBoundary<TestPoint2D> childBoundary = tree.getRoot().getMinus().getCutBoundary();
- Assert.assertTrue(childBoundary.getInsideFacing().isEmpty());
+ Assertions.assertTrue(childBoundary.getInsideFacing().isEmpty());
assertCutBoundarySegment(childBoundary.getOutsideFacing(),
TestPoint2D.ZERO, new TestPoint2D(0.0, Double.POSITIVE_INFINITY));
}
@@ -799,17 +799,17 @@ public class AbstractRegionBSPTreeTest {
tree.insert(new TestLineSegment(TestPoint2D.ZERO, new TestPoint2D(0, 1)));
// act/assert
- Assert.assertNull(root.getPlus().getCutBoundary());
- Assert.assertNull(root.getMinus().getMinus().getCutHyperplane());
- Assert.assertNull(root.getMinus().getPlus().getCutHyperplane());
+ Assertions.assertNull(root.getPlus().getCutBoundary());
+ Assertions.assertNull(root.getMinus().getMinus().getCutHyperplane());
+ Assertions.assertNull(root.getMinus().getPlus().getCutHyperplane());
}
@Test
public void testFullEmpty_fullTree() {
// act/assert
- Assert.assertTrue(tree.isFull());
- Assert.assertFalse(tree.isEmpty());
- Assert.assertEquals(RegionLocation.INSIDE, tree.getRoot().getLocation());
+ Assertions.assertTrue(tree.isFull());
+ Assertions.assertFalse(tree.isEmpty());
+ Assertions.assertEquals(RegionLocation.INSIDE, tree.getRoot().getLocation());
}
@Test
@@ -818,9 +818,9 @@ public class AbstractRegionBSPTreeTest {
tree.complement();
// act/assert
- Assert.assertFalse(tree.isFull());
- Assert.assertTrue(tree.isEmpty());
- Assert.assertEquals(RegionLocation.OUTSIDE, tree.getRoot().getLocation());
+ Assertions.assertFalse(tree.isFull());
+ Assertions.assertTrue(tree.isEmpty());
+ Assertions.assertEquals(RegionLocation.OUTSIDE, tree.getRoot().getLocation());
}
@Test
@@ -832,8 +832,8 @@ public class AbstractRegionBSPTreeTest {
tree.transform(t);
// assert
- Assert.assertTrue(tree.isFull());
- Assert.assertFalse(tree.isEmpty());
+ Assertions.assertTrue(tree.isFull());
+ Assertions.assertFalse(tree.isEmpty());
PartitionTestUtils.assertPointLocations(tree, RegionLocation.INSIDE, TestPoint2D.ZERO);
}
@@ -849,8 +849,8 @@ public class AbstractRegionBSPTreeTest {
tree.transform(t);
// assert
- Assert.assertFalse(tree.isFull());
- Assert.assertFalse(tree.isEmpty());
+ Assertions.assertFalse(tree.isFull());
+ Assertions.assertFalse(tree.isEmpty());
PartitionTestUtils.assertPointLocations(tree, RegionLocation.OUTSIDE,
new TestPoint2D(0, -1), TestPoint2D.ZERO, new TestPoint2D(0, 1));
@@ -872,8 +872,8 @@ public class AbstractRegionBSPTreeTest {
tree.transform(t);
// assert
- Assert.assertFalse(tree.isFull());
- Assert.assertFalse(tree.isEmpty());
+ Assertions.assertFalse(tree.isFull());
+ Assertions.assertFalse(tree.isEmpty());
PartitionTestUtils.assertPointLocations(tree, RegionLocation.INSIDE,
new TestPoint2D(0, 5), new TestPoint2D(-1, 4), new TestPoint2D(1, 6));
@@ -896,8 +896,8 @@ public class AbstractRegionBSPTreeTest {
tree.transform(t);
// assert
- Assert.assertFalse(tree.isFull());
- Assert.assertFalse(tree.isEmpty());
+ Assertions.assertFalse(tree.isFull());
+ Assertions.assertFalse(tree.isEmpty());
PartitionTestUtils.assertPointLocations(tree, RegionLocation.INSIDE,
TestPoint2D.ZERO, new TestPoint2D(-1, 1), new TestPoint2D(1, -1));
@@ -921,8 +921,8 @@ public class AbstractRegionBSPTreeTest {
tree.transform(t);
// assert
- Assert.assertFalse(tree.isFull());
- Assert.assertFalse(tree.isEmpty());
+ Assertions.assertFalse(tree.isFull());
+ Assertions.assertFalse(tree.isEmpty());
PartitionTestUtils.assertPointLocations(tree, RegionLocation.INSIDE,
TestPoint2D.ZERO, new TestPoint2D(1, -1), new TestPoint2D(-1, 1));
@@ -946,8 +946,8 @@ public class AbstractRegionBSPTreeTest {
tree.transform(t);
// assert
- Assert.assertFalse(tree.isFull());
- Assert.assertFalse(tree.isEmpty());
+ Assertions.assertFalse(tree.isFull());
+ Assertions.assertFalse(tree.isEmpty());
PartitionTestUtils.assertPointLocations(tree, RegionLocation.INSIDE,
TestPoint2D.ZERO, new TestPoint2D(1, 1), new TestPoint2D(-1, -1));
@@ -978,7 +978,7 @@ public class AbstractRegionBSPTreeTest {
final RegionCutBoundary<TestPoint2D> resultBoundary = node.getCutBoundary();
// assert
- Assert.assertNotSame(origBoundary, resultBoundary);
+ Assertions.assertNotSame(origBoundary, resultBoundary);
assertCutBoundarySegment(origBoundary.getOutsideFacing(), new TestPoint2D(4, 5), new TestPoint2D(-1, 0));
@@ -991,11 +991,11 @@ public class AbstractRegionBSPTreeTest {
tree.complement();
// assert
- Assert.assertTrue(tree.isEmpty());
- Assert.assertFalse(tree.isFull());
+ Assertions.assertTrue(tree.isEmpty());
+ Assertions.assertFalse(tree.isFull());
- Assert.assertEquals(RegionLocation.OUTSIDE, root.getLocation());
- Assert.assertEquals(RegionLocation.OUTSIDE, tree.classify(TestPoint2D.ZERO));
+ Assertions.assertEquals(RegionLocation.OUTSIDE, root.getLocation());
+ Assertions.assertEquals(RegionLocation.OUTSIDE, tree.classify(TestPoint2D.ZERO));
}
@Test
@@ -1007,15 +1007,15 @@ public class AbstractRegionBSPTreeTest {
tree.complement();
// assert
- Assert.assertFalse(tree.isEmpty());
- Assert.assertFalse(tree.isFull());
+ Assertions.assertFalse(tree.isEmpty());
+ Assertions.assertFalse(tree.isFull());
- Assert.assertEquals(RegionLocation.OUTSIDE, root.getMinus().getLocation());
- Assert.assertEquals(RegionLocation.INSIDE, root.getPlus().getLocation());
+ Assertions.assertEquals(RegionLocation.OUTSIDE, root.getMinus().getLocation());
+ Assertions.assertEquals(RegionLocation.INSIDE, root.getPlus().getLocation());
- Assert.assertEquals(RegionLocation.OUTSIDE, tree.classify(new TestPoint2D(0, 1)));
- Assert.assertEquals(RegionLocation.BOUNDARY, tree.classify(TestPoint2D.ZERO));
- Assert.assertEquals(RegionLocation.INSIDE, tree.classify(new TestPoint2D(0, -1)));
+ Assertions.assertEquals(RegionLocation.OUTSIDE, tree.classify(new TestPoint2D(0, 1)));
+ Assertions.assertEquals(RegionLocation.BOUNDARY, tree.classify(TestPoint2D.ZERO));
+ Assertions.assertEquals(RegionLocation.INSIDE, tree.classify(new TestPoint2D(0, -1)));
}
@Test
@@ -1027,29 +1027,29 @@ public class AbstractRegionBSPTreeTest {
tree.complement();
// assert
- Assert.assertFalse(tree.isEmpty());
- Assert.assertFalse(tree.isFull());
+ Assertions.assertFalse(tree.isEmpty());
+ Assertions.assertFalse(tree.isFull());
- Assert.assertEquals(RegionLocation.OUTSIDE, tree.classify(new TestPoint2D(3, 1)));
- Assert.assertEquals(RegionLocation.OUTSIDE, tree.classify(new TestPoint2D(-3, -1)));
+ Assertions.assertEquals(RegionLocation.OUTSIDE, tree.classify(new TestPoint2D(3, 1)));
+ Assertions.assertEquals(RegionLocation.OUTSIDE, tree.classify(new TestPoint2D(-3, -1)));
- Assert.assertEquals(RegionLocation.INSIDE, tree.classify(new TestPoint2D(-3, 1)));
- Assert.assertEquals(RegionLocation.INSIDE, tree.classify(new TestPoint2D(3, -1)));
+ Assertions.assertEquals(RegionLocation.INSIDE, tree.classify(new TestPoint2D(-3, 1)));
+ Assertions.assertEquals(RegionLocation.INSIDE, tree.classify(new TestPoint2D(3, -1)));
- Assert.assertEquals(RegionLocation.BOUNDARY, tree.classify(new TestPoint2D(4, 5)));
- Assert.assertEquals(RegionLocation.BOUNDARY, tree.classify(new TestPoint2D(-4, -5)));
+ Assertions.assertEquals(RegionLocation.BOUNDARY, tree.classify(new TestPoint2D(4, 5)));
+ Assertions.assertEquals(RegionLocation.BOUNDARY, tree.classify(new TestPoint2D(-4, -5)));
- Assert.assertEquals(RegionLocation.INSIDE, tree.classify(new TestPoint2D(5, 0)));
- Assert.assertEquals(RegionLocation.BOUNDARY, tree.classify(new TestPoint2D(4, 0)));
- Assert.assertEquals(RegionLocation.BOUNDARY, tree.classify(new TestPoint2D(3, 0)));
- Assert.assertEquals(RegionLocation.BOUNDARY, tree.classify(new TestPoint2D(2, 0)));
- Assert.assertEquals(RegionLocation.BOUNDARY, tree.classify(new TestPoint2D(1, 0)));
- Assert.assertEquals(RegionLocation.OUTSIDE, tree.classify(new TestPoint2D(0, 0)));
- Assert.assertEquals(RegionLocation.BOUNDARY, tree.classify(new TestPoint2D(-1, 0)));
- Assert.assertEquals(RegionLocation.BOUNDARY, tree.classify(new TestPoint2D(-2, 0)));
- Assert.assertEquals(RegionLocation.BOUNDARY, tree.classify(new TestPoint2D(-3, 0)));
- Assert.assertEquals(RegionLocation.BOUNDARY, tree.classify(new TestPoint2D(-4, 0)));
- Assert.assertEquals(RegionLocation.INSIDE, tree.classify(new TestPoint2D(-5, 0)));
+ Assertions.assertEquals(RegionLocation.INSIDE, tree.classify(new TestPoint2D(5, 0)));
+ Assertions.assertEquals(RegionLocation.BOUNDARY, tree.classify(new TestPoint2D(4, 0)));
+ Assertions.assertEquals(RegionLocation.BOUNDARY, tree.classify(new TestPoint2D(3, 0)));
+ Assertions.assertEquals(RegionLocation.BOUNDARY, tree.classify(new TestPoint2D(2, 0)));
+ Assertions.assertEquals(RegionLocation.BOUNDARY, tree.classify(new TestPoint2D(1, 0)));
+ Assertions.assertEquals(RegionLocation.OUTSIDE, tree.classify(new TestPoint2D(0, 0)));
+ Assertions.assertEquals(RegionLocation.BOUNDARY, tree.classify(new TestPoint2D(-1, 0)));
+ Assertions.assertEquals(RegionLocation.BOUNDARY, tree.classify(new TestPoint2D(-2, 0)));
+ Assertions.assertEquals(RegionLocation.BOUNDARY, tree.classify(new TestPoint2D(-3, 0)));
+ Assertions.assertEquals(RegionLocation.BOUNDARY, tree.classify(new TestPoint2D(-4, 0)));
+ Assertions.assertEquals(RegionLocation.INSIDE, tree.classify(new TestPoint2D(-5, 0)));
}
@Test
@@ -1062,15 +1062,15 @@ public class AbstractRegionBSPTreeTest {
tree.insert(new TestLineSegment(TestPoint2D.ZERO, new TestPoint2D(0, 1)));
// assert
- Assert.assertFalse(tree.isEmpty());
- Assert.assertFalse(tree.isFull());
+ Assertions.assertFalse(tree.isEmpty());
+ Assertions.assertFalse(tree.isFull());
- Assert.assertEquals(RegionLocation.BOUNDARY, tree.classify(TestPoint2D.ZERO));
+ Assertions.assertEquals(RegionLocation.BOUNDARY, tree.classify(TestPoint2D.ZERO));
- Assert.assertEquals(RegionLocation.OUTSIDE, tree.classify(new TestPoint2D(1, 1)));
- Assert.assertEquals(RegionLocation.INSIDE, tree.classify(new TestPoint2D(-1, 1)));
- Assert.assertEquals(RegionLocation.INSIDE, tree.classify(new TestPoint2D(1, -1)));
- Assert.assertEquals(RegionLocation.INSIDE, tree.classify(new TestPoint2D(-1, -1)));
+ Assertions.assertEquals(RegionLocation.OUTSIDE, tree.classify(new TestPoint2D(1, 1)));
+ Assertions.assertEquals(RegionLocation.INSIDE, tree.classify(new TestPoint2D(-1, 1)));
+ Assertions.assertEquals(RegionLocation.INSIDE, tree.classify(new TestPoint2D(1, -1)));
+ Assertions.assertEquals(RegionLocation.INSIDE, tree.classify(new TestPoint2D(-1, -1)));
}
@Test
@@ -1086,15 +1086,15 @@ public class AbstractRegionBSPTreeTest {
root.getMinus().clearCut();
// assert
- Assert.assertFalse(tree.isEmpty());
- Assert.assertFalse(tree.isFull());
+ Assertions.assertFalse(tree.isEmpty());
+ Assertions.assertFalse(tree.isFull());
- Assert.assertEquals(RegionLocation.BOUNDARY, tree.classify(TestPoint2D.ZERO));
+ Assertions.assertEquals(RegionLocation.BOUNDARY, tree.classify(TestPoint2D.ZERO));
- Assert.assertEquals(RegionLocation.OUTSIDE, tree.classify(new TestPoint2D(1, 1)));
- Assert.assertEquals(RegionLocation.OUTSIDE, tree.classify(new TestPoint2D(-1, 1)));
- Assert.assertEquals(RegionLocation.INSIDE, tree.classify(new TestPoint2D(1, -1)));
- Assert.assertEquals(RegionLocation.INSIDE, tree.classify(new TestPoint2D(-1, -1)));
+ Assertions.assertEquals(RegionLocation.OUTSIDE, tree.classify(new TestPoint2D(1, 1)));
+ Assertions.assertEquals(RegionLocation.OUTSIDE, tree.classify(new TestPoint2D(-1, 1)));
+ Assertions.assertEquals(RegionLocation.INSIDE, tree.classify(new TestPoint2D(1, -1)));
+ Assertions.assertEquals(RegionLocation.INSIDE, tree.classify(new TestPoint2D(-1, -1)));
}
@Test
@@ -1110,10 +1110,10 @@ public class AbstractRegionBSPTreeTest {
root.clearCut();
// assert
- Assert.assertTrue(tree.isEmpty());
- Assert.assertFalse(tree.isFull());
+ Assertions.assertTrue(tree.isEmpty());
+ Assertions.assertFalse(tree.isFull());
- Assert.assertEquals(RegionLocation.OUTSIDE, tree.classify(TestPoint2D.ZERO));
+ Assertions.assertEquals(RegionLocation.OUTSIDE, tree.classify(TestPoint2D.ZERO));
}
@Test
@@ -1123,11 +1123,11 @@ public class AbstractRegionBSPTreeTest {
tree.complement();
// assert
- Assert.assertFalse(tree.isEmpty());
- Assert.assertTrue(tree.isFull());
+ Assertions.assertFalse(tree.isEmpty());
+ Assertions.assertTrue(tree.isFull());
- Assert.assertEquals(RegionLocation.INSIDE, root.getLocation());
- Assert.assertEquals(RegionLocation.INSIDE, tree.classify(TestPoint2D.ZERO));
+ Assertions.assertEquals(RegionLocation.INSIDE, root.getLocation());
+ Assertions.assertEquals(RegionLocation.INSIDE, tree.classify(TestPoint2D.ZERO));
}
@Test
@@ -1140,26 +1140,26 @@ public class AbstractRegionBSPTreeTest {
tree.complement();
// assert
- Assert.assertEquals(RegionLocation.INSIDE, tree.classify(new TestPoint2D(3, 1)));
- Assert.assertEquals(RegionLocation.INSIDE, tree.classify(new TestPoint2D(-3, -1)));
+ Assertions.assertEquals(RegionLocation.INSIDE, tree.classify(new TestPoint2D(3, 1)));
+ Assertions.assertEquals(RegionLocation.INSIDE, tree.classify(new TestPoint2D(-3, -1)));
- Assert.assertEquals(RegionLocation.OUTSIDE, tree.classify(new TestPoint2D(-3, 1)));
- Assert.assertEquals(RegionLocation.OUTSIDE, tree.classify(new TestPoint2D(3, -1)));
+ Assertions.assertEquals(RegionLocation.OUTSIDE, tree.classify(new TestPoint2D(-3, 1)));
+ Assertions.assertEquals(RegionLocation.OUTSIDE, tree.classify(new TestPoint2D(3, -1)));
- Assert.assertEquals(RegionLocation.BOUNDARY, tree.classify(new TestPoint2D(4, 5)));
- Assert.assertEquals(RegionLocation.BOUNDARY, tree.classify(new TestPoint2D(-4, -5)));
+ Assertions.assertEquals(RegionLocation.BOUNDARY, tree.classify(new TestPoint2D(4, 5)));
+ Assertions.assertEquals(RegionLocation.BOUNDARY, tree.classify(new TestPoint2D(-4, -5)));
- Assert.assertEquals(RegionLocation.OUTSIDE, tree.classify(new TestPoint2D(5, 0)));
- Assert.assertEquals(RegionLocation.BOUNDARY, tree.classify(new TestPoint2D(4, 0)));
- Assert.assertEquals(RegionLocation.BOUNDARY, tree.classify(new TestPoint2D(3, 0)));
- Assert.assertEquals(RegionLocation.BOUNDARY, tree.classify(new TestPoint2D(2, 0)));
- Assert.assertEquals(RegionLocation.BOUNDARY, tree.classify(new TestPoint2D(1, 0)));
- Assert.assertEquals(RegionLocation.INSIDE, tree.classify(new TestPoint2D(0, 0)));
- Assert.assertEquals(RegionLocation.BOUNDARY, tree.classify(new TestPoint2D(-1, 0)));
- Assert.assertEquals(RegionLocation.BOUNDARY, tree.classify(new TestPoint2D(-2, 0)));
- Assert.assertEquals(RegionLocation.BOUNDARY, tree.classify(new TestPoint2D(-3, 0)));
- Assert.assertEquals(RegionLocation.BOUNDARY, tree.classify(new TestPoint2D(-4, 0)));
- Assert.assertEquals(RegionLocation.OUTSIDE, tree.classify(new TestPoint2D(-5, 0)));
+ Assertions.assertEquals(RegionLocation.OUTSIDE, tree.classify(new TestPoint2D(5, 0)));
+ Assertions.assertEquals(RegionLocation.BOUNDARY, tree.classify(new TestPoint2D(4, 0)));
+ Assertions.assertEquals(RegionLocation.BOUNDARY, tree.classify(new TestPoint2D(3, 0)));
+ Assertions.assertEquals(RegionLocation.BOUNDARY, tree.classify(new TestPoint2D(2, 0)));
+ Assertions.assertEquals(RegionLocation.BOUNDARY, tree.classify(new TestPoint2D(1, 0)));
+ Assertions.assertEquals(RegionLocation.INSIDE, tree.classify(new TestPoint2D(0, 0)));
+ Assertions.assertEquals(RegionLocation.BOUNDARY, tree.classify(new TestPoint2D(-1, 0)));
+ Assertions.assertEquals(RegionLocation.BOUNDARY, tree.classify(new TestPoint2D(-2, 0)));
+ Assertions.assertEquals(RegionLocation.BOUNDARY, tree.classify(new TestPoint2D(-3, 0)));
+ Assertions.assertEquals(RegionLocation.BOUNDARY, tree.classify(new TestPoint2D(-4, 0)));
+ Assertions.assertEquals(RegionLocation.OUTSIDE, tree.classify(new TestPoint2D(-5, 0)));
}
@Test
@@ -1175,21 +1175,21 @@ public class AbstractRegionBSPTreeTest {
final RegionCutBoundary<TestPoint2D> yAxisBoundary = root.getMinus().getCutBoundary();
// assert
- Assert.assertTrue(xAxisBoundary.getOutsideFacing().isEmpty());
- Assert.assertFalse(xAxisBoundary.getInsideFacing().isEmpty());
+ Assertions.assertTrue(xAxisBoundary.getOutsideFacing().isEmpty());
+ Assertions.assertFalse(xAxisBoundary.getInsideFacing().isEmpty());
final List<HyperplaneConvexSubset<TestPoint2D>> xAxisInsideFacing = xAxisBoundary.getInsideFacing();
- Assert.assertEquals(1, xAxisInsideFacing.size());
+ Assertions.assertEquals(1, xAxisInsideFacing.size());
final TestLineSegment xAxisSeg = (TestLineSegment) xAxisInsideFacing.get(0);
PartitionTestUtils.assertPointsEqual(new TestPoint2D(Double.NEGATIVE_INFINITY, 0), xAxisSeg.getStartPoint());
PartitionTestUtils.assertPointsEqual(TestPoint2D.ZERO, xAxisSeg.getEndPoint());
- Assert.assertTrue(yAxisBoundary.getOutsideFacing().isEmpty());
- Assert.assertFalse(yAxisBoundary.getInsideFacing().isEmpty());
+ Assertions.assertTrue(yAxisBoundary.getOutsideFacing().isEmpty());
+ Assertions.assertFalse(yAxisBoundary.getInsideFacing().isEmpty());
final List<HyperplaneConvexSubset<TestPoint2D>> yAxisInsideFacing = yAxisBoundary.getInsideFacing();
- Assert.assertEquals(1, yAxisInsideFacing.size());
+ Assertions.assertEquals(1, yAxisInsideFacing.size());
final TestLineSegment yAxisSeg = (TestLineSegment) yAxisInsideFacing.get(0);
PartitionTestUtils.assertPointsEqual(TestPoint2D.ZERO, yAxisSeg.getStartPoint());
@@ -1206,17 +1206,17 @@ public class AbstractRegionBSPTreeTest {
other.complement(tree);
// assert
- Assert.assertFalse(tree.isEmpty());
- Assert.assertTrue(tree.isFull());
+ Assertions.assertFalse(tree.isEmpty());
+ Assertions.assertTrue(tree.isFull());
- Assert.assertEquals(RegionLocation.INSIDE, root.getLocation());
- Assert.assertEquals(RegionLocation.INSIDE, tree.classify(TestPoint2D.ZERO));
+ Assertions.assertEquals(RegionLocation.INSIDE, root.getLocation());
+ Assertions.assertEquals(RegionLocation.INSIDE, tree.classify(TestPoint2D.ZERO));
- Assert.assertTrue(other.isEmpty());
- Assert.assertFalse(other.isFull());
+ Assertions.assertTrue(other.isEmpty());
+ Assertions.assertFalse(other.isFull());
- Assert.assertEquals(RegionLocation.OUTSIDE, other.getRoot().getLocation());
- Assert.assertEquals(RegionLocation.OUTSIDE, other.classify(TestPoint2D.ZERO));
+ Assertions.assertEquals(RegionLocation.OUTSIDE, other.getRoot().getLocation());
+ Assertions.assertEquals(RegionLocation.OUTSIDE, other.classify(TestPoint2D.ZERO));
}
@Test
@@ -1230,32 +1230,32 @@ public class AbstractRegionBSPTreeTest {
other.complement(tree);
// assert
- Assert.assertEquals(RegionLocation.INSIDE, tree.classify(new TestPoint2D(3, 1)));
- Assert.assertEquals(RegionLocation.INSIDE, tree.classify(new TestPoint2D(-3, -1)));
+ Assertions.assertEquals(RegionLocation.INSIDE, tree.classify(new TestPoint2D(3, 1)));
+ Assertions.assertEquals(RegionLocation.INSIDE, tree.classify(new TestPoint2D(-3, -1)));
- Assert.assertFalse(other.isEmpty());
- Assert.assertFalse(other.isFull());
+ Assertions.assertFalse(other.isEmpty());
+ Assertions.assertFalse(other.isFull());
- Assert.assertEquals(RegionLocation.OUTSIDE, other.classify(new TestPoint2D(3, 1)));
- Assert.assertEquals(RegionLocation.OUTSIDE, other.classify(new TestPoint2D(-3, -1)));
+ Assertions.assertEquals(RegionLocation.OUTSIDE, other.classify(new TestPoint2D(3, 1)));
+ Assertions.assertEquals(RegionLocation.OUTSIDE, other.classify(new TestPoint2D(-3, -1)));
- Assert.assertEquals(RegionLocation.INSIDE, other.classify(new TestPoint2D(-3, 1)));
- Assert.assertEquals(RegionLocation.INSIDE, other.classify(new TestPoint2D(3, -1)));
+ Assertions.assertEquals(RegionLocation.INSIDE, other.classify(new TestPoint2D(-3, 1)));
+ Assertions.assertEquals(RegionLocation.INSIDE, other.classify(new TestPoint2D(3, -1)));
- Assert.assertEquals(RegionLocation.BOUNDARY, other.classify(new TestPoint2D(4, 5)));
- Assert.assertEquals(RegionLocation.BOUNDARY, other.classify(new TestPoint2D(-4, -5)));
+ Assertions.assertEquals(RegionLocation.BOUNDARY, other.classify(new TestPoint2D(4, 5)));
+ Assertions.assertEquals(RegionLocation.BOUNDARY, other.classify(new TestPoint2D(-4, -5)));
- Assert.assertEquals(RegionLocation.INSIDE, other.classify(new TestPoint2D(5, 0)));
- Assert.assertEquals(RegionLocation.BOUNDARY, other.classify(new TestPoint2D(4, 0)));
- Assert.assertEquals(RegionLocation.BOUNDARY, other.classify(new TestPoint2D(3, 0)));
- Assert.assertEquals(RegionLocation.BOUNDARY, other.classify(new TestPoint2D(2, 0)));
- Assert.assertEquals(RegionLocation.BOUNDARY, other.classify(new TestPoint2D(1, 0)));
- Assert.assertEquals(RegionLocation.OUTSIDE, other.classify(new TestPoint2D(0, 0)));
- Assert.assertEquals(RegionLocation.BOUNDARY, other.classify(new TestPoint2D(-1, 0)));
- Assert.assertEquals(RegionLocation.BOUNDARY, other.classify(new TestPoint2D(-2, 0)));
- Assert.assertEquals(RegionLocation.BOUNDARY, other.classify(new TestPoint2D(-3, 0)));
- Assert.assertEquals(RegionLocation.BOUNDARY, other.classify(new TestPoint2D(-4, 0)));
- Assert.assertEquals(RegionLocation.INSIDE, other.classify(new TestPoint2D(-5, 0)));
+ Assertions.assertEquals(RegionLocation.INSIDE, other.classify(new TestPoint2D(5, 0)));
+ Assertions.assertEquals(RegionLocation.BOUNDARY, other.classify(new TestPoint2D(4, 0)));
+ Assertions.assertEquals(RegionLocation.BOUNDARY, other.classify(new TestPoint2D(3, 0)));
+ Assertions.assertEquals(RegionLocation.BOUNDARY, other.classify(new TestPoint2D(2, 0)));
+ Assertions.assertEquals(RegionLocation.BOUNDARY, other.classify(new TestPoint2D(1, 0)));
+ Assertions.assertEquals(RegionLocation.OUTSIDE, other.classify(new TestPoint2D(0, 0)));
+ Assertions.assertEquals(RegionLocation.BOUNDARY, other.classify(new TestPoint2D(-1, 0)));
+ Assertions.assertEquals(RegionLocation.BOUNDARY, other.classify(new TestPoint2D(-2, 0)));
+ Assertions.assertEquals(RegionLocation.BOUNDARY, other.classify(new TestPoint2D(-3, 0)));
+ Assertions.assertEquals(RegionLocation.BOUNDARY, other.classify(new TestPoint2D(-4, 0)));
+ Assertions.assertEquals(RegionLocation.INSIDE, other.classify(new TestPoint2D(-5, 0)));
}
@Test
@@ -1268,8 +1268,8 @@ public class AbstractRegionBSPTreeTest {
copy.copy(tree);
// assert
- Assert.assertNotSame(tree, copy);
- Assert.assertEquals(tree.count(), copy.count());
+ Assertions.assertNotSame(tree, copy);
+ Assertions.assertEquals(tree.count(), copy.count());
final List<RegionLocation> origLocations = new ArrayList<>();
tree.nodes().forEach(n -> origLocations.add(n.getLocation()));
@@ -1277,7 +1277,7 @@ public class AbstractRegionBSPTreeTest {
final List<RegionLocation> copyLocations = new ArrayList<>();
copy.nodes().forEach(n -> copyLocations.add(n.getLocation()));
- Assert.assertEquals(origLocations, copyLocations);
+ Assertions.assertEquals(origLocations, copyLocations);
}
@Test
@@ -1342,8 +1342,8 @@ public class AbstractRegionBSPTreeTest {
final TestRegionBSPTree empty = emptyTree();
// act/assert
- Assert.assertNull(full.project(new TestPoint2D(0, 0)));
- Assert.assertNull(empty.project(new TestPoint2D(-1, 1)));
+ Assertions.assertNull(full.project(new TestPoint2D(0, 0)));
+ Assertions.assertNull(empty.project(new TestPoint2D(-1, 1)));
}
@Test
@@ -1384,10 +1384,10 @@ public class AbstractRegionBSPTreeTest {
final Split<TestRegionBSPTree> split = tree.split(TestLine.X_AXIS);
// assert
- Assert.assertEquals(SplitLocation.NEITHER, split.getLocation());
+ Assertions.assertEquals(SplitLocation.NEITHER, split.getLocation());
- Assert.assertNull(split.getMinus());
- Assert.assertNull(split.getPlus());
+ Assertions.assertNull(split.getMinus());
+ Assertions.assertNull(split.getPlus());
}
@Test
@@ -1399,7 +1399,7 @@ public class AbstractRegionBSPTreeTest {
final Split<TestRegionBSPTree> split = tree.split(TestLine.X_AXIS);
// assert
- Assert.assertEquals(SplitLocation.BOTH, split.getLocation());
+ Assertions.assertEquals(SplitLocation.BOTH, split.getLocation());
final TestRegionBSPTree minus = split.getMinus();
PartitionTestUtils.assertPointLocations(minus, RegionLocation.INSIDE,
@@ -1429,7 +1429,7 @@ public class AbstractRegionBSPTreeTest {
final Split<TestRegionBSPTree> split = tree.split(splitter);
// assert
- Assert.assertEquals(SplitLocation.BOTH, split.getLocation());
+ Assertions.assertEquals(SplitLocation.BOTH, split.getLocation());
final TestRegionBSPTree minus = split.getMinus();
PartitionTestUtils.assertPointLocations(minus, RegionLocation.INSIDE, new TestPoint2D(-1, 1));
@@ -1453,7 +1453,7 @@ public class AbstractRegionBSPTreeTest {
final Split<TestRegionBSPTree> split = tree.split(splitter);
// assert
- Assert.assertEquals(SplitLocation.BOTH, split.getLocation());
+ Assertions.assertEquals(SplitLocation.BOTH, split.getLocation());
final TestRegionBSPTree minus = split.getMinus();
PartitionTestUtils.assertPointLocations(minus, RegionLocation.INSIDE, new TestPoint2D(0.25, 0.25));
@@ -1481,7 +1481,7 @@ public class AbstractRegionBSPTreeTest {
final Split<TestRegionBSPTree> split = tree.split(splitter);
// assert
- Assert.assertEquals(SplitLocation.MINUS, split.getLocation());
+ Assertions.assertEquals(SplitLocation.MINUS, split.getLocation());
final TestRegionBSPTree minus = split.getMinus();
PartitionTestUtils.assertPointLocations(minus, RegionLocation.INSIDE, new TestPoint2D(0.5, 0.5));
@@ -1489,7 +1489,7 @@ public class AbstractRegionBSPTreeTest {
new TestPoint2D(0.5, 0), new TestPoint2D(0, 0.5),
new TestPoint2D(1, 0.5), new TestPoint2D(0.5, 1));
- Assert.assertNull(split.getPlus());
+ Assertions.assertNull(split.getPlus());
}
@Test
@@ -1503,9 +1503,9 @@ public class AbstractRegionBSPTreeTest {
final Split<TestRegionBSPTree> split = tree.split(splitter);
// assert
- Assert.assertEquals(SplitLocation.PLUS, split.getLocation());
+ Assertions.assertEquals(SplitLocation.PLUS, split.getLocation());
- Assert.assertNull(split.getMinus());
+ Assertions.assertNull(split.getMinus());
final TestRegionBSPTree plus = split.getPlus();
PartitionTestUtils.assertPointLocations(plus, RegionLocation.INSIDE, new TestPoint2D(0.5, 0.5));
@@ -1523,8 +1523,8 @@ public class AbstractRegionBSPTreeTest {
final String str = tree.toString();
// assert
- Assert.assertEquals("TestRegionBSPTree[count= 3, height= 1]", str);
- Assert.assertTrue(tree.getRoot().toString().contains("TestRegionNode"));
+ Assertions.assertEquals("TestRegionBSPTree[count= 3, height= 1]", str);
+ Assertions.assertTrue(tree.getRoot().toString().contains("TestRegionNode"));
}
private static void insertBox(final TestRegionBSPTree tree, final TestPoint2D upperLeft,
@@ -1553,9 +1553,9 @@ public class AbstractRegionBSPTreeTest {
private static void assertCutBoundarySegment(final List<HyperplaneConvexSubset<TestPoint2D>> boundaries,
final TestPoint2D start, final TestPoint2D end) {
- Assert.assertFalse("Expected boundary to not be empty", boundaries.isEmpty());
+ Assertions.assertFalse(boundaries.isEmpty(), "Expected boundary to not be empty");
- Assert.assertEquals(1, boundaries.size());
+ Assertions.assertEquals(1, boundaries.size());
final TestLineSegment segment = (TestLineSegment) boundaries.get(0);
PartitionTestUtils.assertPointsEqual(start, segment.getStartPoint());
@@ -1578,7 +1578,7 @@ public class AbstractRegionBSPTreeTest {
}
}
- Assert.assertTrue("Expected to find segment start= " + start + ", end= " + end, found);
+ Assertions.assertTrue(found, "Expected to find segment start= " + start + ", end= " + end);
}
private static TestRegionBSPTree emptyTree() {
diff --git a/commons-geometry-core/src/test/java/org/apache/commons/geometry/core/partitioning/bsp/BSPTreeVisitorTest.java b/commons-geometry-core/src/test/java/org/apache/commons/geometry/core/partitioning/bsp/BSPTreeVisitorTest.java
index 413297b..d00fd24 100644
--- a/commons-geometry-core/src/test/java/org/apache/commons/geometry/core/partitioning/bsp/BSPTreeVisitorTest.java
+++ b/commons-geometry-core/src/test/java/org/apache/commons/geometry/core/partitioning/bsp/BSPTreeVisitorTest.java
@@ -22,8 +22,8 @@ import org.apache.commons.geometry.core.partitioning.test.TestBSPTree;
import org.apache.commons.geometry.core.partitioning.test.TestBSPTree.TestNode;
import org.apache.commons.geometry.core.partitioning.test.TestLine;
import org.apache.commons.geometry.core.partitioning.test.TestPoint2D;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
public class BSPTreeVisitorTest {
@@ -33,7 +33,7 @@ public class BSPTreeVisitorTest {
final BSPTreeVisitor<TestPoint2D, TestNode> visitor = n -> BSPTreeVisitor.Result.CONTINUE;
// act/assert
- Assert.assertEquals(BSPTreeVisitor.Order.NODE_MINUS_PLUS, visitor.visitOrder(null));
+ Assertions.assertEquals(BSPTreeVisitor.Order.NODE_MINUS_PLUS, visitor.visitOrder(null));
}
@Test
@@ -101,15 +101,15 @@ public class BSPTreeVisitorTest {
private static void checkClosestFirst(final TestPoint2D target, final TestNode node, final BSPTreeVisitor.Order order) {
final ClosestFirstStubVisitor visitor = new ClosestFirstStubVisitor(target);
- Assert.assertSame(target, visitor.getTarget());
- Assert.assertEquals(order, visitor.visitOrder(node));
+ Assertions.assertSame(target, visitor.getTarget());
+ Assertions.assertEquals(order, visitor.visitOrder(node));
}
private static void checkFarthestFirst(final TestPoint2D target, final TestNode node, final BSPTreeVisitor.Order order) {
final FarthestFirstStubVisitor visitor = new FarthestFirstStubVisitor(target);
- Assert.assertSame(target, visitor.getTarget());
- Assert.assertEquals(order, visitor.visitOrder(node));
+ Assertions.assertSame(target, visitor.getTarget());
+ Assertions.assertEquals(order, visitor.visitOrder(node));
}
private static class ClosestFirstStubVisitor extends ClosestFirstVisitor<TestPoint2D, TestNode> {
diff --git a/commons-geometry-core/src/test/java/org/apache/commons/geometry/core/partitioning/bsp/MergeChecker.java b/commons-geometry-core/src/test/java/org/apache/commons/geometry/core/partitioning/bsp/MergeChecker.java
index 13ff2c8..a7b79c1 100644
--- a/commons-geometry-core/src/test/java/org/apache/commons/geometry/core/partitioning/bsp/MergeChecker.java
+++ b/commons-geometry-core/src/test/java/org/apache/commons/geometry/core/partitioning/bsp/MergeChecker.java
@@ -26,7 +26,7 @@ import org.apache.commons.geometry.core.RegionLocation;
import org.apache.commons.geometry.core.partitioning.test.PartitionTestUtils;
import org.apache.commons.geometry.core.partitioning.test.TestPoint2D;
import org.apache.commons.geometry.core.partitioning.test.TestRegionBSPTree;
-import org.junit.Assert;
+import org.junit.jupiter.api.Assertions;
/** Helper class with a fluent API used to construct assert conditions on tree merge operations.
*/
@@ -193,26 +193,26 @@ class MergeChecker {
PartitionTestUtils.assertTreeStructure(result);
// check full/empty status
- Assert.assertEquals("Unexpected tree 'full' property", expectedFull, result.isFull());
- Assert.assertEquals("Unexpected tree 'empty' property", expectedEmpty, result.isEmpty());
+ Assertions.assertEquals(expectedFull, result.isFull(), "Unexpected tree 'full' property");
+ Assertions.assertEquals(expectedEmpty, result.isEmpty(), "Unexpected tree 'empty' property");
// check the node count
if (expectedCount > -1) {
- Assert.assertEquals("Unexpected node count", expectedCount, result.count());
+ Assertions.assertEquals(expectedCount, result.count(), "Unexpected node count");
}
// check in place or not
if (inPlace) {
- Assert.assertSame("Expected merge operation to be in place", tree1, result);
+ Assertions.assertSame(tree1, result, "Expected merge operation to be in place");
} else {
- Assert.assertNotSame("Expected merge operation to return a new instance", tree1, result);
+ Assertions.assertNotSame(tree1, result, "Expected merge operation to return a new instance");
// make sure that tree1 wasn't modified
- Assert.assertEquals("Tree 1 node count should not have changed", tree1BeforeCount, tree1.count());
+ Assertions.assertEquals(tree1BeforeCount, tree1.count(), "Tree 1 node count should not have changed");
}
// make sure that tree2 wasn't modified
- Assert.assertEquals("Tree 2 node count should not have changed", tree2BeforeCount, tree2.count());
+ Assertions.assertEquals(tree2BeforeCount, tree2.count(), "Tree 2 node count should not have changed");
// check region point locations
PartitionTestUtils.assertPointLocations(result, RegionLocation.INSIDE, insidePoints);
diff --git a/commons-geometry-core/src/test/java/org/apache/commons/geometry/core/partitioning/bsp/RegionCutBoundaryTest.java b/commons-geometry-core/src/test/java/org/apache/commons/geometry/core/partitioning/bsp/RegionCutBoundaryTest.java
index 3a213e1..f6ddd34 100644
--- a/commons-geometry-core/src/test/java/org/apache/commons/geometry/core/partitioning/bsp/RegionCutBoundaryTest.java
+++ b/commons-geometry-core/src/test/java/org/apache/commons/geometry/core/partitioning/bsp/RegionCutBoundaryTest.java
@@ -27,8 +27,8 @@ import org.apache.commons.geometry.core.partitioning.test.PartitionTestUtils;
import org.apache.commons.geometry.core.partitioning.test.TestLine;
import org.apache.commons.geometry.core.partitioning.test.TestLineSegment;
import org.apache.commons.geometry.core.partitioning.test.TestPoint2D;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
public class RegionCutBoundaryTest {
@@ -46,11 +46,11 @@ public class RegionCutBoundaryTest {
final RegionCutBoundary<TestPoint2D> boundary = new RegionCutBoundary<>(insideFacing, outsideFacing);
// assert
- Assert.assertNotSame(insideFacing, boundary.getInsideFacing());
- Assert.assertEquals(insideFacing, boundary.getInsideFacing());
+ Assertions.assertNotSame(insideFacing, boundary.getInsideFacing());
+ Assertions.assertEquals(insideFacing, boundary.getInsideFacing());
- Assert.assertNotSame(outsideFacing, boundary.getOutsideFacing());
- Assert.assertEquals(outsideFacing, boundary.getOutsideFacing());
+ Assertions.assertNotSame(outsideFacing, boundary.getOutsideFacing());
+ Assertions.assertEquals(outsideFacing, boundary.getOutsideFacing());
}
@Test
@@ -59,8 +59,8 @@ public class RegionCutBoundaryTest {
final RegionCutBoundary<TestPoint2D> boundary = new RegionCutBoundary<>(null, null);
// assert
- Assert.assertEquals(0, boundary.getInsideFacing().size());
- Assert.assertEquals(0, boundary.getOutsideFacing().size());
+ Assertions.assertEquals(0, boundary.getInsideFacing().size());
+ Assertions.assertEquals(0, boundary.getOutsideFacing().size());
}
@Test
@@ -69,7 +69,7 @@ public class RegionCutBoundaryTest {
final RegionCutBoundary<TestPoint2D> boundary = new RegionCutBoundary<>(null, null);
// assert
- Assert.assertEquals(0, boundary.getSize(), TEST_EPS);
+ Assertions.assertEquals(0, boundary.getSize(), TEST_EPS);
}
@Test
@@ -93,7 +93,7 @@ public class RegionCutBoundaryTest {
Collections.singletonList(new TestLineSegment(-3, -1, line)));
// assert
- Assert.assertEquals(4, boundary.getSize(), TEST_EPS);
+ Assertions.assertEquals(4, boundary.getSize(), TEST_EPS);
}
@Test
@@ -159,8 +159,8 @@ public class RegionCutBoundaryTest {
final RegionCutBoundary<TestPoint2D> boundary = new RegionCutBoundary<>(null, null);
// act/assert
- Assert.assertNull(boundary.closest(TestPoint2D.ZERO));
- Assert.assertNull(boundary.closest(new TestPoint2D(1, 1)));
+ Assertions.assertNull(boundary.closest(TestPoint2D.ZERO));
+ Assertions.assertNull(boundary.closest(new TestPoint2D(1, 1)));
}
@Test
@@ -177,19 +177,19 @@ public class RegionCutBoundaryTest {
Collections.singletonList(outsideFacing));
// act/assert
- Assert.assertFalse(boundary.contains(new TestPoint2D(-2, 0)));
+ Assertions.assertFalse(boundary.contains(new TestPoint2D(-2, 0)));
- Assert.assertTrue(boundary.contains(new TestPoint2D(-1, 0)));
- Assert.assertTrue(boundary.contains(new TestPoint2D(-0.5, 0)));
- Assert.assertTrue(boundary.contains(new TestPoint2D(0, 0)));
- Assert.assertTrue(boundary.contains(new TestPoint2D(0.5, 0)));
- Assert.assertTrue(boundary.contains(new TestPoint2D(1, 0)));
+ Assertions.assertTrue(boundary.contains(new TestPoint2D(-1, 0)));
+ Assertions.assertTrue(boundary.contains(new TestPoint2D(-0.5, 0)));
+ Assertions.assertTrue(boundary.contains(new TestPoint2D(0, 0)));
+ Assertions.assertTrue(boundary.contains(new TestPoint2D(0.5, 0)));
+ Assertions.assertTrue(boundary.contains(new TestPoint2D(1, 0)));
- Assert.assertFalse(boundary.contains(new TestPoint2D(2, 0)));
+ Assertions.assertFalse(boundary.contains(new TestPoint2D(2, 0)));
- Assert.assertFalse(boundary.contains(new TestPoint2D(-1, 1)));
- Assert.assertFalse(boundary.contains(new TestPoint2D(0, -1)));
- Assert.assertFalse(boundary.contains(new TestPoint2D(1, 1)));
+ Assertions.assertFalse(boundary.contains(new TestPoint2D(-1, 1)));
+ Assertions.assertFalse(boundary.contains(new TestPoint2D(0, -1)));
+ Assertions.assertFalse(boundary.contains(new TestPoint2D(1, 1)));
}
@Test
@@ -198,8 +198,8 @@ public class RegionCutBoundaryTest {
final RegionCutBoundary<TestPoint2D> boundary = new RegionCutBoundary<>(null, null);
// act/assert
- Assert.assertFalse(boundary.contains(new TestPoint2D(-1, 0)));
- Assert.assertFalse(boundary.contains(new TestPoint2D(0, 0)));
- Assert.assertFalse(boundary.contains(new TestPoint2D(1, 0)));
+ Assertions.assertFalse(boundary.contains(new TestPoint2D(-1, 0)));
+ Assertions.assertFalse(boundary.contains(new TestPoint2D(0, 0)));
+ Assertions.assertFalse(boundary.contains(new TestPoint2D(1, 0)));
}
}
diff --git a/commons-geometry-core/src/test/java/org/apache/commons/geometry/core/partitioning/test/PartitionTestUtils.java b/commons-geometry-core/src/test/java/org/apache/commons/geometry/core/partitioning/test/PartitionTestUtils.java
index 127ba59..81c1deb 100644
--- a/commons-geometry-core/src/test/java/org/apache/commons/geometry/core/partitioning/test/PartitionTestUtils.java
+++ b/commons-geometry-core/src/test/java/org/apache/commons/geometry/core/partitioning/test/PartitionTestUtils.java
@@ -26,7 +26,7 @@ import org.apache.commons.geometry.core.partitioning.bsp.BSPTree;
import org.apache.commons.geometry.core.partitioning.bsp.BSPTree.Node;
import org.apache.commons.geometry.core.precision.DoublePrecisionContext;
import org.apache.commons.geometry.core.precision.EpsilonDoublePrecisionContext;
-import org.junit.Assert;
+import org.junit.jupiter.api.Assertions;
/** Class containing utility methods for tests related to the
* partition package.
@@ -48,8 +48,8 @@ public final class PartitionTestUtils {
*/
public static void assertPointsEqual(final TestPoint2D expected, final TestPoint2D actual) {
final String msg = "Expected points to equal " + expected + " but was " + actual + ";";
- Assert.assertEquals(msg, expected.getX(), actual.getX(), EPS);
- Assert.assertEquals(msg, expected.getY(), actual.getY(), EPS);
+ Assertions.assertEquals(expected.getX(), actual.getX(), EPS, msg);
+ Assertions.assertEquals(expected.getY(), actual.getY(), EPS, msg);
}
/** Assert that two line segments are equal using the default test epsilon.
@@ -59,15 +59,15 @@ public final class PartitionTestUtils {
public static void assertSegmentsEqual(final TestLineSegment expected, final TestLineSegment actual) {
final String msg = "Expected line segment to equal " + expected + " but was " + actual;
- Assert.assertEquals(msg, expected.getStartPoint().getX(),
- actual.getStartPoint().getX(), EPS);
- Assert.assertEquals(msg, expected.getStartPoint().getY(),
- actual.getStartPoint().getY(), EPS);
+ Assertions.assertEquals(expected.getStartPoint().getX(),
+ actual.getStartPoint().getX(), EPS, msg);
+ Assertions.assertEquals(expected.getStartPoint().getY(),
+ actual.getStartPoint().getY(), EPS, msg);
- Assert.assertEquals(msg, expected.getEndPoint().getX(),
- actual.getEndPoint().getX(), EPS);
- Assert.assertEquals(msg, expected.getEndPoint().getY(),
- actual.getEndPoint().getY(), EPS);
+ Assertions.assertEquals(expected.getEndPoint().getX(),
+ actual.getEndPoint().getX(), EPS, msg);
+ Assertions.assertEquals(expected.getEndPoint().getY(),
+ actual.getEndPoint().getY(), EPS, msg);
}
/** Assert that all given points lie in the expected location of the region.
@@ -89,7 +89,7 @@ public final class PartitionTestUtils {
final List<TestPoint2D> points) {
for (final TestPoint2D p : points) {
- Assert.assertEquals("Unexpected location for point " + p, location, region.classify(p));
+ Assertions.assertEquals(location, region.classify(p), "Unexpected location for point " + p);
}
}
@@ -97,24 +97,24 @@ public final class PartitionTestUtils {
* @param node
*/
public static void assertIsInternalNode(final Node<?, ?> node) {
- Assert.assertNotNull(node.getCut());
- Assert.assertNotNull(node.getMinus());
- Assert.assertNotNull(node.getPlus());
+ Assertions.assertNotNull(node.getCut());
+ Assertions.assertNotNull(node.getMinus());
+ Assertions.assertNotNull(node.getPlus());
- Assert.assertTrue(node.isInternal());
- Assert.assertFalse(node.isLeaf());
+ Assertions.assertTrue(node.isInternal());
+ Assertions.assertFalse(node.isLeaf());
}
/** Assert that the given node is a consistent leaf node.
* @param node
*/
public static void assertIsLeafNode(final Node<?, ?> node) {
- Assert.assertNull(node.getCut());
- Assert.assertNull(node.getMinus());
- Assert.assertNull(node.getPlus());
+ Assertions.assertNull(node.getCut());
+ Assertions.assertNull(node.getMinus());
+ Assertions.assertNull(node.getPlus());
- Assert.assertFalse(node.isInternal());
- Assert.assertTrue(node.isLeaf());
+ Assertions.assertFalse(node.isInternal());
+ Assertions.assertTrue(node.isLeaf());
}
/** Assert that the given tree for has a valid, consistent internal structure. This checks that all nodes
@@ -134,19 +134,19 @@ public final class PartitionTestUtils {
private static <P extends Point<P>, N extends BSPTree.Node<P, N>> void assertTreeStructureRecursive(
final BSPTree<P, N> tree, final BSPTree.Node<P, N> node, final int expectedDepth) {
- Assert.assertSame("Node has an incorrect owning tree", tree, node.getTree());
- Assert.assertEquals("Node has an incorrect depth property", node.depth(), expectedDepth);
+ Assertions.assertSame(tree, node.getTree(), "Node has an incorrect owning tree");
+ Assertions.assertEquals(node.depth(), expectedDepth, "Node has an incorrect depth property");
if (node.getCut() == null) {
final String msg = "Node without cut cannot have children";
- Assert.assertNull(msg, node.getMinus());
- Assert.assertNull(msg, node.getPlus());
+ Assertions.assertNull(node.getMinus(), msg);
+ Assertions.assertNull(node.getPlus(), msg);
} else {
final String msg = "Node with cut must have children";
- Assert.assertNotNull(msg, node.getMinus());
- Assert.assertNotNull(msg, node.getPlus());
+ Assertions.assertNotNull(node.getMinus(), msg);
+ Assertions.assertNotNull(node.getPlus(), msg);
assertTreeStructureRecursive(tree, node.getPlus(), expectedDepth + 1);
assertTreeStructureRecursive(tree, node.getMinus(), expectedDepth + 1);
diff --git a/commons-geometry-core/src/test/java/org/apache/commons/geometry/core/precision/DoublePrecisionContextTest.java b/commons-geometry-core/src/test/java/org/apache/commons/geometry/core/precision/DoublePrecisionContextTest.java
index e3a5c82..5eacd30 100644
--- a/commons-geometry-core/src/test/java/org/apache/commons/geometry/core/precision/DoublePrecisionContextTest.java
+++ b/commons-geometry-core/src/test/java/org/apache/commons/geometry/core/precision/DoublePrecisionContextTest.java
@@ -16,8 +16,8 @@
*/
package org.apache.commons.geometry.core.precision;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
public class DoublePrecisionContextTest {
@@ -26,107 +26,107 @@ public class DoublePrecisionContextTest {
@Test
public void testEq() {
// act/assert
- Assert.assertTrue(ctx.eq(0.0, 0.0));
- Assert.assertTrue(ctx.eq(1.0, 1.0));
- Assert.assertTrue(ctx.eq(-1.0, -1.0));
+ Assertions.assertTrue(ctx.eq(0.0, 0.0));
+ Assertions.assertTrue(ctx.eq(1.0, 1.0));
+ Assertions.assertTrue(ctx.eq(-1.0, -1.0));
- Assert.assertFalse(ctx.eq(1.0, -1.0));
- Assert.assertFalse(ctx.eq(1.0, Math.nextUp(1.0)));
- Assert.assertFalse(ctx.eq(-1.0, Math.nextDown(1.0)));
+ Assertions.assertFalse(ctx.eq(1.0, -1.0));
+ Assertions.assertFalse(ctx.eq(1.0, Math.nextUp(1.0)));
+ Assertions.assertFalse(ctx.eq(-1.0, Math.nextDown(1.0)));
}
@Test
public void testEqZero() {
// act/assert
- Assert.assertTrue(ctx.eqZero(0.0));
+ Assertions.assertTrue(ctx.eqZero(0.0));
- Assert.assertFalse(ctx.eqZero(Math.nextUp(0.0)));
- Assert.assertFalse(ctx.eqZero(Math.nextDown(-0.0)));
+ Assertions.assertFalse(ctx.eqZero(Math.nextUp(0.0)));
+ Assertions.assertFalse(ctx.eqZero(Math.nextDown(-0.0)));
}
@Test
public void testLt() {
// act/assert
- Assert.assertTrue(ctx.lt(1, 2));
- Assert.assertTrue(ctx.lt(-2, -1));
+ Assertions.assertTrue(ctx.lt(1, 2));
+ Assertions.assertTrue(ctx.lt(-2, -1));
- Assert.assertFalse(ctx.lt(1, 1));
- Assert.assertFalse(ctx.lt(-1, -1));
- Assert.assertFalse(ctx.lt(2, 1));
- Assert.assertFalse(ctx.lt(-1, -2));
+ Assertions.assertFalse(ctx.lt(1, 1));
+ Assertions.assertFalse(ctx.lt(-1, -1));
+ Assertions.assertFalse(ctx.lt(2, 1));
+ Assertions.assertFalse(ctx.lt(-1, -2));
}
@Test
public void testLte() {
// act/assert
- Assert.assertTrue(ctx.lte(1, 2));
- Assert.assertTrue(ctx.lte(-2, -1));
- Assert.assertTrue(ctx.lte(1, 1));
- Assert.assertTrue(ctx.lte(-1, -1));
+ Assertions.assertTrue(ctx.lte(1, 2));
+ Assertions.assertTrue(ctx.lte(-2, -1));
+ Assertions.assertTrue(ctx.lte(1, 1));
+ Assertions.assertTrue(ctx.lte(-1, -1));
- Assert.assertFalse(ctx.lte(2, 1));
- Assert.assertFalse(ctx.lte(-1, -2));
+ Assertions.assertFalse(ctx.lte(2, 1));
+ Assertions.assertFalse(ctx.lte(-1, -2));
}
@Test
public void testGt() {
// act/assert
- Assert.assertTrue(ctx.gt(2, 1));
- Assert.assertTrue(ctx.gt(-1, -2));
+ Assertions.assertTrue(ctx.gt(2, 1));
+ Assertions.assertTrue(ctx.gt(-1, -2));
- Assert.assertFalse(ctx.gt(1, 1));
- Assert.assertFalse(ctx.gt(-1, -1));
- Assert.assertFalse(ctx.gt(1, 2));
- Assert.assertFalse(ctx.gt(-2, -1));
+ Assertions.assertFalse(ctx.gt(1, 1));
+ Assertions.assertFalse(ctx.gt(-1, -1));
+ Assertions.assertFalse(ctx.gt(1, 2));
+ Assertions.assertFalse(ctx.gt(-2, -1));
}
@Test
public void testGte() {
// act/assert
- Assert.assertTrue(ctx.gte(2, 1));
- Assert.assertTrue(ctx.gte(-1, -2));
- Assert.assertTrue(ctx.gte(1, 1));
- Assert.assertTrue(ctx.gte(-1, -1));
+ Assertions.assertTrue(ctx.gte(2, 1));
+ Assertions.assertTrue(ctx.gte(-1, -2));
+ Assertions.assertTrue(ctx.gte(1, 1));
+ Assertions.assertTrue(ctx.gte(-1, -1));
- Assert.assertFalse(ctx.gte(1, 2));
- Assert.assertFalse(ctx.gte(-2, -1));
+ Assertions.assertFalse(ctx.gte(1, 2));
+ Assertions.assertFalse(ctx.gte(-2, -1));
}
@Test
public void testSign() {
// act/assert
- Assert.assertEquals(0, ctx.sign(0.0));
+ Assertions.assertEquals(0, ctx.sign(0.0));
- Assert.assertEquals(1, ctx.sign(1e-3));
- Assert.assertEquals(-1, ctx.sign(-1e-3));
+ Assertions.assertEquals(1, ctx.sign(1e-3));
+ Assertions.assertEquals(-1, ctx.sign(-1e-3));
- Assert.assertEquals(1, ctx.sign(Double.NaN));
- Assert.assertEquals(1, ctx.sign(Double.POSITIVE_INFINITY));
- Assert.assertEquals(-1, ctx.sign(Double.NEGATIVE_INFINITY));
+ Assertions.assertEquals(1, ctx.sign(Double.NaN));
+ Assertions.assertEquals(1, ctx.sign(Double.POSITIVE_INFINITY));
+ Assertions.assertEquals(-1, ctx.sign(Double.NEGATIVE_INFINITY));
}
@Test
public void testCompare() {
// act/assert
- Assert.assertEquals(0, ctx.compare(1, 1));
- Assert.assertEquals(-1, ctx.compare(1, 2));
- Assert.assertEquals(1, ctx.compare(2, 1));
+ Assertions.assertEquals(0, ctx.compare(1, 1));
+ Assertions.assertEquals(-1, ctx.compare(1, 2));
+ Assertions.assertEquals(1, ctx.compare(2, 1));
- Assert.assertEquals(0, ctx.compare(-1, -1));
- Assert.assertEquals(1, ctx.compare(-1, -2));
- Assert.assertEquals(-1, ctx.compare(-2, -1));
+ Assertions.assertEquals(0, ctx.compare(-1, -1));
+ Assertions.assertEquals(1, ctx.compare(-1, -2));
+ Assertions.assertEquals(-1, ctx.compare(-2, -1));
}
@Test
public void testCompare_wrapper() {
// act/assert
- Assert.assertEquals(0, ctx.compare(Double.valueOf(1), Double.valueOf(1)));
- Assert.assertEquals(-1, ctx.compare(Double.valueOf(1), Double.valueOf(2)));
- Assert.assertEquals(1, ctx.compare(Double.valueOf(2), Double.valueOf(1)));
+ Assertions.assertEquals(0, ctx.compare(Double.valueOf(1), Double.valueOf(1)));
+ Assertions.assertEquals(-1, ctx.compare(Double.valueOf(1), Double.valueOf(2)));
+ Assertions.assertEquals(1, ctx.compare(Double.valueOf(2), Double.valueOf(1)));
- Assert.assertEquals(0, ctx.compare(Double.valueOf(-1), Double.valueOf(-1)));
- Assert.assertEquals(1, ctx.compare(Double.valueOf(-1), Double.valueOf(-2)));
- Assert.assertEquals(-1, ctx.compare(Double.valueOf(-2), Double.valueOf(-1)));
+ Assertions.assertEquals(0, ctx.compare(Double.valueOf(-1), Double.valueOf(-1)));
+ Assertions.assertEquals(1, ctx.compare(Double.valueOf(-1), Double.valueOf(-2)));
+ Assertions.assertEquals(-1, ctx.compare(Double.valueOf(-2), Double.valueOf(-1)));
}
private static class StubContext extends DoublePrecisionContext {
diff --git a/commons-geometry-core/src/test/java/org/apache/commons/geometry/core/precision/EpsilonDoublePrecisionContextTest.java b/commons-geometry-core/src/test/java/org/apache/commons/geometry/core/precision/EpsilonDoublePrecisionContextTest.java
index 6ae31b5..956c17c 100644
--- a/commons-geometry-core/src/test/java/org/apache/commons/geometry/core/precision/EpsilonDoublePrecisionContextTest.java
+++ b/commons-geometry-core/src/test/java/org/apache/commons/geometry/core/precision/EpsilonDoublePrecisionContextTest.java
@@ -17,8 +17,8 @@
package org.apache.commons.geometry.core.precision;
import org.apache.commons.geometry.core.GeometryTestUtils;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
public class EpsilonDoublePrecisionContextTest {
@@ -31,8 +31,8 @@ public class EpsilonDoublePrecisionContextTest {
final EpsilonDoublePrecisionContext ctx = new EpsilonDoublePrecisionContext(eps);
// assert
- Assert.assertEquals(eps, ctx.getEpsilon(), 0.0);
- Assert.assertEquals(eps, ctx.getMaxZero(), 0.0);
+ Assertions.assertEquals(eps, ctx.getEpsilon(), 0.0);
+ Assertions.assertEquals(eps, ctx.getMaxZero(), 0.0);
}
@Test
@@ -63,18 +63,18 @@ public class EpsilonDoublePrecisionContextTest {
final EpsilonDoublePrecisionContext ctx = new EpsilonDoublePrecisionContext(eps);
// act/assert
- Assert.assertEquals(0, ctx.sign(0.0));
- Assert.assertEquals(0, ctx.sign(-0.0));
+ Assertions.assertEquals(0, ctx.sign(0.0));
+ Assertions.assertEquals(0, ctx.sign(-0.0));
- Assert.assertEquals(0, ctx.sign(1e-2));
- Assert.assertEquals(0, ctx.sign(-1e-2));
+ Assertions.assertEquals(0, ctx.sign(1e-2));
+ Assertions.assertEquals(0, ctx.sign(-1e-2));
- Assert.assertEquals(1, ctx.sign(1e-1));
- Assert.assertEquals(-1, ctx.sign(-1e-1));
+ Assertions.assertEquals(1, ctx.sign(1e-1));
+ Assertions.assertEquals(-1, ctx.sign(-1e-1));
- Assert.assertEquals(1, ctx.sign(Double.NaN));
- Assert.assertEquals(1, ctx.sign(Double.POSITIVE_INFINITY));
- Assert.assertEquals(-1, ctx.sign(Double.NEGATIVE_INFINITY));
+ Assertions.assertEquals(1, ctx.sign(Double.NaN));
+ Assertions.assertEquals(1, ctx.sign(Double.POSITIVE_INFINITY));
+ Assertions.assertEquals(-1, ctx.sign(Double.NEGATIVE_INFINITY));
}
@Test
@@ -85,19 +85,19 @@ public class EpsilonDoublePrecisionContextTest {
final EpsilonDoublePrecisionContext ctx = new EpsilonDoublePrecisionContext(eps);
// act/assert
- Assert.assertEquals(0, ctx.compare(0.0, 0.0));
- Assert.assertEquals(0, ctx.compare(+0.0, -0.0));
- Assert.assertEquals(0, ctx.compare(eps, -0.0));
- Assert.assertEquals(0, ctx.compare(+0.0, eps));
+ Assertions.assertEquals(0, ctx.compare(0.0, 0.0));
+ Assertions.assertEquals(0, ctx.compare(+0.0, -0.0));
+ Assertions.assertEquals(0, ctx.compare(eps, -0.0));
+ Assertions.assertEquals(0, ctx.compare(+0.0, eps));
- Assert.assertEquals(0, ctx.compare(-eps, -0.0));
- Assert.assertEquals(0, ctx.compare(+0.0, -eps));
+ Assertions.assertEquals(0, ctx.compare(-eps, -0.0));
+ Assertions.assertEquals(0, ctx.compare(+0.0, -eps));
- Assert.assertEquals(-1, ctx.compare(0.0, 1.0));
- Assert.assertEquals(1, ctx.compare(1.0, 0.0));
+ Assertions.assertEquals(-1, ctx.compare(0.0, 1.0));
+ Assertions.assertEquals(1, ctx.compare(1.0, 0.0));
- Assert.assertEquals(1, ctx.compare(0.0, -1.0));
- Assert.assertEquals(-1, ctx.compare(-1.0, 0.0));
+ Assertions.assertEquals(1, ctx.compare(0.0, -1.0));
+ Assertions.assertEquals(-1, ctx.compare(-1.0, 0.0));
}
@Test
@@ -110,20 +110,20 @@ public class EpsilonDoublePrecisionContextTest {
final EpsilonDoublePrecisionContext ctx = new EpsilonDoublePrecisionContext(eps);
// act/assert
- Assert.assertEquals(0, ctx.compare(eps, 2 * eps));
- Assert.assertEquals(0, ctx.compare(-2 * eps, -eps));
+ Assertions.assertEquals(0, ctx.compare(eps, 2 * eps));
+ Assertions.assertEquals(0, ctx.compare(-2 * eps, -eps));
- Assert.assertEquals(0, ctx.compare(small, small + (0.9 * eps)));
- Assert.assertEquals(0, ctx.compare(-small - (0.9 * eps), -small));
+ Assertions.assertEquals(0, ctx.compare(small, small + (0.9 * eps)));
+ Assertions.assertEquals(0, ctx.compare(-small - (0.9 * eps), -small));
- Assert.assertEquals(0, ctx.compare(big, nextUp(big, 1)));
- Assert.assertEquals(0, ctx.compare(nextDown(-big, 1), -big));
+ Assertions.assertEquals(0, ctx.compare(big, nextUp(big, 1)));
+ Assertions.assertEquals(0, ctx.compare(nextDown(-big, 1), -big));
- Assert.assertEquals(-1, ctx.compare(small, small + (1.1 * eps)));
- Assert.assertEquals(1, ctx.compare(-small, -small - (1.1 * eps)));
+ Assertions.assertEquals(-1, ctx.compare(small, small + (1.1 * eps)));
+ Assertions.assertEquals(1, ctx.compare(-small, -small - (1.1 * eps)));
- Assert.assertEquals(-1, ctx.compare(big, nextUp(big, 2)));
- Assert.assertEquals(1, ctx.compare(-big, nextDown(-big, 2)));
+ Assertions.assertEquals(-1, ctx.compare(big, nextUp(big, 2)));
+ Assertions.assertEquals(1, ctx.compare(-big, nextDown(-big, 2)));
}
@Test
@@ -132,15 +132,15 @@ public class EpsilonDoublePrecisionContextTest {
final EpsilonDoublePrecisionContext ctx = new EpsilonDoublePrecisionContext(1e-6);
// act/assert
- Assert.assertEquals(1, ctx.compare(0, Double.NaN));
- Assert.assertEquals(1, ctx.compare(Double.NaN, 0));
- Assert.assertEquals(1, ctx.compare(Double.NaN, Double.NaN));
+ Assertions.assertEquals(1, ctx.compare(0, Double.NaN));
+ Assertions.assertEquals(1, ctx.compare(Double.NaN, 0));
+ Assertions.assertEquals(1, ctx.compare(Double.NaN, Double.NaN));
- Assert.assertEquals(1, ctx.compare(Double.POSITIVE_INFINITY, Double.NaN));
- Assert.assertEquals(1, ctx.compare(Double.NaN, Double.POSITIVE_INFINITY));
+ Assertions.assertEquals(1, ctx.compare(Double.POSITIVE_INFINITY, Double.NaN));
+ Assertions.assertEquals(1, ctx.compare(Double.NaN, Double.POSITIVE_INFINITY));
- Assert.assertEquals(1, ctx.compare(Double.NEGATIVE_INFINITY, Double.NaN));
- Assert.assertEquals(1, ctx.compare(Double.NaN, Double.NEGATIVE_INFINITY));
+ Assertions.assertEquals(1, ctx.compare(Double.NEGATIVE_INFINITY, Double.NaN));
+ Assertions.assertEquals(1, ctx.compare(Double.NaN, Double.NEGATIVE_INFINITY));
}
@Test
@@ -149,13 +149,13 @@ public class EpsilonDoublePrecisionContextTest {
final EpsilonDoublePrecisionContext ctx = new EpsilonDoublePrecisionContext(1e-6);
// act/assert
- Assert.assertEquals(-1, ctx.compare(0, Double.POSITIVE_INFINITY));
- Assert.assertEquals(1, ctx.compare(Double.POSITIVE_INFINITY, 0));
- Assert.assertEquals(0, ctx.compare(Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY));
+ Assertions.assertEquals(-1, ctx.compare(0, Double.POSITIVE_INFINITY));
+ Assertions.assertEquals(1, ctx.compare(Double.POSITIVE_INFINITY, 0));
+ Assertions.assertEquals(0, ctx.compare(Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY));
- Assert.assertEquals(1, ctx.compare(0, Double.NEGATIVE_INFINITY));
- Assert.assertEquals(-1, ctx.compare(Double.NEGATIVE_INFINITY, 0));
- Assert.assertEquals(0, ctx.compare(Double.NEGATIVE_INFINITY, Double.NEGATIVE_INFINITY));
+ Assertions.assertEquals(1, ctx.compare(0, Double.NEGATIVE_INFINITY));
+ Assertions.assertEquals(-1, ctx.compare(Double.NEGATIVE_INFINITY, 0));
+ Assertions.assertEquals(0, ctx.compare(Double.NEGATIVE_INFINITY, Double.NEGATIVE_INFINITY));
}
@Test
@@ -168,13 +168,13 @@ public class EpsilonDoublePrecisionContextTest {
final double maxZero = ctx.getMaxZero();
// act/assert
- Assert.assertTrue(ctx.eqZero(maxZero));
- Assert.assertTrue(ctx.eqZero(nextDown(maxZero, 1)));
- Assert.assertFalse(ctx.eqZero(nextUp(maxZero, 1)));
+ Assertions.assertTrue(ctx.eqZero(maxZero));
+ Assertions.assertTrue(ctx.eqZero(nextDown(maxZero, 1)));
+ Assertions.assertFalse(ctx.eqZero(nextUp(maxZero, 1)));
- Assert.assertTrue(ctx.eqZero(-maxZero));
- Assert.assertTrue(ctx.eqZero(nextUp(-maxZero, 1)));
- Assert.assertFalse(ctx.eqZero(nextDown(-maxZero, 1)));
+ Assertions.assertTrue(ctx.eqZero(-maxZero));
+ Assertions.assertTrue(ctx.eqZero(nextUp(-maxZero, 1)));
+ Assertions.assertFalse(ctx.eqZero(nextDown(-maxZero, 1)));
}
@Test
@@ -185,10 +185,10 @@ public class EpsilonDoublePrecisionContextTest {
final EpsilonDoublePrecisionContext c = new EpsilonDoublePrecisionContext(1e-6);
// act/assert
- Assert.assertEquals(a.hashCode(), a.hashCode());
- Assert.assertEquals(a.hashCode(), c.hashCode());
+ Assertions.assertEquals(a.hashCode(), a.hashCode());
+ Assertions.assertEquals(a.hashCode(), c.hashCode());
- Assert.assertNotEquals(a.hashCode(), b.hashCode());
+ Assertions.assertNotEquals(a.hashCode(), b.hashCode());
}
@Test
@@ -200,10 +200,10 @@ public class EpsilonDoublePrecisionContextTest {
// act/assert
GeometryTestUtils.assertSimpleEqualsCases(a);
- Assert.assertNotEquals(a, b);
- Assert.assertNotEquals(b, a);
+ Assertions.assertNotEquals(a, b);
+ Assertions.assertNotEquals(b, a);
- Assert.assertEquals(a, c);
+ Assertions.assertEquals(a, c);
}
@Test
@@ -215,14 +215,14 @@ public class EpsilonDoublePrecisionContextTest {
final EpsilonDoublePrecisionContext d = new EpsilonDoublePrecisionContext(-0.0);
// act/assert
- Assert.assertFalse(a.equals(b));
- Assert.assertNotEquals(a.hashCode(), b.hashCode());
+ Assertions.assertFalse(a.equals(b));
+ Assertions.assertNotEquals(a.hashCode(), b.hashCode());
- Assert.assertTrue(a.equals(c));
- Assert.assertEquals(a.hashCode(), c.hashCode());
+ Assertions.assertTrue(a.equals(c));
+ Assertions.assertEquals(a.hashCode(), c.hashCode());
- Assert.assertTrue(b.equals(d));
- Assert.assertEquals(b.hashCode(), d.hashCode());
+ Assertions.assertTrue(b.equals(d));
+ Assertions.assertEquals(b.hashCode(), d.hashCode());
}
@Test
@@ -234,8 +234,8 @@ public class EpsilonDoublePrecisionContextTest {
final String str = a.toString();
// assert
- Assert.assertTrue(str.contains("EpsilonDoublePrecisionContext"));
- Assert.assertTrue(str.contains("epsilon= 1"));
+ Assertions.assertTrue(str.contains("EpsilonDoublePrecisionContext"));
+ Assertions.assertTrue(str.contains("epsilon= 1"));
}
/**
diff --git a/commons-geometry-enclosing/pom.xml b/commons-geometry-enclosing/pom.xml
index 7deb010..503d4d4 100644
--- a/commons-geometry-enclosing/pom.xml
+++ b/commons-geometry-enclosing/pom.xml
@@ -91,6 +91,12 @@
<artifactId>commons-rng-sampling</artifactId>
<scope>test</scope>
</dependency>
+ <!-- testing -->
+ <dependency>
+ <groupId>org.junit.jupiter</groupId>
+ <artifactId>junit-jupiter</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
</project>
diff --git a/commons-geometry-enclosing/src/test/java/org/apache/commons/geometry/enclosing/DocumentationExamplesTest.java b/commons-geometry-enclosing/src/test/java/org/apache/commons/geometry/enclosing/DocumentationExamplesTest.java
index ad5d9cf..a331029 100644
--- a/commons-geometry-enclosing/src/test/java/org/apache/commons/geometry/enclosing/DocumentationExamplesTest.java
+++ b/commons-geometry-enclosing/src/test/java/org/apache/commons/geometry/enclosing/DocumentationExamplesTest.java
@@ -24,8 +24,8 @@ import org.apache.commons.geometry.core.precision.EpsilonDoublePrecisionContext;
import org.apache.commons.geometry.enclosing.euclidean.threed.WelzlEncloser3D;
import org.apache.commons.geometry.euclidean.EuclideanTestUtils;
import org.apache.commons.geometry.euclidean.threed.Vector3D;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
/** This class contains code listed as examples in the user guide and other documentation.
* If any portion of this code changes, the corresponding examples in the documentation <em>must</em> be updated.
@@ -58,8 +58,8 @@ public class DocumentationExamplesTest {
// ----------
EuclideanTestUtils.assertCoordinatesEqual(Vector3D.of(1, 0, 1), center, TEST_EPS);
- Assert.assertEquals(1.0, radius, TEST_EPS);
- Assert.assertTrue(containsCenter);
- Assert.assertFalse(containsOrigin);
+ Assertions.assertEquals(1.0, radius, TEST_EPS);
+ Assertions.assertTrue(containsCenter);
+ Assertions.assertFalse(containsOrigin);
}
}
diff --git a/commons-geometry-enclosing/src/test/java/org/apache/commons/geometry/enclosing/EnclosingBallTest.java b/commons-geometry-enclosing/src/test/java/org/apache/commons/geometry/enclosing/EnclosingBallTest.java
index da67309..303e1b8 100644
--- a/commons-geometry-enclosing/src/test/java/org/apache/commons/geometry/enclosing/EnclosingBallTest.java
+++ b/commons-geometry-enclosing/src/test/java/org/apache/commons/geometry/enclosing/EnclosingBallTest.java
@@ -24,8 +24,10 @@ import java.util.List;
import org.apache.commons.geometry.core.precision.DoublePrecisionContext;
import org.apache.commons.geometry.core.precision.EpsilonDoublePrecisionContext;
import org.apache.commons.geometry.euclidean.twod.Vector2D;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertThrows;
public class EnclosingBallTest {
@@ -42,12 +44,12 @@ public class EnclosingBallTest {
final EnclosingBall<Vector2D> ball = new EnclosingBall<>(center, radius, support);
// assert
- Assert.assertSame(center, ball.getCenter());
- Assert.assertEquals(radius, ball.getRadius(), TEST_EPS);
- Assert.assertEquals(0, ball.getSupportSize());
+ Assertions.assertSame(center, ball.getCenter());
+ Assertions.assertEquals(radius, ball.getRadius(), TEST_EPS);
+ Assertions.assertEquals(0, ball.getSupportSize());
final List<Vector2D> resultSupport = ball.getSupport();
- Assert.assertEquals(0, resultSupport.size());
+ Assertions.assertEquals(0, resultSupport.size());
}
@Test
@@ -62,16 +64,16 @@ public class EnclosingBallTest {
final EnclosingBall<Vector2D> ball = new EnclosingBall<>(center, radius, support);
// assert
- Assert.assertSame(center, ball.getCenter());
- Assert.assertEquals(radius, ball.getRadius(), TEST_EPS);
- Assert.assertEquals(3, ball.getSupportSize());
+ Assertions.assertSame(center, ball.getCenter());
+ Assertions.assertEquals(radius, ball.getRadius(), TEST_EPS);
+ Assertions.assertEquals(3, ball.getSupportSize());
final List<Vector2D> resultSupport = ball.getSupport();
- Assert.assertNotSame(support, resultSupport);
- Assert.assertEquals(support, resultSupport);
+ Assertions.assertNotSame(support, resultSupport);
+ Assertions.assertEquals(support, resultSupport);
}
- @Test(expected = UnsupportedOperationException.class)
+ @Test
public void testGetSupport_listCannotBeModified() {
// arrange
final List<Vector2D> support = new ArrayList<>(Collections.singletonList(Vector2D.ZERO));
@@ -79,7 +81,7 @@ public class EnclosingBallTest {
final EnclosingBall<Vector2D> ball = new EnclosingBall<>(Vector2D.of(1, 1), 4, support);
// act/assert
- ball.getSupport().add(Vector2D.Unit.PLUS_X);
+ assertThrows(UnsupportedOperationException.class, () -> ball.getSupport().add(Vector2D.Unit.PLUS_X));
}
@Test
@@ -90,21 +92,21 @@ public class EnclosingBallTest {
final EnclosingBall<Vector2D> ball = new EnclosingBall<>(center, radius, Collections.emptyList());
// act/assert
- Assert.assertTrue(ball.contains(center));
+ Assertions.assertTrue(ball.contains(center));
- Assert.assertTrue(ball.contains(Vector2D.of(2, 3)));
- Assert.assertTrue(ball.contains(Vector2D.of(0, 1)));
+ Assertions.assertTrue(ball.contains(Vector2D.of(2, 3)));
+ Assertions.assertTrue(ball.contains(Vector2D.of(0, 1)));
- Assert.assertTrue(ball.contains(Vector2D.of(0, 2)));
- Assert.assertTrue(ball.contains(Vector2D.of(1, 4)));
+ Assertions.assertTrue(ball.contains(Vector2D.of(0, 2)));
+ Assertions.assertTrue(ball.contains(Vector2D.of(1, 4)));
- Assert.assertFalse(ball.contains(Vector2D.of(3.00001, 2)));
- Assert.assertFalse(ball.contains(Vector2D.of(1, -1e-12)));
+ Assertions.assertFalse(ball.contains(Vector2D.of(3.00001, 2)));
+ Assertions.assertFalse(ball.contains(Vector2D.of(1, -1e-12)));
- Assert.assertFalse(ball.contains(Vector2D.of(1, 5)));
- Assert.assertFalse(ball.contains(Vector2D.of(1, -1)));
- Assert.assertFalse(ball.contains(Vector2D.of(-2, 2)));
- Assert.assertFalse(ball.contains(Vector2D.of(4, 2)));
+ Assertions.assertFalse(ball.contains(Vector2D.of(1, 5)));
+ Assertions.assertFalse(ball.contains(Vector2D.of(1, -1)));
+ Assertions.assertFalse(ball.contains(Vector2D.of(-2, 2)));
+ Assertions.assertFalse(ball.contains(Vector2D.of(4, 2)));
}
@Test
@@ -118,24 +120,24 @@ public class EnclosingBallTest {
final EnclosingBall<Vector2D> ball = new EnclosingBall<>(center, radius, Collections.emptyList());
// act/assert
- Assert.assertTrue(ball.contains(center, higherPrecision));
+ Assertions.assertTrue(ball.contains(center, higherPrecision));
- Assert.assertTrue(ball.contains(Vector2D.of(2, 3), higherPrecision));
- Assert.assertTrue(ball.contains(Vector2D.of(0, 1), higherPrecision));
+ Assertions.assertTrue(ball.contains(Vector2D.of(2, 3), higherPrecision));
+ Assertions.assertTrue(ball.contains(Vector2D.of(0, 1), higherPrecision));
- Assert.assertTrue(ball.contains(Vector2D.of(0, 2), higherPrecision));
- Assert.assertTrue(ball.contains(Vector2D.of(1, 4), higherPrecision));
+ Assertions.assertTrue(ball.contains(Vector2D.of(0, 2), higherPrecision));
+ Assertions.assertTrue(ball.contains(Vector2D.of(1, 4), higherPrecision));
- Assert.assertFalse(ball.contains(Vector2D.of(3.00001, 2), higherPrecision));
- Assert.assertTrue(ball.contains(Vector2D.of(1, -1e-12), higherPrecision));
+ Assertions.assertFalse(ball.contains(Vector2D.of(3.00001, 2), higherPrecision));
+ Assertions.assertTrue(ball.contains(Vector2D.of(1, -1e-12), higherPrecision));
- Assert.assertTrue(ball.contains(Vector2D.of(3.00001, 2), lowerPrecision));
- Assert.assertTrue(ball.contains(Vector2D.of(1, -1e-12), lowerPrecision));
+ Assertions.assertTrue(ball.contains(Vector2D.of(3.00001, 2), lowerPrecision));
+ Assertions.assertTrue(ball.contains(Vector2D.of(1, -1e-12), lowerPrecision));
- Assert.assertFalse(ball.contains(Vector2D.of(1, 5), higherPrecision));
- Assert.assertFalse(ball.contains(Vector2D.of(1, -1), higherPrecision));
- Assert.assertFalse(ball.contains(Vector2D.of(-2, 2), higherPrecision));
- Assert.assertFalse(ball.contains(Vector2D.of(4, 2), higherPrecision));
+ Assertions.assertFalse(ball.contains(Vector2D.of(1, 5), higherPrecision));
+ Assertions.assertFalse(ball.contains(Vector2D.of(1, -1), higherPrecision));
+ Assertions.assertFalse(ball.contains(Vector2D.of(-2, 2), higherPrecision));
+ Assertions.assertFalse(ball.contains(Vector2D.of(4, 2), higherPrecision));
}
@Test
@@ -147,7 +149,7 @@ public class EnclosingBallTest {
final String str = ball.toString();
// assert
- Assert.assertTrue(str.startsWith("EnclosingBall[center= (0"));
- Assert.assertTrue(str.contains("radius= 1"));
+ Assertions.assertTrue(str.startsWith("EnclosingBall[center= (0"));
+ Assertions.assertTrue(str.contains("radius= 1"));
}
}
diff --git a/commons-geometry-enclosing/src/test/java/org/apache/commons/geometry/enclosing/euclidean/threed/SphereGeneratorTest.java b/commons-geometry-enclosing/src/test/java/org/apache/commons/geometry/enclosing/euclidean/threed/SphereGeneratorTest.java
index 1eea47e..476715f 100644
--- a/commons-geometry-enclosing/src/test/java/org/apache/commons/geometry/enclosing/euclidean/threed/SphereGeneratorTest.java
+++ b/commons-geometry-enclosing/src/test/java/org/apache/commons/geometry/enclosing/euclidean/threed/SphereGeneratorTest.java
@@ -28,8 +28,8 @@ import org.apache.commons.geometry.euclidean.threed.Vector3D;
import org.apache.commons.rng.UniformRandomProvider;
import org.apache.commons.rng.sampling.UnitSphereSampler;
import org.apache.commons.rng.simple.RandomSource;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
public class SphereGeneratorTest {
@@ -49,9 +49,9 @@ public class SphereGeneratorTest {
final EnclosingBall<Vector3D> sphere = generator.ballOnSupport(support);
// assert
- Assert.assertTrue(sphere.getRadius() < 0);
- Assert.assertEquals(0, sphere.getSupportSize());
- Assert.assertEquals(0, sphere.getSupport().size());
+ Assertions.assertTrue(sphere.getRadius() < 0);
+ Assertions.assertEquals(0, sphere.getSupportSize());
+ Assertions.assertEquals(0, sphere.getSupport().size());
}
@Test
@@ -65,22 +65,22 @@ public class SphereGeneratorTest {
final EnclosingBall<Vector3D> sphere = generator.ballOnSupport(support);
// assert
- Assert.assertEquals(0.0, sphere.getRadius(), TEST_EPS);
+ Assertions.assertEquals(0.0, sphere.getRadius(), TEST_EPS);
- Assert.assertTrue(sphere.contains(support.get(0)));
- Assert.assertTrue(sphere.contains(support.get(0), lowPrecision));
- Assert.assertFalse(sphere.contains(Vector3D.of(support.get(0).getX() + 0.1,
+ Assertions.assertTrue(sphere.contains(support.get(0)));
+ Assertions.assertTrue(sphere.contains(support.get(0), lowPrecision));
+ Assertions.assertFalse(sphere.contains(Vector3D.of(support.get(0).getX() + 0.1,
support.get(0).getY() + 0.1,
support.get(0).getZ() + 0.1),
highPrecision));
- Assert.assertTrue(sphere.contains(Vector3D.of(support.get(0).getX() + 0.1,
+ Assertions.assertTrue(sphere.contains(Vector3D.of(support.get(0).getX() + 0.1,
support.get(0).getY() + 0.1,
support.get(0).getZ() + 0.1),
lowPrecision));
- Assert.assertEquals(0, support.get(0).distance(sphere.getCenter()), 1.0e-10);
- Assert.assertEquals(1, sphere.getSupportSize());
- Assert.assertEquals(support.get(0), sphere.getSupport().get(0));
+ Assertions.assertEquals(0, support.get(0).distance(sphere.getCenter()), 1.0e-10);
+ Assertions.assertEquals(1, sphere.getSupportSize());
+ Assertions.assertEquals(support.get(0), sphere.getSupport().get(0));
}
@Test
@@ -93,19 +93,19 @@ public class SphereGeneratorTest {
final EnclosingBall<Vector3D> sphere = generator.ballOnSupport(support);
// assert
- Assert.assertEquals(1.0, sphere.getRadius(), TEST_EPS);
+ Assertions.assertEquals(1.0, sphere.getRadius(), TEST_EPS);
int i = 0;
for (final Vector3D v : support) {
- Assert.assertTrue(sphere.contains(v));
- Assert.assertEquals(1.0, v.distance(sphere.getCenter()), TEST_EPS);
- Assert.assertSame(v, sphere.getSupport().get(i++));
+ Assertions.assertTrue(sphere.contains(v));
+ Assertions.assertEquals(1.0, v.distance(sphere.getCenter()), TEST_EPS);
+ Assertions.assertSame(v, sphere.getSupport().get(i++));
}
- Assert.assertTrue(sphere.contains(Vector3D.of(2, 0.9, 0)));
- Assert.assertFalse(sphere.contains(Vector3D.ZERO));
- Assert.assertEquals(0.0, Vector3D.of(2, 0, 0).distance(sphere.getCenter()), TEST_EPS);
- Assert.assertEquals(2, sphere.getSupportSize());
+ Assertions.assertTrue(sphere.contains(Vector3D.of(2, 0.9, 0)));
+ Assertions.assertFalse(sphere.contains(Vector3D.ZERO));
+ Assertions.assertEquals(0.0, Vector3D.of(2, 0, 0).distance(sphere.getCenter()), TEST_EPS);
+ Assertions.assertEquals(2, sphere.getSupportSize());
}
@Test
@@ -119,24 +119,24 @@ public class SphereGeneratorTest {
final EnclosingBall<Vector3D> sphere = generator.ballOnSupport(support);
// assert
- Assert.assertEquals(5.0 / 4.0, sphere.getRadius(), TEST_EPS);
+ Assertions.assertEquals(5.0 / 4.0, sphere.getRadius(), TEST_EPS);
int i = 0;
for (final Vector3D v : support) {
- Assert.assertTrue(sphere.contains(v));
- Assert.assertEquals(5.0 / 4.0, v.distance(sphere.getCenter()), TEST_EPS);
- Assert.assertEquals(v, sphere.getSupport().get(i++));
+ Assertions.assertTrue(sphere.contains(v));
+ Assertions.assertEquals(5.0 / 4.0, v.distance(sphere.getCenter()), TEST_EPS);
+ Assertions.assertEquals(v, sphere.getSupport().get(i++));
}
- Assert.assertTrue(sphere.contains(Vector3D.of(2, 0.9, 0)));
- Assert.assertFalse(sphere.contains(Vector3D.of(0.9, 0, 0)));
- Assert.assertFalse(sphere.contains(Vector3D.of(3.1, 0, 0)));
- Assert.assertTrue(sphere.contains(Vector3D.of(2.0, -0.499, 0)));
- Assert.assertFalse(sphere.contains(Vector3D.of(2.0, -0.501, 0)));
- Assert.assertTrue(sphere.contains(Vector3D.of(2.0, 3.0 / 4.0, -1.249)));
- Assert.assertFalse(sphere.contains(Vector3D.of(2.0, 3.0 / 4.0, -1.251)));
- Assert.assertEquals(0.0, Vector3D.of(2.0, 3.0 / 4.0, 0).distance(sphere.getCenter()), TEST_EPS);
- Assert.assertEquals(3, sphere.getSupportSize());
+ Assertions.assertTrue(sphere.contains(Vector3D.of(2, 0.9, 0)));
+ Assertions.assertFalse(sphere.contains(Vector3D.of(0.9, 0, 0)));
+ Assertions.assertFalse(sphere.contains(Vector3D.of(3.1, 0, 0)));
+ Assertions.assertTrue(sphere.contains(Vector3D.of(2.0, -0.499, 0)));
+ Assertions.assertFalse(sphere.contains(Vector3D.of(2.0, -0.501, 0)));
+ Assertions.assertTrue(sphere.contains(Vector3D.of(2.0, 3.0 / 4.0, -1.249)));
+ Assertions.assertFalse(sphere.contains(Vector3D.of(2.0, 3.0 / 4.0, -1.251)));
+ Assertions.assertEquals(0.0, Vector3D.of(2.0, 3.0 / 4.0, 0).distance(sphere.getCenter()), TEST_EPS);
+ Assertions.assertEquals(3, sphere.getSupportSize());
}
@Test
@@ -151,29 +151,29 @@ public class SphereGeneratorTest {
final EnclosingBall<Vector3D> sphere = generator.ballOnSupport(support);
// assert
- Assert.assertEquals(25.0, sphere.getRadius(), TEST_EPS);
+ Assertions.assertEquals(25.0, sphere.getRadius(), TEST_EPS);
int i = 0;
for (final Vector3D v : support) {
- Assert.assertTrue(sphere.contains(v));
- Assert.assertEquals(25.0, v.distance(sphere.getCenter()), 1.0e-10);
- Assert.assertEquals(v, sphere.getSupport().get(i++));
+ Assertions.assertTrue(sphere.contains(v));
+ Assertions.assertEquals(25.0, v.distance(sphere.getCenter()), 1.0e-10);
+ Assertions.assertEquals(v, sphere.getSupport().get(i++));
}
- Assert.assertTrue(sphere.contains(Vector3D.of(-22.999, 2, 2)));
- Assert.assertFalse(sphere.contains(Vector3D.of(-23.001, 2, 2)));
- Assert.assertTrue(sphere.contains(Vector3D.of(26.999, 2, 2)));
- Assert.assertFalse(sphere.contains(Vector3D.of(27.001, 2, 2)));
- Assert.assertTrue(sphere.contains(Vector3D.of(2, -22.999, 2)));
- Assert.assertFalse(sphere.contains(Vector3D.of(2, -23.001, 2)));
- Assert.assertTrue(sphere.contains(Vector3D.of(2, 26.999, 2)));
- Assert.assertFalse(sphere.contains(Vector3D.of(2, 27.001, 2)));
- Assert.assertTrue(sphere.contains(Vector3D.of(2, 2, -22.999)));
- Assert.assertFalse(sphere.contains(Vector3D.of(2, 2, -23.001)));
- Assert.assertTrue(sphere.contains(Vector3D.of(2, 2, 26.999)));
- Assert.assertFalse(sphere.contains(Vector3D.of(2, 2, 27.001)));
- Assert.assertEquals(0.0, Vector3D.of(2.0, 2.0, 2.0).distance(sphere.getCenter()), TEST_EPS);
- Assert.assertEquals(4, sphere.getSupportSize());
+ Assertions.assertTrue(sphere.contains(Vector3D.of(-22.999, 2, 2)));
+ Assertions.assertFalse(sphere.contains(Vector3D.of(-23.001, 2, 2)));
+ Assertions.assertTrue(sphere.contains(Vector3D.of(26.999, 2, 2)));
+ Assertions.assertFalse(sphere.contains(Vector3D.of(27.001, 2, 2)));
+ Assertions.assertTrue(sphere.contains(Vector3D.of(2, -22.999, 2)));
+ Assertions.assertFalse(sphere.contains(Vector3D.of(2, -23.001, 2)));
+ Assertions.assertTrue(sphere.contains(Vector3D.of(2, 26.999, 2)));
+ Assertions.assertFalse(sphere.contains(Vector3D.of(2, 27.001, 2)));
+ Assertions.assertTrue(sphere.contains(Vector3D.of(2, 2, -22.999)));
+ Assertions.assertFalse(sphere.contains(Vector3D.of(2, 2, -23.001)));
+ Assertions.assertTrue(sphere.contains(Vector3D.of(2, 2, 26.999)));
+ Assertions.assertFalse(sphere.contains(Vector3D.of(2, 2, 27.001)));
+ Assertions.assertEquals(0.0, Vector3D.of(2.0, 2.0, 2.0).distance(sphere.getCenter()), TEST_EPS);
+ Assertions.assertEquals(4, sphere.getSupportSize());
}
@Test
@@ -195,8 +195,8 @@ public class SphereGeneratorTest {
final EnclosingBall<Vector3D> sphere = generator.ballOnSupport(support);
// assert
- Assert.assertEquals(0.0, refCenter.distance(sphere.getCenter()), 4e-7 * refRadius);
- Assert.assertEquals(refRadius, sphere.getRadius(), 1e-7 * refRadius);
+ Assertions.assertEquals(0.0, refCenter.distance(sphere.getCenter()), 4e-7 * refRadius);
+ Assertions.assertEquals(refRadius, sphere.getRadius(), 1e-7 * refRadius);
}
}
@@ -226,14 +226,14 @@ public class SphereGeneratorTest {
// The results were converted to decimal representation rounded to 1.0e-30 when writing the reference
// values in this test
final double eps = 1e-20;
- Assert.assertEquals(0.003616820213530053297575846168, sphere.getRadius(), eps);
- Assert.assertEquals(-7.139325643360503322823511839511, sphere.getCenter().getX(), eps);
- Assert.assertEquals(-16.571096474251747245361467833760, sphere.getCenter().getY(), eps);
- Assert.assertEquals(11.711945804096960876521111630800, sphere.getCenter().getZ(), eps);
+ Assertions.assertEquals(0.003616820213530053297575846168, sphere.getRadius(), eps);
+ Assertions.assertEquals(-7.139325643360503322823511839511, sphere.getCenter().getX(), eps);
+ Assertions.assertEquals(-16.571096474251747245361467833760, sphere.getCenter().getY(), eps);
+ Assertions.assertEquals(11.711945804096960876521111630800, sphere.getCenter().getZ(), eps);
final DoublePrecisionContext supportPrecision = new EpsilonDoublePrecisionContext(1e-14);
for (final Vector3D v : support) {
- Assert.assertTrue(sphere.contains(v, supportPrecision));
+ Assertions.assertTrue(sphere.contains(v, supportPrecision));
}
}
}
diff --git a/commons-geometry-enclosing/src/test/java/org/apache/commons/geometry/enclosing/euclidean/threed/WelzlEncloser3DTest.java b/commons-geometry-enclosing/src/test/java/org/apache/commons/geometry/enclosing/euclidean/threed/WelzlEncloser3DTest.java
index bd33efd..25f9ca6 100644
--- a/commons-geometry-enclosing/src/test/java/org/apache/commons/geometry/enclosing/euclidean/threed/WelzlEncloser3DTest.java
+++ b/commons-geometry-enclosing/src/test/java/org/apache/commons/geometry/enclosing/euclidean/threed/WelzlEncloser3DTest.java
@@ -28,8 +28,8 @@ import org.apache.commons.geometry.euclidean.threed.Vector3D;
import org.apache.commons.rng.UniformRandomProvider;
import org.apache.commons.rng.sampling.UnitSphereSampler;
import org.apache.commons.rng.simple.RandomSource;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
public class WelzlEncloser3DTest {
@@ -75,7 +75,7 @@ public class WelzlEncloser3DTest {
final EnclosingBall<Vector3D> ball = encloser.enclose(list);
// assert
- Assert.assertTrue(ball.getRadius() > 0);
+ Assertions.assertTrue(ball.getRadius() > 0);
}
@Test
@@ -106,7 +106,7 @@ public class WelzlEncloser3DTest {
final EnclosingBall<Vector3D> ball = encloser.enclose(list);
// assert
- Assert.assertTrue(ball.getRadius() > 0);
+ Assertions.assertTrue(ball.getRadius() > 0);
}
@Test
@@ -141,7 +141,7 @@ public class WelzlEncloser3DTest {
final EnclosingBall<Vector3D> sphere = checkSphere(points);
// compare computed sphere with bounding sphere
- Assert.assertTrue(sphere.getRadius() <= refRadius);
+ Assertions.assertTrue(sphere.getRadius() <= refRadius);
// check removing any point of the support Sphere fails to enclose the point
for (int i = 0; i < sphere.getSupportSize(); ++i) {
@@ -160,7 +160,7 @@ public class WelzlEncloser3DTest {
foundOutside = true;
}
}
- Assert.assertTrue(foundOutside);
+ Assertions.assertTrue(foundOutside);
}
}
@@ -170,7 +170,7 @@ public class WelzlEncloser3DTest {
// all points are enclosed
for (final Vector3D v : points) {
- Assert.assertTrue(sphere.contains(v, TEST_PRECISION));
+ Assertions.assertTrue(sphere.contains(v, TEST_PRECISION));
}
// all support points are on the boundary
@@ -178,7 +178,7 @@ public class WelzlEncloser3DTest {
final double radius = sphere.getRadius();
for (final Vector3D s : sphere.getSupport()) {
- Assert.assertTrue(TEST_PRECISION.eqZero(center.distance(s) - radius));
+ Assertions.assertTrue(TEST_PRECISION.eqZero(center.distance(s) - radius));
}
return sphere;
diff --git a/commons-geometry-enclosing/src/test/java/org/apache/commons/geometry/enclosing/euclidean/twod/DiskGeneratorTest.java b/commons-geometry-enclosing/src/test/java/org/apache/commons/geometry/enclosing/euclidean/twod/DiskGeneratorTest.java
index eacd449..be4aabf 100644
--- a/commons-geometry-enclosing/src/test/java/org/apache/commons/geometry/enclosing/euclidean/twod/DiskGeneratorTest.java
+++ b/commons-geometry-enclosing/src/test/java/org/apache/commons/geometry/enclosing/euclidean/twod/DiskGeneratorTest.java
@@ -28,8 +28,8 @@ import org.apache.commons.geometry.euclidean.twod.Vector2D;
import org.apache.commons.rng.UniformRandomProvider;
import org.apache.commons.rng.sampling.UnitSphereSampler;
import org.apache.commons.rng.simple.RandomSource;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
public class DiskGeneratorTest {
@@ -46,9 +46,9 @@ public class DiskGeneratorTest {
final EnclosingBall<Vector2D> disk = generator.ballOnSupport(support);
// assert
- Assert.assertTrue(disk.getRadius() < 0);
- Assert.assertEquals(0, disk.getSupportSize());
- Assert.assertEquals(0, disk.getSupport().size());
+ Assertions.assertTrue(disk.getRadius() < 0);
+ Assertions.assertEquals(0, disk.getSupportSize());
+ Assertions.assertEquals(0, disk.getSupport().size());
}
@Test
@@ -62,18 +62,18 @@ public class DiskGeneratorTest {
final EnclosingBall<Vector2D> disk = generator.ballOnSupport(support);
// assert
- Assert.assertEquals(0.0, disk.getRadius(), TEST_EPS);
- Assert.assertTrue(disk.contains(support.get(0)));
- Assert.assertTrue(disk.contains(support.get(0), lowPrecision));
- Assert.assertFalse(disk.contains(Vector2D.of(support.get(0).getX() + 0.1,
+ Assertions.assertEquals(0.0, disk.getRadius(), TEST_EPS);
+ Assertions.assertTrue(disk.contains(support.get(0)));
+ Assertions.assertTrue(disk.contains(support.get(0), lowPrecision));
+ Assertions.assertFalse(disk.contains(Vector2D.of(support.get(0).getX() + 0.1,
support.get(0).getY() - 0.1),
highPrecision));
- Assert.assertTrue(disk.contains(Vector2D.of(support.get(0).getX() + 0.1,
+ Assertions.assertTrue(disk.contains(Vector2D.of(support.get(0).getX() + 0.1,
support.get(0).getY() - 0.1),
lowPrecision));
- Assert.assertEquals(0, support.get(0).distance(disk.getCenter()), TEST_EPS);
- Assert.assertEquals(1, disk.getSupportSize());
- Assert.assertEquals(support.get(0), disk.getSupport().get(0));
+ Assertions.assertEquals(0, support.get(0).distance(disk.getCenter()), TEST_EPS);
+ Assertions.assertEquals(1, disk.getSupportSize());
+ Assertions.assertEquals(support.get(0), disk.getSupport().get(0));
}
@Test
@@ -86,19 +86,19 @@ public class DiskGeneratorTest {
final EnclosingBall<Vector2D> disk = generator.ballOnSupport(support);
// assert
- Assert.assertEquals(1.0, disk.getRadius(), TEST_EPS);
+ Assertions.assertEquals(1.0, disk.getRadius(), TEST_EPS);
int i = 0;
for (final Vector2D v : support) {
- Assert.assertTrue(disk.contains(v));
- Assert.assertEquals(1.0, v.distance(disk.getCenter()), TEST_EPS);
- Assert.assertEquals(v, disk.getSupport().get(i++));
+ Assertions.assertTrue(disk.contains(v));
+ Assertions.assertEquals(1.0, v.distance(disk.getCenter()), TEST_EPS);
+ Assertions.assertEquals(v, disk.getSupport().get(i++));
}
- Assert.assertTrue(disk.contains(Vector2D.of(2, 0.9)));
- Assert.assertFalse(disk.contains(Vector2D.ZERO));
- Assert.assertEquals(0.0, Vector2D.of(2, 0).distance(disk.getCenter()), TEST_EPS);
- Assert.assertEquals(2, disk.getSupportSize());
+ Assertions.assertTrue(disk.contains(Vector2D.of(2, 0.9)));
+ Assertions.assertFalse(disk.contains(Vector2D.ZERO));
+ Assertions.assertEquals(0.0, Vector2D.of(2, 0).distance(disk.getCenter()), TEST_EPS);
+ Assertions.assertEquals(2, disk.getSupportSize());
}
@Test
@@ -112,22 +112,22 @@ public class DiskGeneratorTest {
final EnclosingBall<Vector2D> disk = generator.ballOnSupport(support);
// assert
- Assert.assertEquals(5.0 / 4.0, disk.getRadius(), TEST_EPS);
+ Assertions.assertEquals(5.0 / 4.0, disk.getRadius(), TEST_EPS);
int i = 0;
for (final Vector2D v : support) {
- Assert.assertTrue(disk.contains(v));
- Assert.assertEquals(5.0 / 4.0, v.distance(disk.getCenter()), TEST_EPS);
- Assert.assertEquals(v, disk.getSupport().get(i++));
+ Assertions.assertTrue(disk.contains(v));
+ Assertions.assertEquals(5.0 / 4.0, v.distance(disk.getCenter()), TEST_EPS);
+ Assertions.assertEquals(v, disk.getSupport().get(i++));
}
- Assert.assertTrue(disk.contains(Vector2D.of(2, 0.9)));
- Assert.assertFalse(disk.contains(Vector2D.of(0.9, 0)));
- Assert.assertFalse(disk.contains(Vector2D.of(3.1, 0)));
- Assert.assertTrue(disk.contains(Vector2D.of(2.0, -0.499)));
- Assert.assertFalse(disk.contains(Vector2D.of(2.0, -0.501)));
- Assert.assertEquals(0.0, Vector2D.of(2.0, 3.0 / 4.0).distance(disk.getCenter()), TEST_EPS);
- Assert.assertEquals(3, disk.getSupportSize());
+ Assertions.assertTrue(disk.contains(Vector2D.of(2, 0.9)));
+ Assertions.assertFalse(disk.contains(Vector2D.of(0.9, 0)));
+ Assertions.assertFalse(disk.contains(Vector2D.of(3.1, 0)));
+ Assertions.assertTrue(disk.contains(Vector2D.of(2.0, -0.499)));
+ Assertions.assertFalse(disk.contains(Vector2D.of(2.0, -0.501)));
+ Assertions.assertEquals(0.0, Vector2D.of(2.0, 3.0 / 4.0).distance(disk.getCenter()), TEST_EPS);
+ Assertions.assertEquals(3, disk.getSupportSize());
}
@Test
@@ -149,8 +149,8 @@ public class DiskGeneratorTest {
final EnclosingBall<Vector2D> disk = generator.ballOnSupport(support);
// assert
- Assert.assertEquals(0.0, refCenter.distance(disk.getCenter()), 3e-9 * refRadius);
- Assert.assertEquals(refRadius, disk.getRadius(), 7e-10 * refRadius);
+ Assertions.assertEquals(0.0, refCenter.distance(disk.getCenter()), 3e-9 * refRadius);
+ Assertions.assertEquals(refRadius, disk.getRadius(), 7e-10 * refRadius);
}
}
}
diff --git a/commons-geometry-enclosing/src/test/java/org/apache/commons/geometry/enclosing/euclidean/twod/WelzlEncloser2DTest.java b/commons-geometry-enclosing/src/test/java/org/apache/commons/geometry/enclosing/euclidean/twod/WelzlEncloser2DTest.java
index 7050649..4bccde8 100755
--- a/commons-geometry-enclosing/src/test/java/org/apache/commons/geometry/enclosing/euclidean/twod/WelzlEncloser2DTest.java
+++ b/commons-geometry-enclosing/src/test/java/org/apache/commons/geometry/enclosing/euclidean/twod/WelzlEncloser2DTest.java
@@ -28,8 +28,8 @@ import org.apache.commons.geometry.euclidean.EuclideanTestUtils;
import org.apache.commons.geometry.euclidean.twod.Vector2D;
import org.apache.commons.rng.UniformRandomProvider;
import org.apache.commons.rng.simple.RandomSource;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
public class WelzlEncloser2DTest {
@@ -134,7 +134,7 @@ public class WelzlEncloser2DTest {
final EnclosingBall<Vector2D> result = customPrecisionEncloser.enclose(points);
// assert
- Assert.assertEquals(27.099954200964234, result.getRadius(), TEST_EPS);
+ Assertions.assertEquals(27.099954200964234, result.getRadius(), TEST_EPS);
EuclideanTestUtils.assertCoordinatesEqual(Vector2D.of(296.0056977503686, 53.469890753441945),
result.getCenter(), TEST_EPS);
}
@@ -153,10 +153,10 @@ public class WelzlEncloser2DTest {
// compare computed disk with expected disk
final EnclosingBall<Vector2D> expected = new DiskGenerator().ballOnSupport(refSupport);
- Assert.assertEquals(refSupport.size(), disk.getSupportSize());
- Assert.assertEquals(expected.getRadius(), disk.getRadius(), 1.0e-10);
- Assert.assertEquals(expected.getCenter().getX(), disk.getCenter().getX(), 1.0e-10);
- Assert.assertEquals(expected.getCenter().getY(), disk.getCenter().getY(), 1.0e-10);
+ Assertions.assertEquals(refSupport.size(), disk.getSupportSize());
+ Assertions.assertEquals(expected.getRadius(), disk.getRadius(), 1.0e-10);
+ Assertions.assertEquals(expected.getCenter().getX(), disk.getCenter().getX(), 1.0e-10);
+ Assertions.assertEquals(expected.getCenter().getY(), disk.getCenter().getY(), 1.0e-10);
for (final Vector2D s : disk.getSupport()) {
boolean found = false;
@@ -166,7 +166,7 @@ public class WelzlEncloser2DTest {
break;
}
}
- Assert.assertTrue(found);
+ Assertions.assertTrue(found);
}
// check removing any point of the support disk fails to enclose the point
@@ -185,7 +185,7 @@ public class WelzlEncloser2DTest {
foundOutside = true;
}
}
- Assert.assertTrue(foundOutside);
+ Assertions.assertTrue(foundOutside);
}
}
@@ -195,7 +195,7 @@ public class WelzlEncloser2DTest {
// all points are enclosed
for (final Vector2D v : points) {
- Assert.assertTrue(disk.contains(v, TEST_PRECISION));
+ Assertions.assertTrue(disk.contains(v, TEST_PRECISION));
}
// all support points are on the boundary
@@ -203,7 +203,7 @@ public class WelzlEncloser2DTest {
final double radius = disk.getRadius();
for (final Vector2D s : disk.getSupport()) {
- Assert.assertTrue(TEST_PRECISION.eqZero(center.distance(s) - radius));
+ Assertions.assertTrue(TEST_PRECISION.eqZero(center.distance(s) - radius));
}
return disk;
diff --git a/commons-geometry-euclidean/pom.xml b/commons-geometry-euclidean/pom.xml
index fdb7966..ecf8e9f 100644
--- a/commons-geometry-euclidean/pom.xml
+++ b/commons-geometry-euclidean/pom.xml
@@ -89,6 +89,12 @@
<artifactId>commons-rng-sampling</artifactId>
<scope>test</scope>
</dependency>
+ <!-- testing -->
+ <dependency>
+ <groupId>org.junit.jupiter</groupId>
+ <artifactId>junit-jupiter</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<build>
diff --git a/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/DocumentationExamplesTest.java b/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/DocumentationExamplesTest.java
index 023cf2e..604a4cb 100644
--- a/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/DocumentationExamplesTest.java
+++ b/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/DocumentationExamplesTest.java
@@ -56,8 +56,8 @@ import org.apache.commons.geometry.euclidean.twod.Vector2D;
import org.apache.commons.geometry.euclidean.twod.path.LinePath;
import org.apache.commons.geometry.euclidean.twod.shape.Parallelogram;
import org.apache.commons.numbers.angle.PlaneAngleRadians;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
/** This class contains code listed as examples in the user guide and other documentation.
* If any portion of this code changes, the corresponding examples in the documentation <em>must</em> be updated.
@@ -89,7 +89,7 @@ public class DocumentationExamplesTest {
final TriangleMesh mesh = tree.toTriangleMesh(precision);
// -----------
- Assert.assertEquals(0.11509505362599505, size, TEST_EPS);
+ Assertions.assertEquals(0.11509505362599505, size, TEST_EPS);
EuclideanTestUtils.assertCoordinatesEqual(Vector3D.ZERO, centroid, TEST_EPS);
TestOBJWriter.write(mesh, new File("target/index-page-example.obj"));
@@ -109,11 +109,11 @@ public class DocumentationExamplesTest {
precision.compare(1.002, 1.0); // 1
// ------------------
- Assert.assertTrue(precision.eq(1.0009, 1.0));
- Assert.assertFalse(precision.eq(1.002, 1.0));
+ Assertions.assertTrue(precision.eq(1.0009, 1.0));
+ Assertions.assertFalse(precision.eq(1.002, 1.0));
- Assert.assertEquals(0, precision.compare(1.0009, 1.0));
- Assert.assertEquals(1, precision.compare(1.002, 1.0));
+ Assertions.assertEquals(0, precision.compare(1.0009, 1.0));
+ Assertions.assertEquals(1, precision.compare(1.002, 1.0));
}
@Test
@@ -132,9 +132,9 @@ public class DocumentationExamplesTest {
v1.eq(v3, precision); // true - approximately equal according to the given precision context
// ---------------------
- Assert.assertEquals(v1, v2);
- Assert.assertNotEquals(v1, v3);
- Assert.assertTrue(v1.eq(v3, precision));
+ Assertions.assertEquals(v1, v2);
+ Assertions.assertNotEquals(v1, v3);
+ Assertions.assertTrue(v1.eq(v3, precision));
}
@Test
@@ -174,9 +174,9 @@ public class DocumentationExamplesTest {
final Vector2D centroid = tree.getCentroid(); // region centroid = (0.5, 0.5)
// ---------
- Assert.assertEquals(1, size, TEST_EPS);
- Assert.assertEquals(11, count);
- Assert.assertEquals(3, height);
+ Assertions.assertEquals(1, size, TEST_EPS);
+ Assertions.assertEquals(11, count);
+ Assertions.assertEquals(3, height);
EuclideanTestUtils.assertCoordinatesEqual(Vector2D.of(0.5, 0.5), centroid, TEST_EPS);
}
@@ -202,9 +202,9 @@ public class DocumentationExamplesTest {
final Vector2D centroid = tree.getCentroid(); // region centroid = (0.5, 0.5)
// ---------
- Assert.assertEquals(1, size, TEST_EPS);
- Assert.assertEquals(9, count);
- Assert.assertEquals(4, height);
+ Assertions.assertEquals(1, size, TEST_EPS);
+ Assertions.assertEquals(9, count);
+ Assertions.assertEquals(4, height);
EuclideanTestUtils.assertCoordinatesEqual(Vector2D.of(0.5, 0.5), centroid, TEST_EPS);
}
@@ -227,14 +227,14 @@ public class DocumentationExamplesTest {
final RegionLocation halfOpenThreeLoc = halfOpen.classify(3.0); // RegionLocation.INSIDE
// --------------------
- Assert.assertFalse(closed.contains(0));
- Assert.assertFalse(halfOpen.contains(0));
+ Assertions.assertFalse(closed.contains(0));
+ Assertions.assertFalse(halfOpen.contains(0));
- Assert.assertEquals(RegionLocation.BOUNDARY, closedOneLoc);
- Assert.assertEquals(RegionLocation.BOUNDARY, halfOpenOneLoc);
+ Assertions.assertEquals(RegionLocation.BOUNDARY, closedOneLoc);
+ Assertions.assertEquals(RegionLocation.BOUNDARY, halfOpenOneLoc);
- Assert.assertEquals(RegionLocation.OUTSIDE, closedThreeLoc);
- Assert.assertEquals(RegionLocation.INSIDE, halfOpenThreeLoc);
+ Assertions.assertEquals(RegionLocation.OUTSIDE, closedThreeLoc);
+ Assertions.assertEquals(RegionLocation.INSIDE, halfOpenThreeLoc);
}
@Test
@@ -255,8 +255,8 @@ public class DocumentationExamplesTest {
final List<Interval> intervals = tree.toIntervals(); // size = 2
// ----------------------
- Assert.assertEquals(3, size, TEST_EPS);
- Assert.assertEquals(2, intervals.size());
+ Assertions.assertEquals(3, size, TEST_EPS);
+ Assertions.assertEquals(2, intervals.size());
}
@Test
@@ -274,8 +274,8 @@ public class DocumentationExamplesTest {
// ----------------------------
EuclideanTestUtils.assertCoordinatesEqual(Vector2D.of(1, 1), intersection, TEST_EPS);
- Assert.assertEquals(0.25 * Math.PI, angleAtoB, TEST_EPS);
- Assert.assertEquals(-0.25 * Math.PI, angleBtoA, TEST_EPS);
+ Assertions.assertEquals(0.25 * Math.PI, angleAtoB, TEST_EPS);
+ Assertions.assertEquals(-0.25 * Math.PI, angleBtoA, TEST_EPS);
}
@Test
@@ -295,7 +295,7 @@ public class DocumentationExamplesTest {
// ----------------------------
EuclideanTestUtils.assertCoordinatesEqual(Vector2D.of(3, 0), aIntersection, TEST_EPS);
- Assert.assertNull(bIntersection);
+ Assertions.assertNull(bIntersection);
}
@Test
@@ -332,9 +332,9 @@ public class DocumentationExamplesTest {
final List<LinePath> boundaries = tree.getBoundaryPaths(); // size = 1
// ----------------
- Assert.assertEquals(1.75, size, TEST_EPS);
+ Assertions.assertEquals(1.75, size, TEST_EPS);
EuclideanTestUtils.assertCoordinatesEqual(Vector2D.of(0.75, 0.75), centroid, TEST_EPS);
- Assert.assertEquals(1, boundaries.size());
+ Assertions.assertEquals(1, boundaries.size());
}
@Test
@@ -446,8 +446,8 @@ public class DocumentationExamplesTest {
final List<PlaneConvexSubset> minusBoundaries = minus.getBoundaries(); // size = 4
// ---------------------
- Assert.assertEquals(1.0 / 6.0, minusSize, TEST_EPS);
- Assert.assertEquals(4, minusBoundaries.size());
+ Assertions.assertEquals(1.0 / 6.0, minusSize, TEST_EPS);
+ Assertions.assertEquals(4, minusBoundaries.size());
}
@Test
@@ -470,7 +470,7 @@ public class DocumentationExamplesTest {
final Vector3D normal = pts.get(0).getNormal(); // (0.0, 0.0, -1.0)
// ----------------
- Assert.assertEquals(2, intersectionCount);
+ Assertions.assertEquals(2, intersectionCount);
EuclideanTestUtils.assertCoordinatesEqual(Vector3D.of(0.5, 0.5, 0), intersection, TEST_EPS);
EuclideanTestUtils.assertCoordinatesEqual(Vector3D.of(0, 0, -1), normal, TEST_EPS);
diff --git a/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/EuclideanTestUtils.java b/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/EuclideanTestUtils.java
index 442f755..caa2d57 100644
--- a/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/EuclideanTestUtils.java
+++ b/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/EuclideanTestUtils.java
@@ -25,7 +25,7 @@ import org.apache.commons.geometry.core.precision.DoublePrecisionContext;
import org.apache.commons.geometry.euclidean.oned.Vector1D;
import org.apache.commons.geometry.euclidean.threed.Vector3D;
import org.apache.commons.geometry.euclidean.twod.Vector2D;
-import org.junit.Assert;
+import org.junit.jupiter.api.Assertions;
/**
* Class containing various Euclidean-related test utilities.
@@ -145,7 +145,7 @@ public final class EuclideanTestUtils {
*/
public static void assertCoordinatesEqual(final Vector1D expected, final Vector1D actual, final double tolerance) {
final String msg = "Expected coordinates to equal " + expected + " but was " + actual + ";";
- Assert.assertEquals(msg, expected.getX(), actual.getX(), tolerance);
+ Assertions.assertEquals(expected.getX(), actual.getX(), tolerance, msg);
}
/**
@@ -158,8 +158,8 @@ public final class EuclideanTestUtils {
*/
public static void assertCoordinatesEqual(final Vector2D expected, final Vector2D actual, final double tolerance) {
final String msg = "Expected coordinates to equal " + expected + " but was " + actual + ";";
- Assert.assertEquals(msg, expected.getX(), actual.getX(), tolerance);
- Assert.assertEquals(msg, expected.getY(), actual.getY(), tolerance);
+ Assertions.assertEquals(expected.getX(), actual.getX(), tolerance, msg);
+ Assertions.assertEquals(expected.getY(), actual.getY(), tolerance, msg);
}
/**
@@ -172,9 +172,9 @@ public final class EuclideanTestUtils {
*/
public static void assertCoordinatesEqual(final Vector3D expected, final Vector3D actual, final double tolerance) {
final String msg = "Expected coordinates to equal " + expected + " but was " + actual + ";";
- Assert.assertEquals(msg, expected.getX(), actual.getX(), tolerance);
- Assert.assertEquals(msg, expected.getY(), actual.getY(), tolerance);
- Assert.assertEquals(msg, expected.getZ(), actual.getZ(), tolerance);
+ Assertions.assertEquals(expected.getX(), actual.getX(), tolerance, msg);
+ Assertions.assertEquals(expected.getY(), actual.getY(), tolerance, msg);
+ Assertions.assertEquals(expected.getZ(), actual.getZ(), tolerance, msg);
}
/**
@@ -184,8 +184,8 @@ public final class EuclideanTestUtils {
*/
public static void assertPositiveInfinity(final double value) {
final String msg = "Expected value to be positive infinity but was " + value;
- Assert.assertTrue(msg, Double.isInfinite(value));
- Assert.assertTrue(msg, value > 0);
+ Assertions.assertTrue(Double.isInfinite(value), msg);
+ Assertions.assertTrue(value > 0, msg);
}
/**
@@ -198,7 +198,7 @@ public final class EuclideanTestUtils {
*/
public static <V extends EuclideanVector<V>> void assertVertexLoopSequence(final List<V> expected, final List<V> actual,
final DoublePrecisionContext precision) {
- Assert.assertEquals("Vertex sequences have different sizes", expected.size(), actual.size());
+ Assertions.assertEquals(expected.size(), actual.size(), "Vertex sequences have different sizes");
if (!expected.isEmpty()) {
@@ -212,7 +212,7 @@ public final class EuclideanTestUtils {
}
if (offset < 0) {
- Assert.fail("Vertex loops do not share any points: expected " + expected + " but was " + actual);
+ Assertions.fail("Vertex loops do not share any points: expected " + expected + " but was " + actual);
}
V expectedVertex;
@@ -222,7 +222,7 @@ public final class EuclideanTestUtils {
actualVertex = actual.get((i + offset) % actual.size());
if (!expectedVertex.eq(actualVertex, precision)) {
- Assert.fail("Unexpected vertex at index " + i + ": expected " + expectedVertex +
+ Assertions.fail("Unexpected vertex at index " + i + ": expected " + expectedVertex +
" but was " + actualVertex);
}
}
@@ -236,8 +236,8 @@ public final class EuclideanTestUtils {
*/
public static void assertNegativeInfinity(final double value) {
final String msg = "Expected value to be negative infinity but was " + value;
- Assert.assertTrue(msg, Double.isInfinite(value));
- Assert.assertTrue(msg, value < 0);
+ Assertions.assertTrue(Double.isInfinite(value), msg);
+ Assertions.assertTrue(value < 0, msg);
}
/** Assert that all of the given points lie within the specified location relative to
@@ -248,7 +248,7 @@ public final class EuclideanTestUtils {
*/
public static void assertRegionLocation(final Region<Vector1D> region, final RegionLocation loc, final Vector1D... pts) {
for (final Vector1D pt : pts) {
- Assert.assertEquals("Unexpected region location for point " + pt, loc, region.classify(pt));
+ Assertions.assertEquals(loc, region.classify(pt), "Unexpected region location for point " + pt);
}
}
@@ -260,7 +260,7 @@ public final class EuclideanTestUtils {
*/
public static void assertRegionLocation(final Region<Vector2D> region, final RegionLocation loc, final Vector2D... pts) {
for (final Vector2D pt : pts) {
- Assert.assertEquals("Unexpected region location for point " + pt, loc, region.classify(pt));
+ Assertions.assertEquals(loc, region.classify(pt), "Unexpected region location for point " + pt);
}
}
@@ -272,7 +272,7 @@ public final class EuclideanTestUtils {
*/
public static void assertRegionLocation(final Region<Vector3D> region, final RegionLocation loc, final Vector3D... pts) {
for (final Vector3D pt : pts) {
- Assert.assertEquals("Unexpected region location for point " + pt, loc, region.classify(pt));
+ Assertions.assertEquals(loc, region.classify(pt), "Unexpected region location for point " + pt);
}
}
@@ -283,7 +283,7 @@ public final class EuclideanTestUtils {
*/
public static void assertRegionLocation(final HyperplaneSubset<Vector1D> sub, final RegionLocation loc, final Vector1D... pts) {
for (final Vector1D pt : pts) {
- Assert.assertEquals("Unexpected region location for point " + pt, loc, sub.classify(pt));
+ Assertions.assertEquals(loc, sub.classify(pt), "Unexpected region location for point " + pt);
}
}
@@ -294,7 +294,7 @@ public final class EuclideanTestUtils {
*/
public static void assertRegionLocation(final HyperplaneSubset<Vector2D> sub, final RegionLocation loc, final Vector2D... pts) {
for (final Vector2D pt : pts) {
- Assert.assertEquals("Unexpected region location for point " + pt, loc, sub.classify(pt));
+ Assertions.assertEquals(loc, sub.classify(pt), "Unexpected region location for point " + pt);
}
}
@@ -305,7 +305,7 @@ public final class EuclideanTestUtils {
*/
public static void assertRegionLocation(final HyperplaneSubset<Vector3D> sub, final RegionLocation loc, final Vector3D... pts) {
for (final Vector3D pt : pts) {
- Assert.assertEquals("Unexpected region location for point " + pt, loc, sub.classify(pt));
+ Assertions.assertEquals(loc, sub.classify(pt), "Unexpected region location for point " + pt);
}
}
}
diff --git a/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/internal/MatricesTest.java b/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/internal/MatricesTest.java
index 6acb10a..aaf395e 100644
--- a/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/internal/MatricesTest.java
+++ b/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/internal/MatricesTest.java
@@ -17,8 +17,8 @@
package org.apache.commons.geometry.euclidean.internal;
import org.apache.commons.geometry.core.GeometryTestUtils;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
public class MatricesTest {
@@ -27,27 +27,27 @@ public class MatricesTest {
@Test
public void testDeterminant_2x2() {
// act/assert
- Assert.assertEquals(1, Matrices.determinant(
+ Assertions.assertEquals(1, Matrices.determinant(
1, 0,
0, 1), EPS);
- Assert.assertEquals(-1, Matrices.determinant(
+ Assertions.assertEquals(-1, Matrices.determinant(
-1, 0,
0, 1), EPS);
- Assert.assertEquals(0, Matrices.determinant(
+ Assertions.assertEquals(0, Matrices.determinant(
1, 1,
1, 1), EPS);
- Assert.assertEquals(-2, Matrices.determinant(
+ Assertions.assertEquals(-2, Matrices.determinant(
1, 2,
3, 4), EPS);
- Assert.assertEquals(7, Matrices.determinant(
+ Assertions.assertEquals(7, Matrices.determinant(
-5, -4,
-2, -3), EPS);
- Assert.assertEquals(9, Matrices.determinant(
+ Assertions.assertEquals(9, Matrices.determinant(
-1, -2,
6, 3), EPS);
}
@@ -55,27 +55,27 @@ public class MatricesTest {
@Test
public void testDeterminant_3x3() {
// act/assert
- Assert.assertEquals(1, Matrices.determinant(
+ Assertions.assertEquals(1, Matrices.determinant(
1, 0, 0,
0, 1, 0,
0, 0, 1), EPS);
- Assert.assertEquals(-1, Matrices.determinant(
+ Assertions.assertEquals(-1, Matrices.determinant(
-1, 0, 0,
0, -1, 0,
0, 0, -1), EPS);
- Assert.assertEquals(0, Matrices.determinant(
+ Assertions.assertEquals(0, Matrices.determinant(
1, 2, 3,
4, 5, 6,
7, 8, 9), EPS);
- Assert.assertEquals(49, Matrices.determinant(
+ Assertions.assertEquals(49, Matrices.determinant(
2, -3, 1,
2, 0, -1,
1, 4, 5), EPS);
- Assert.assertEquals(-40, Matrices.determinant(
+ Assertions.assertEquals(-40, Matrices.determinant(
-5, 0, -1,
1, 2, -1,
-3, 4, 1
@@ -85,8 +85,8 @@ public class MatricesTest {
@Test
public void testCheckDeterminantForInverse() {
// act/assert
- Assert.assertEquals(1.0, Matrices.checkDeterminantForInverse(1.0), EPS);
- Assert.assertEquals(-1.0, Matrices.checkDeterminantForInverse(-1.0), EPS);
+ Assertions.assertEquals(1.0, Matrices.checkDeterminantForInverse(1.0), EPS);
+ Assertions.assertEquals(-1.0, Matrices.checkDeterminantForInverse(-1.0), EPS);
}
@Test
@@ -112,10 +112,10 @@ public class MatricesTest {
@Test
public void testCheckElementForInverse() {
// act/assert
- Assert.assertEquals(0.0, Matrices.checkElementForInverse(0.0), EPS);
+ Assertions.assertEquals(0.0, Matrices.checkElementForInverse(0.0), EPS);
- Assert.assertEquals(1.0, Matrices.checkElementForInverse(1.0), EPS);
- Assert.assertEquals(-1.0, Matrices.checkElementForInverse(-1.0), EPS);
+ Assertions.assertEquals(1.0, Matrices.checkElementForInverse(1.0), EPS);
+ Assertions.assertEquals(-1.0, Matrices.checkElementForInverse(-1.0), EPS);
}
@Test
diff --git a/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/internal/VectorsTest.java b/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/internal/VectorsTest.java
index eb3afbf..1f382e6 100644
--- a/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/internal/VectorsTest.java
+++ b/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/internal/VectorsTest.java
@@ -20,8 +20,8 @@ import org.apache.commons.geometry.core.GeometryTestUtils;
import org.apache.commons.geometry.euclidean.EuclideanTestUtils;
import org.apache.commons.geometry.euclidean.oned.Vector1D;
import org.apache.commons.geometry.euclidean.threed.Vector3D;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
public class VectorsTest {
@@ -30,28 +30,28 @@ public class VectorsTest {
@Test
public void testIsRealNonZero() {
// act/assert
- Assert.assertTrue(Vectors.isRealNonZero(1e-20));
- Assert.assertTrue(Vectors.isRealNonZero(1e20));
- Assert.assertTrue(Vectors.isRealNonZero(-1e-20));
- Assert.assertTrue(Vectors.isRealNonZero(-1e20));
-
- Assert.assertFalse(Vectors.isRealNonZero(0.0));
- Assert.assertFalse(Vectors.isRealNonZero(-0.0));
- Assert.assertFalse(Vectors.isRealNonZero(Double.NaN));
- Assert.assertFalse(Vectors.isRealNonZero(Double.POSITIVE_INFINITY));
- Assert.assertFalse(Vectors.isRealNonZero(Double.NEGATIVE_INFINITY));
+ Assertions.assertTrue(Vectors.isRealNonZero(1e-20));
+ Assertions.assertTrue(Vectors.isRealNonZero(1e20));
+ Assertions.assertTrue(Vectors.isRealNonZero(-1e-20));
+ Assertions.assertTrue(Vectors.isRealNonZero(-1e20));
+
+ Assertions.assertFalse(Vectors.isRealNonZero(0.0));
+ Assertions.assertFalse(Vectors.isRealNonZero(-0.0));
+ Assertions.assertFalse(Vectors.isRealNonZero(Double.NaN));
+ Assertions.assertFalse(Vectors.isRealNonZero(Double.POSITIVE_INFINITY));
+ Assertions.assertFalse(Vectors.isRealNonZero(Double.NEGATIVE_INFINITY));
}
@Test
public void testCheckedNorm_normArg() {
// act/assert
- Assert.assertEquals(1.0, Vectors.checkedNorm(1.0), EPS);
- Assert.assertEquals(23.12, Vectors.checkedNorm(23.12), EPS);
- Assert.assertEquals(2e-12, Vectors.checkedNorm(2e-12), EPS);
+ Assertions.assertEquals(1.0, Vectors.checkedNorm(1.0), EPS);
+ Assertions.assertEquals(23.12, Vectors.checkedNorm(23.12), EPS);
+ Assertions.assertEquals(2e-12, Vectors.checkedNorm(2e-12), EPS);
- Assert.assertEquals(-1.0, Vectors.checkedNorm(-1.0), EPS);
- Assert.assertEquals(-23.12, Vectors.checkedNorm(-23.12), EPS);
- Assert.assertEquals(-2e-12, Vectors.checkedNorm(-2e-12), EPS);
+ Assertions.assertEquals(-1.0, Vectors.checkedNorm(-1.0), EPS);
+ Assertions.assertEquals(-23.12, Vectors.checkedNorm(-23.12), EPS);
+ Assertions.assertEquals(-2e-12, Vectors.checkedNorm(-2e-12), EPS);
GeometryTestUtils.assertThrows(() -> Vectors.checkedNorm(0.0),
IllegalArgumentException.class, "Illegal norm: 0.0");
@@ -66,13 +66,13 @@ public class VectorsTest {
@Test
public void testCheckedNorm_vectorArg() {
// act/assert
- Assert.assertEquals(1.0, Vectors.checkedNorm(Vector1D.of(1.0)), EPS);
- Assert.assertEquals(23.12, Vectors.checkedNorm(Vector1D.of(23.12)), EPS);
- Assert.assertEquals(2e-12, Vectors.checkedNorm(Vector1D.of(2e-12)), EPS);
+ Assertions.assertEquals(1.0, Vectors.checkedNorm(Vector1D.of(1.0)), EPS);
+ Assertions.assertEquals(23.12, Vectors.checkedNorm(Vector1D.of(23.12)), EPS);
+ Assertions.assertEquals(2e-12, Vectors.checkedNorm(Vector1D.of(2e-12)), EPS);
- Assert.assertEquals(1.0, Vectors.checkedNorm(Vector1D.of(-1.0)), EPS);
- Assert.assertEquals(23.12, Vectors.checkedNorm(Vector1D.of(-23.12)), EPS);
- Assert.assertEquals(2e-12, Vectors.checkedNorm(Vector1D.of(-2e-12)), EPS);
+ Assertions.assertEquals(1.0, Vectors.checkedNorm(Vector1D.of(-1.0)), EPS);
+ Assertions.assertEquals(23.12, Vectors.checkedNorm(Vector1D.of(-23.12)), EPS);
+ Assertions.assertEquals(2e-12, Vectors.checkedNorm(Vector1D.of(-2e-12)), EPS);
GeometryTestUtils.assertThrows(() -> Vectors.checkedNorm(Vector3D.ZERO),
IllegalArgumentException.class, "Illegal norm: 0.0");
@@ -90,87 +90,87 @@ public class VectorsTest {
EuclideanTestUtils.assertCoordinatesEqual(Vector3D.Unit.PLUS_X,
Vectors.tryNormalize(Vector3D.of(2, 0, 0)), EPS);
- Assert.assertNull(Vectors.tryNormalize(Vector3D.of(0, 0, 0)));
- Assert.assertNull(Vectors.tryNormalize(Vector3D.of(-0, 0, 0)));
+ Assertions.assertNull(Vectors.tryNormalize(Vector3D.of(0, 0, 0)));
+ Assertions.assertNull(Vectors.tryNormalize(Vector3D.of(-0, 0, 0)));
- Assert.assertNull(Vectors.tryNormalize(Vector3D.of(Double.NaN, 1, 1)));
- Assert.assertNull(Vectors.tryNormalize(Vector3D.of(1, Double.POSITIVE_INFINITY, 1)));
- Assert.assertNull(Vectors.tryNormalize(Vector3D.of(1, 1, Double.NEGATIVE_INFINITY)));
+ Assertions.assertNull(Vectors.tryNormalize(Vector3D.of(Double.NaN, 1, 1)));
+ Assertions.assertNull(Vectors.tryNormalize(Vector3D.of(1, Double.POSITIVE_INFINITY, 1)));
+ Assertions.assertNull(Vectors.tryNormalize(Vector3D.of(1, 1, Double.NEGATIVE_INFINITY)));
}
@Test
public void testNorm_oneD() {
// act/assert
- Assert.assertEquals(0.0, Vectors.norm(0.0), EPS);
+ Assertions.assertEquals(0.0, Vectors.norm(0.0), EPS);
- Assert.assertEquals(2.0, Vectors.norm(-2.0), EPS);
- Assert.assertEquals(1.0, Vectors.norm(-1.0), EPS);
+ Assertions.assertEquals(2.0, Vectors.norm(-2.0), EPS);
+ Assertions.assertEquals(1.0, Vectors.norm(-1.0), EPS);
- Assert.assertEquals(1.0, Vectors.norm(1.0), EPS);
- Assert.assertEquals(2.0, Vectors.norm(2.0), EPS);
+ Assertions.assertEquals(1.0, Vectors.norm(1.0), EPS);
+ Assertions.assertEquals(2.0, Vectors.norm(2.0), EPS);
}
@Test
public void testNorm_twoD() {
// act/assert
- Assert.assertEquals(0.0, Vectors.norm(0.0, 0.0), EPS);
+ Assertions.assertEquals(0.0, Vectors.norm(0.0, 0.0), EPS);
- Assert.assertEquals(Math.sqrt(5.0), Vectors.norm(1.0, 2.0), EPS);
- Assert.assertEquals(5.0, Vectors.norm(3.0, -4.0), EPS);
- Assert.assertEquals(Math.sqrt(61.0), Vectors.norm(-5.0, 6.0), EPS);
- Assert.assertEquals(Math.sqrt(130.0), Vectors.norm(-7.0, -9.0), EPS);
+ Assertions.assertEquals(Math.sqrt(5.0), Vectors.norm(1.0, 2.0), EPS);
+ Assertions.assertEquals(5.0, Vectors.norm(3.0, -4.0), EPS);
+ Assertions.assertEquals(Math.sqrt(61.0), Vectors.norm(-5.0, 6.0), EPS);
+ Assertions.assertEquals(Math.sqrt(130.0), Vectors.norm(-7.0, -9.0), EPS);
}
@Test
public void testNorm_threeD() {
// act/assert
- Assert.assertEquals(0.0, Vectors.norm(0.0, 0.0, 0.0), EPS);
-
- Assert.assertEquals(Math.sqrt(14.0), Vectors.norm(1.0, 2.0, 3.0), EPS);
- Assert.assertEquals(Math.sqrt(77.0), Vectors.norm(4.0, 5.0, -6.0), EPS);
- Assert.assertEquals(Math.sqrt(194.0), Vectors.norm(7.0, -8.0, 9.0), EPS);
- Assert.assertEquals(Math.sqrt(365.0), Vectors.norm(10.0, -11.0, -12.0), EPS);
- Assert.assertEquals(Math.sqrt(590.0), Vectors.norm(-13.0, 14.0, 15.0), EPS);
- Assert.assertEquals(Math.sqrt(869.0), Vectors.norm(-16.0, 17.0, -18.0), EPS);
- Assert.assertEquals(Math.sqrt(1202.0), Vectors.norm(-19.0, -20.0, 21.0), EPS);
- Assert.assertEquals(Math.sqrt(1589.0), Vectors.norm(-22.0, -23.0, -24.0), EPS);
+ Assertions.assertEquals(0.0, Vectors.norm(0.0, 0.0, 0.0), EPS);
+
+ Assertions.assertEquals(Math.sqrt(14.0), Vectors.norm(1.0, 2.0, 3.0), EPS);
+ Assertions.assertEquals(Math.sqrt(77.0), Vectors.norm(4.0, 5.0, -6.0), EPS);
+ Assertions.assertEquals(Math.sqrt(194.0), Vectors.norm(7.0, -8.0, 9.0), EPS);
+ Assertions.assertEquals(Math.sqrt(365.0), Vectors.norm(10.0, -11.0, -12.0), EPS);
+ Assertions.assertEquals(Math.sqrt(590.0), Vectors.norm(-13.0, 14.0, 15.0), EPS);
+ Assertions.assertEquals(Math.sqrt(869.0), Vectors.norm(-16.0, 17.0, -18.0), EPS);
+ Assertions.assertEquals(Math.sqrt(1202.0), Vectors.norm(-19.0, -20.0, 21.0), EPS);
+ Assertions.assertEquals(Math.sqrt(1589.0), Vectors.norm(-22.0, -23.0, -24.0), EPS);
}
@Test
public void testNormSq_oneD() {
// act/assert
- Assert.assertEquals(0.0, Vectors.normSq(0.0), EPS);
+ Assertions.assertEquals(0.0, Vectors.normSq(0.0), EPS);
- Assert.assertEquals(9.0, Vectors.normSq(-3.0), EPS);
- Assert.assertEquals(1.0, Vectors.normSq(-1.0), EPS);
+ Assertions.assertEquals(9.0, Vectors.normSq(-3.0), EPS);
+ Assertions.assertEquals(1.0, Vectors.normSq(-1.0), EPS);
- Assert.assertEquals(1.0, Vectors.normSq(1.0), EPS);
- Assert.assertEquals(9.0, Vectors.normSq(3.0), EPS);
+ Assertions.assertEquals(1.0, Vectors.normSq(1.0), EPS);
+ Assertions.assertEquals(9.0, Vectors.normSq(3.0), EPS);
}
@Test
public void testNormSq_twoD() {
// act/assert
- Assert.assertEquals(0.0, Vectors.normSq(0.0, 0.0), EPS);
+ Assertions.assertEquals(0.0, Vectors.normSq(0.0, 0.0), EPS);
- Assert.assertEquals(5.0, Vectors.normSq(1.0, 2.0), EPS);
- Assert.assertEquals(25.0, Vectors.normSq(3.0, -4.0), EPS);
- Assert.assertEquals(61.0, Vectors.normSq(-5.0, 6.0), EPS);
- Assert.assertEquals(130.0, Vectors.normSq(-7.0, -9.0), EPS);
+ Assertions.assertEquals(5.0, Vectors.normSq(1.0, 2.0), EPS);
+ Assertions.assertEquals(25.0, Vectors.normSq(3.0, -4.0), EPS);
+ Assertions.assertEquals(61.0, Vectors.normSq(-5.0, 6.0), EPS);
+ Assertions.assertEquals(130.0, Vectors.normSq(-7.0, -9.0), EPS);
}
@Test
public void testNormSq_threeD() {
// act/assert
- Assert.assertEquals(0.0, Vectors.normSq(0.0, 0.0, 0.0), EPS);
-
- Assert.assertEquals(14.0, Vectors.normSq(1.0, 2.0, 3.0), EPS);
- Assert.assertEquals(77.0, Vectors.normSq(4.0, 5.0, -6.0), EPS);
- Assert.assertEquals(194.0, Vectors.normSq(7.0, -8.0, 9.0), EPS);
- Assert.assertEquals(365.0, Vectors.normSq(10.0, -11.0, -12.0), EPS);
- Assert.assertEquals(590.0, Vectors.normSq(-13.0, 14.0, 15.0), EPS);
- Assert.assertEquals(869.0, Vectors.normSq(-16.0, 17.0, -18.0), EPS);
- Assert.assertEquals(1202.0, Vectors.normSq(-19.0, -20.0, 21.0), EPS);
- Assert.assertEquals(1589.0, Vectors.normSq(-22.0, -23.0, -24.0), EPS);
+ Assertions.assertEquals(0.0, Vectors.normSq(0.0, 0.0, 0.0), EPS);
+
+ Assertions.assertEquals(14.0, Vectors.normSq(1.0, 2.0, 3.0), EPS);
+ Assertions.assertEquals(77.0, Vectors.normSq(4.0, 5.0, -6.0), EPS);
+ Assertions.assertEquals(194.0, Vectors.normSq(7.0, -8.0, 9.0), EPS);
+ Assertions.assertEquals(365.0, Vectors.normSq(10.0, -11.0, -12.0), EPS);
+ Assertions.assertEquals(590.0, Vectors.normSq(-13.0, 14.0, 15.0), EPS);
+ Assertions.assertEquals(869.0, Vectors.normSq(-16.0, 17.0, -18.0), EPS);
+ Assertions.assertEquals(1202.0, Vectors.normSq(-19.0, -20.0, 21.0), EPS);
+ Assertions.assertEquals(1589.0, Vectors.normSq(-22.0, -23.0, -24.0), EPS);
}
}
diff --git a/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/oned/AffineTransformMatrix1DTest.java b/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/oned/AffineTransformMatrix1DTest.java
index fa30e1d..68d9944 100644
--- a/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/oned/AffineTransformMatrix1DTest.java
+++ b/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/oned/AffineTransformMatrix1DTest.java
@@ -21,8 +21,8 @@ import java.util.function.UnaryOperator;
import org.apache.commons.geometry.core.GeometryTestUtils;
import org.apache.commons.geometry.euclidean.EuclideanTestUtils;
import org.apache.commons.numbers.angle.PlaneAngleRadians;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
public class AffineTransformMatrix1DTest {
@@ -34,10 +34,10 @@ public class AffineTransformMatrix1DTest {
final AffineTransformMatrix1D transform = AffineTransformMatrix1D.of(1, 2);
// assert
- Assert.assertTrue(transform.preservesOrientation());
+ Assertions.assertTrue(transform.preservesOrientation());
final double[] result = transform.toArray();
- Assert.assertArrayEquals(new double[] {1, 2}, result, 0.0);
+ Assertions.assertArrayEquals(new double[] {1, 2}, result, 0.0);
}
@Test
@@ -50,13 +50,13 @@ public class AffineTransformMatrix1DTest {
@Test
public void testFrom() {
// act/assert
- Assert.assertArrayEquals(new double[] {1, 0},
+ Assertions.assertArrayEquals(new double[] {1, 0},
AffineTransformMatrix1D.from(UnaryOperator.identity()).toArray(), EPS);
- Assert.assertArrayEquals(new double[] {1, 2},
+ Assertions.assertArrayEquals(new double[] {1, 2},
AffineTransformMatrix1D.from(v -> v.add(Vector1D.of(2))).toArray(), EPS);
- Assert.assertArrayEquals(new double[] {3, 0},
+ Assertions.assertArrayEquals(new double[] {3, 0},
AffineTransformMatrix1D.from(v -> v.multiply(3)).toArray(), EPS);
- Assert.assertArrayEquals(new double[] {3, 6},
+ Assertions.assertArrayEquals(new double[] {3, 6},
AffineTransformMatrix1D.from(v -> v.add(Vector1D.of(2)).multiply(3)).toArray(), EPS);
}
@@ -74,10 +74,10 @@ public class AffineTransformMatrix1DTest {
final AffineTransformMatrix1D transform = AffineTransformMatrix1D.identity();
// assert
- Assert.assertTrue(transform.preservesOrientation());
+ Assertions.assertTrue(transform.preservesOrientation());
final double[] expected = {1, 0};
- Assert.assertArrayEquals(expected, transform.toArray(), 0.0);
+ Assertions.assertArrayEquals(expected, transform.toArray(), 0.0);
}
@Test
@@ -86,10 +86,10 @@ public class AffineTransformMatrix1DTest {
final AffineTransformMatrix1D transform = AffineTransformMatrix1D.createTranslation(2);
// assert
- Assert.assertTrue(transform.preservesOrientation());
+ Assertions.assertTrue(transform.preservesOrientation());
final double[] expected = {1, 2};
- Assert.assertArrayEquals(expected, transform.toArray(), 0.0);
+ Assertions.assertArrayEquals(expected, transform.toArray(), 0.0);
}
@Test
@@ -98,10 +98,10 @@ public class AffineTransformMatrix1DTest {
final AffineTransformMatrix1D transform = AffineTransformMatrix1D.createTranslation(Vector1D.of(5));
// assert
- Assert.assertTrue(transform.preservesOrientation());
+ Assertions.assertTrue(transform.preservesOrientation());
final double[] expected = {1, 5};
- Assert.assertArrayEquals(expected, transform.toArray(), 0.0);
+ Assertions.assertArrayEquals(expected, transform.toArray(), 0.0);
}
@Test
@@ -113,10 +113,10 @@ public class AffineTransformMatrix1DTest {
final AffineTransformMatrix1D result = a.translate(4);
// assert
- Assert.assertTrue(result.preservesOrientation());
+ Assertions.assertTrue(result.preservesOrientation());
final double[] expected = {2, 14};
- Assert.assertArrayEquals(expected, result.toArray(), 0.0);
+ Assertions.assertArrayEquals(expected, result.toArray(), 0.0);
}
@Test
@@ -128,10 +128,10 @@ public class AffineTransformMatrix1DTest {
final AffineTransformMatrix1D result = a.translate(Vector1D.of(7));
// assert
- Assert.assertTrue(result.preservesOrientation());
+ Assertions.assertTrue(result.preservesOrientation());
final double[] expected = {2, 17};
- Assert.assertArrayEquals(expected, result.toArray(), 0.0);
+ Assertions.assertArrayEquals(expected, result.toArray(), 0.0);
}
@Test
@@ -140,10 +140,10 @@ public class AffineTransformMatrix1DTest {
final AffineTransformMatrix1D transform = AffineTransformMatrix1D.createScale(Vector1D.of(4));
// assert
- Assert.assertTrue(transform.preservesOrientation());
+ Assertions.assertTrue(transform.preservesOrientation());
final double[] expected = {4, 0};
- Assert.assertArrayEquals(expected, transform.toArray(), 0.0);
+ Assertions.assertArrayEquals(expected, transform.toArray(), 0.0);
}
@Test
@@ -152,10 +152,10 @@ public class AffineTransformMatrix1DTest {
final AffineTransformMatrix1D transform = AffineTransformMatrix1D.createScale(7);
// assert
- Assert.assertTrue(transform.preservesOrientation());
+ Assertions.assertTrue(transform.preservesOrientation());
final double[] expected = {7, 0};
- Assert.assertArrayEquals(expected, transform.toArray(), 0.0);
+ Assertions.assertArrayEquals(expected, transform.toArray(), 0.0);
}
@Test
@@ -167,10 +167,10 @@ public class AffineTransformMatrix1DTest {
final AffineTransformMatrix1D result = a.scale(4);
// assert
- Assert.assertTrue(result.preservesOrientation());
+ Assertions.assertTrue(result.preservesOrientation());
final double[] expected = {8, 40};
- Assert.assertArrayEquals(expected, result.toArray(), 0.0);
+ Assertions.assertArrayEquals(expected, result.toArray(), 0.0);
}
@Test
@@ -182,10 +182,10 @@ public class AffineTransformMatrix1DTest {
final AffineTransformMatrix1D result = a.scale(Vector1D.of(7));
// assert
- Assert.assertTrue(result.preservesOrientation());
+ Assertions.assertTrue(result.preservesOrientation());
final double[] expected = {14, 70};
- Assert.assertArrayEquals(expected, result.toArray(), 0.0);
+ Assertions.assertArrayEquals(expected, result.toArray(), 0.0);
}
@Test
@@ -435,17 +435,17 @@ public class AffineTransformMatrix1DTest {
@Test
public void testDeterminant() {
// act/assert
- Assert.assertEquals(0.0, AffineTransformMatrix1D.of(0, 1).determinant(), EPS);
- Assert.assertEquals(1.0, AffineTransformMatrix1D.of(1, 0).determinant(), EPS);
- Assert.assertEquals(-1.0, AffineTransformMatrix1D.of(-1, 2).determinant(), EPS);
+ Assertions.assertEquals(0.0, AffineTransformMatrix1D.of(0, 1).determinant(), EPS);
+ Assertions.assertEquals(1.0, AffineTransformMatrix1D.of(1, 0).determinant(), EPS);
+ Assertions.assertEquals(-1.0, AffineTransformMatrix1D.of(-1, 2).determinant(), EPS);
}
@Test
public void testPreservesOrientation() {
// act/assert
- Assert.assertFalse(AffineTransformMatrix1D.of(0, 1).preservesOrientation());
- Assert.assertTrue(AffineTransformMatrix1D.of(1, 0).preservesOrientation());
- Assert.assertFalse(AffineTransformMatrix1D.of(-1, 2).preservesOrientation());
+ Assertions.assertFalse(AffineTransformMatrix1D.of(0, 1).preservesOrientation());
+ Assertions.assertTrue(AffineTransformMatrix1D.of(1, 0).preservesOrientation());
+ Assertions.assertFalse(AffineTransformMatrix1D.of(-1, 2).preservesOrientation());
}
@Test
@@ -459,7 +459,7 @@ public class AffineTransformMatrix1DTest {
// assert
final double[] arr = result.toArray();
- Assert.assertArrayEquals(new double[] {26, 31}, arr, EPS);
+ Assertions.assertArrayEquals(new double[] {26, 31}, arr, EPS);
}
@Test
@@ -501,7 +501,7 @@ public class AffineTransformMatrix1DTest {
// assert
final double[] arr = result.toArray();
- Assert.assertArrayEquals(new double[] {26, 31}, arr, EPS);
+ Assertions.assertArrayEquals(new double[] {26, 31}, arr, EPS);
}
@Test
@@ -541,7 +541,7 @@ public class AffineTransformMatrix1DTest {
final AffineTransformMatrix1D result = mat.linear();
// assert
- Assert.assertArrayEquals(new double[] {2, 0}, result.toArray(), 0.0);
+ Assertions.assertArrayEquals(new double[] {2, 0}, result.toArray(), 0.0);
}
@Test
@@ -553,7 +553,7 @@ public class AffineTransformMatrix1DTest {
final AffineTransformMatrix1D result = mat.linearTranspose();
// assert
- Assert.assertArrayEquals(new double[] {2, 0}, result.toArray(), 0.0);
+ Assertions.assertArrayEquals(new double[] {2, 0}, result.toArray(), 0.0);
}
@Test
@@ -605,7 +605,7 @@ public class AffineTransformMatrix1DTest {
// assert
final double[] expected = {1, 0};
- Assert.assertArrayEquals(expected, inverse.toArray(), 0.0);
+ Assertions.assertArrayEquals(expected, inverse.toArray(), 0.0);
}
@Test
@@ -620,7 +620,7 @@ public class AffineTransformMatrix1DTest {
// assert
final double[] expected = {1, 0};
- Assert.assertArrayEquals(expected, result.toArray(), EPS);
+ Assertions.assertArrayEquals(expected, result.toArray(), EPS);
}
@Test
@@ -633,7 +633,7 @@ public class AffineTransformMatrix1DTest {
// assert
final double[] expected = {1, -3};
- Assert.assertArrayEquals(expected, inverse.toArray(), 0.0);
+ Assertions.assertArrayEquals(expected, inverse.toArray(), 0.0);
}
@Test
@@ -646,7 +646,7 @@ public class AffineTransformMatrix1DTest {
// assert
final double[] expected = {0.1, 0};
- Assert.assertArrayEquals(expected, inverse.toArray(), 0.0);
+ Assertions.assertArrayEquals(expected, inverse.toArray(), 0.0);
}
@Test
@@ -712,10 +712,10 @@ public class AffineTransformMatrix1DTest {
final int same = AffineTransformMatrix1D.of(1, 2).hashCode();
// assert
- Assert.assertEquals(orig, same);
+ Assertions.assertEquals(orig, same);
- Assert.assertNotEquals(orig, AffineTransformMatrix1D.of(0, 2).hashCode());
- Assert.assertNotEquals(orig, AffineTransformMatrix1D.of(1, 0).hashCode());
+ Assertions.assertNotEquals(orig, AffineTransformMatrix1D.of(0, 2).hashCode());
+ Assertions.assertNotEquals(orig, AffineTransformMatrix1D.of(1, 0).hashCode());
}
@Test
@@ -726,8 +726,8 @@ public class AffineTransformMatrix1DTest {
// act/assert
GeometryTestUtils.assertSimpleEqualsCases(a);
- Assert.assertNotEquals(a, AffineTransformMatrix1D.of(0, 2));
- Assert.assertNotEquals(a, AffineTransformMatrix1D.of(1, 0));
+ Assertions.assertNotEquals(a, AffineTransformMatrix1D.of(0, 2));
+ Assertions.assertNotEquals(a, AffineTransformMatrix1D.of(1, 0));
}
@Test
@@ -739,13 +739,13 @@ public class AffineTransformMatrix1DTest {
final AffineTransformMatrix1D d = AffineTransformMatrix1D.of(-0.0, 0.0);
// act/assert
- Assert.assertFalse(a.equals(b));
+ Assertions.assertFalse(a.equals(b));
- Assert.assertTrue(a.equals(c));
- Assert.assertEquals(a.hashCode(), c.hashCode());
+ Assertions.assertTrue(a.equals(c));
+ Assertions.assertEquals(a.hashCode(), c.hashCode());
- Assert.assertTrue(b.equals(d));
- Assert.assertEquals(b.hashCode(), d.hashCode());
+ Assertions.assertTrue(b.equals(d));
+ Assertions.assertEquals(b.hashCode(), d.hashCode());
}
@Test
@@ -757,7 +757,7 @@ public class AffineTransformMatrix1DTest {
final String result = a.toString();
// assert
- Assert.assertEquals("[ 1.0, 2.0 ]", result);
+ Assertions.assertEquals("[ 1.0, 2.0 ]", result);
}
@FunctionalInterface
diff --git a/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/oned/IntervalTest.java b/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/oned/IntervalTest.java
index dd612cc..01681ce 100644
--- a/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/oned/IntervalTest.java
+++ b/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/oned/IntervalTest.java
@@ -23,8 +23,8 @@ import org.apache.commons.geometry.core.partitioning.SplitLocation;
import org.apache.commons.geometry.core.precision.DoublePrecisionContext;
import org.apache.commons.geometry.core.precision.EpsilonDoublePrecisionContext;
import org.apache.commons.geometry.euclidean.EuclideanTestUtils;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
public class IntervalTest {
@@ -100,7 +100,7 @@ public class IntervalTest {
@Test
public void testOf_hyperplanes() {
// act/assert
- Assert.assertSame(Interval.full(), Interval.of(null, null));
+ Assertions.assertSame(Interval.full(), Interval.of(null, null));
checkInterval(Interval.of(
OrientedPoints.fromLocationAndDirection(1, true, TEST_PRECISION),
@@ -250,21 +250,21 @@ public class IntervalTest {
@Test
public void testIsInfinite() {
// act/assert
- Assert.assertFalse(Interval.of(1, 2, TEST_PRECISION).isInfinite());
+ Assertions.assertFalse(Interval.of(1, 2, TEST_PRECISION).isInfinite());
- Assert.assertTrue(Interval.of(Double.NEGATIVE_INFINITY, 2, TEST_PRECISION).isInfinite());
- Assert.assertTrue(Interval.of(2, Double.POSITIVE_INFINITY, TEST_PRECISION).isInfinite());
- Assert.assertTrue(Interval.of(Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, TEST_PRECISION).isInfinite());
+ Assertions.assertTrue(Interval.of(Double.NEGATIVE_INFINITY, 2, TEST_PRECISION).isInfinite());
+ Assertions.assertTrue(Interval.of(2, Double.POSITIVE_INFINITY, TEST_PRECISION).isInfinite());
+ Assertions.assertTrue(Interval.of(Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, TEST_PRECISION).isInfinite());
}
@Test
public void testIsFinite() {
// act/assert
- Assert.assertTrue(Interval.of(1, 2, TEST_PRECISION).isFinite());
+ Assertions.assertTrue(Interval.of(1, 2, TEST_PRECISION).isFinite());
- Assert.assertFalse(Interval.of(Double.NEGATIVE_INFINITY, 2, TEST_PRECISION).isFinite());
- Assert.assertFalse(Interval.of(2, Double.POSITIVE_INFINITY, TEST_PRECISION).isFinite());
- Assert.assertFalse(Interval.of(Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, TEST_PRECISION).isFinite());
+ Assertions.assertFalse(Interval.of(Double.NEGATIVE_INFINITY, 2, TEST_PRECISION).isFinite());
+ Assertions.assertFalse(Interval.of(2, Double.POSITIVE_INFINITY, TEST_PRECISION).isFinite());
+ Assertions.assertFalse(Interval.of(Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, TEST_PRECISION).isFinite());
}
@Test
@@ -377,38 +377,38 @@ public class IntervalTest {
@Test
public void testIsFull() {
// act/assert
- Assert.assertFalse(Interval.of(1, 1, TEST_PRECISION).isFull());
- Assert.assertFalse(Interval.of(-2, 2, TEST_PRECISION).isFull());
+ Assertions.assertFalse(Interval.of(1, 1, TEST_PRECISION).isFull());
+ Assertions.assertFalse(Interval.of(-2, 2, TEST_PRECISION).isFull());
- Assert.assertFalse(Interval.of(1, Double.POSITIVE_INFINITY, TEST_PRECISION).isFull());
- Assert.assertFalse(Interval.of(Double.NEGATIVE_INFINITY, 1, TEST_PRECISION).isFull());
+ Assertions.assertFalse(Interval.of(1, Double.POSITIVE_INFINITY, TEST_PRECISION).isFull());
+ Assertions.assertFalse(Interval.of(Double.NEGATIVE_INFINITY, 1, TEST_PRECISION).isFull());
- Assert.assertTrue(Interval.of(Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, TEST_PRECISION).isFull());
+ Assertions.assertTrue(Interval.of(Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, TEST_PRECISION).isFull());
}
@Test
public void testGetSize() {
// act/assert
- Assert.assertEquals(0, Interval.of(1, 1, TEST_PRECISION).getSize(), TEST_EPS);
+ Assertions.assertEquals(0, Interval.of(1, 1, TEST_PRECISION).getSize(), TEST_EPS);
- Assert.assertEquals(4, Interval.of(-2, 2, TEST_PRECISION).getSize(), TEST_EPS);
- Assert.assertEquals(5, Interval.of(2, -3, TEST_PRECISION).getSize(), TEST_EPS);
+ Assertions.assertEquals(4, Interval.of(-2, 2, TEST_PRECISION).getSize(), TEST_EPS);
+ Assertions.assertEquals(5, Interval.of(2, -3, TEST_PRECISION).getSize(), TEST_EPS);
- Assert.assertEquals(Double.POSITIVE_INFINITY,
+ Assertions.assertEquals(Double.POSITIVE_INFINITY,
Interval.of(1, Double.POSITIVE_INFINITY, TEST_PRECISION).getSize(), TEST_EPS);
- Assert.assertEquals(Double.POSITIVE_INFINITY,
+ Assertions.assertEquals(Double.POSITIVE_INFINITY,
Interval.of(Double.NEGATIVE_INFINITY, 1, TEST_PRECISION).getSize(), TEST_EPS);
- Assert.assertEquals(Double.POSITIVE_INFINITY,
+ Assertions.assertEquals(Double.POSITIVE_INFINITY,
Interval.of(Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, TEST_PRECISION).getSize(), TEST_EPS);
}
@Test
public void testGetBoundarySize() {
// act/assert
- Assert.assertEquals(0, Interval.of(1, 1, TEST_PRECISION).getBoundarySize(), TEST_EPS);
- Assert.assertEquals(0, Interval.of(-2, 5, TEST_PRECISION).getBoundarySize(), TEST_EPS);
- Assert.assertEquals(0, Interval.full().getBoundarySize(), TEST_EPS);
+ Assertions.assertEquals(0, Interval.of(1, 1, TEST_PRECISION).getBoundarySize(), TEST_EPS);
+ Assertions.assertEquals(0, Interval.of(-2, 5, TEST_PRECISION).getBoundarySize(), TEST_EPS);
+ Assertions.assertEquals(0, Interval.full().getBoundarySize(), TEST_EPS);
}
@Test
@@ -424,9 +424,9 @@ public class IntervalTest {
EuclideanTestUtils.assertCoordinatesEqual(Vector1D.of(-1),
Interval.of(-2, 0, TEST_PRECISION).getCentroid(), TEST_EPS);
- Assert.assertNull(Interval.of(1, Double.POSITIVE_INFINITY, TEST_PRECISION).getCentroid());
- Assert.assertNull(Interval.of(Double.NEGATIVE_INFINITY, 1, TEST_PRECISION).getCentroid());
- Assert.assertNull(Interval.of(Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, TEST_PRECISION).getCentroid());
+ Assertions.assertNull(Interval.of(1, Double.POSITIVE_INFINITY, TEST_PRECISION).getCentroid());
+ Assertions.assertNull(Interval.of(Double.NEGATIVE_INFINITY, 1, TEST_PRECISION).getCentroid());
+ Assertions.assertNull(Interval.of(Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, TEST_PRECISION).getCentroid());
}
@Test
@@ -439,7 +439,7 @@ public class IntervalTest {
final RegionBSPTree1D tree = interval.toTree();
// assert
- Assert.assertEquals(5, tree.count());
+ Assertions.assertEquals(5, tree.count());
checkClassify(tree, RegionLocation.OUTSIDE,
Double.NEGATIVE_INFINITY, -2, -1.1,
@@ -464,7 +464,7 @@ public class IntervalTest {
final RegionBSPTree1D tree = interval.toTree();
// assert
- Assert.assertEquals(5, tree.count());
+ Assertions.assertEquals(5, tree.count());
checkClassify(tree, RegionLocation.OUTSIDE,
Double.NEGATIVE_INFINITY, 0, 0.9, 1.1, 2, Double.POSITIVE_INFINITY);
@@ -485,7 +485,7 @@ public class IntervalTest {
final RegionBSPTree1D tree = interval.toTree();
// assert
- Assert.assertEquals(3, tree.count());
+ Assertions.assertEquals(3, tree.count());
checkClassify(tree, RegionLocation.OUTSIDE,
Double.NEGATIVE_INFINITY, -2, -1.1);
@@ -509,7 +509,7 @@ public class IntervalTest {
final RegionBSPTree1D tree = interval.toTree();
// assert
- Assert.assertEquals(3, tree.count());
+ Assertions.assertEquals(3, tree.count());
checkClassify(tree, RegionLocation.INSIDE,
Double.NEGATIVE_INFINITY, 0, 0.9);
@@ -533,7 +533,7 @@ public class IntervalTest {
final RegionBSPTree1D tree = interval.toTree();
// assert
- Assert.assertEquals(1, tree.count());
+ Assertions.assertEquals(1, tree.count());
checkClassify(tree, RegionLocation.INSIDE,
Double.NEGATIVE_INFINITY, -1, 0, 1, Double.POSITIVE_INFINITY);
@@ -548,9 +548,9 @@ public class IntervalTest {
// act/assert
- Assert.assertNull(full.project(Vector1D.of(Double.NEGATIVE_INFINITY)));
- Assert.assertNull(full.project(Vector1D.of(0)));
- Assert.assertNull(full.project(Vector1D.of(Double.POSITIVE_INFINITY)));
+ Assertions.assertNull(full.project(Vector1D.of(Double.NEGATIVE_INFINITY)));
+ Assertions.assertNull(full.project(Vector1D.of(0)));
+ Assertions.assertNull(full.project(Vector1D.of(Double.POSITIVE_INFINITY)));
}
@Test
@@ -669,7 +669,7 @@ public class IntervalTest {
final Split<Interval> split = interval.split(splitter);
// assert
- Assert.assertEquals(SplitLocation.BOTH, split.getLocation());
+ Assertions.assertEquals(SplitLocation.BOTH, split.getLocation());
checkInterval(split.getMinus(), Double.NEGATIVE_INFINITY, 1);
checkInterval(split.getPlus(), 1, Double.POSITIVE_INFINITY);
@@ -686,7 +686,7 @@ public class IntervalTest {
final Split<Interval> split = interval.split(splitter);
// assert
- Assert.assertEquals(SplitLocation.BOTH, split.getLocation());
+ Assertions.assertEquals(SplitLocation.BOTH, split.getLocation());
checkInterval(split.getMinus(), Double.NEGATIVE_INFINITY, 1);
checkInterval(split.getPlus(), 1, Double.POSITIVE_INFINITY);
@@ -703,7 +703,7 @@ public class IntervalTest {
final Split<Interval> split = interval.split(splitter);
// assert
- Assert.assertEquals(SplitLocation.BOTH, split.getLocation());
+ Assertions.assertEquals(SplitLocation.BOTH, split.getLocation());
checkInterval(split.getMinus(), 1, Double.POSITIVE_INFINITY);
checkInterval(split.getPlus(), -1, 1);
@@ -721,7 +721,7 @@ public class IntervalTest {
final Split<Interval> split = interval.split(splitter);
// assert
- Assert.assertEquals(SplitLocation.BOTH, split.getLocation());
+ Assertions.assertEquals(SplitLocation.BOTH, split.getLocation());
checkInterval(split.getMinus(), 1, Double.POSITIVE_INFINITY);
checkInterval(split.getPlus(), -1, 1);
@@ -738,9 +738,9 @@ public class IntervalTest {
final Split<Interval> split = interval.split(splitter);
// assert
- Assert.assertEquals(SplitLocation.PLUS, split.getLocation());
+ Assertions.assertEquals(SplitLocation.PLUS, split.getLocation());
- Assert.assertSame(interval, split.getPlus());
+ Assertions.assertSame(interval, split.getPlus());
}
@Test
@@ -754,9 +754,9 @@ public class IntervalTest {
final Split<Interval> split = interval.split(splitter);
// assert
- Assert.assertEquals(SplitLocation.MINUS, split.getLocation());
+ Assertions.assertEquals(SplitLocation.MINUS, split.getLocation());
- Assert.assertSame(interval, split.getMinus());
+ Assertions.assertSame(interval, split.getMinus());
}
@Test
@@ -770,9 +770,9 @@ public class IntervalTest {
final Split<Interval> split = interval.split(splitter);
// assert
- Assert.assertEquals(SplitLocation.MINUS, split.getLocation());
+ Assertions.assertEquals(SplitLocation.MINUS, split.getLocation());
- Assert.assertSame(interval, split.getMinus());
+ Assertions.assertSame(interval, split.getMinus());
}
@Test
@@ -786,9 +786,9 @@ public class IntervalTest {
final Split<Interval> split = interval.split(splitter);
// assert
- Assert.assertEquals(SplitLocation.PLUS, split.getLocation());
+ Assertions.assertEquals(SplitLocation.PLUS, split.getLocation());
- Assert.assertSame(interval, split.getPlus());
+ Assertions.assertSame(interval, split.getPlus());
}
@Test
@@ -802,10 +802,10 @@ public class IntervalTest {
final Split<Interval> split = interval.split(splitter);
// assert
- Assert.assertEquals(SplitLocation.MINUS, split.getLocation());
+ Assertions.assertEquals(SplitLocation.MINUS, split.getLocation());
checkInterval(split.getMinus(), 2, 2);
- Assert.assertNull(split.getPlus());
+ Assertions.assertNull(split.getPlus());
}
@Test
@@ -819,9 +819,9 @@ public class IntervalTest {
final Split<Interval> split = interval.split(splitter);
// assert
- Assert.assertEquals(SplitLocation.PLUS, split.getLocation());
+ Assertions.assertEquals(SplitLocation.PLUS, split.getLocation());
- Assert.assertNull(split.getMinus());
+ Assertions.assertNull(split.getMinus());
checkInterval(split.getPlus(), 2, 2);
}
@@ -836,10 +836,10 @@ public class IntervalTest {
final Split<Interval> split = interval.split(splitter);
// assert
- Assert.assertEquals(SplitLocation.NEITHER, split.getLocation());
+ Assertions.assertEquals(SplitLocation.NEITHER, split.getLocation());
- Assert.assertNull(split.getMinus());
- Assert.assertNull(split.getPlus());
+ Assertions.assertNull(split.getMinus());
+ Assertions.assertNull(split.getPlus());
}
@Test
@@ -851,9 +851,9 @@ public class IntervalTest {
final String str = interval.toString();
// assert
- Assert.assertTrue(str.contains("Interval"));
- Assert.assertTrue(str.contains("min= 1.0"));
- Assert.assertTrue(str.contains("max= 2.0"));
+ Assertions.assertTrue(str.contains("Interval"));
+ Assertions.assertTrue(str.contains("min= 1.0"));
+ Assertions.assertTrue(str.contains("max= 2.0"));
}
@Test
@@ -862,22 +862,22 @@ public class IntervalTest {
final Interval full = Interval.full();
// assert
- Assert.assertTrue(full.isFull());
- Assert.assertFalse(full.isEmpty());
- Assert.assertFalse(full.hasMinBoundary());
- Assert.assertFalse(full.hasMaxBoundary());
- Assert.assertTrue(full.isInfinite());
+ Assertions.assertTrue(full.isFull());
+ Assertions.assertFalse(full.isEmpty());
+ Assertions.assertFalse(full.hasMinBoundary());
+ Assertions.assertFalse(full.hasMaxBoundary());
+ Assertions.assertTrue(full.isInfinite());
- Assert.assertEquals(RegionLocation.INSIDE, full.classify(Double.NEGATIVE_INFINITY));
- Assert.assertEquals(RegionLocation.INSIDE, full.classify(Double.POSITIVE_INFINITY));
+ Assertions.assertEquals(RegionLocation.INSIDE, full.classify(Double.NEGATIVE_INFINITY));
+ Assertions.assertEquals(RegionLocation.INSIDE, full.classify(Double.POSITIVE_INFINITY));
}
private static void checkContains(final Interval interval, final boolean contains, final double... points) {
for (final double x : points) {
final String msg = "Unexpected contains status for point " + x;
- Assert.assertEquals(msg, contains, interval.contains(x));
- Assert.assertEquals(msg, contains, interval.contains(Vector1D.of(x)));
+ Assertions.assertEquals(contains, interval.contains(x), msg);
+ Assertions.assertEquals(contains, interval.contains(Vector1D.of(x)), msg);
}
}
@@ -885,8 +885,8 @@ public class IntervalTest {
for (final double x : points) {
final String msg = "Unexpected location for point " + x;
- Assert.assertEquals(msg, loc, interval.classify(x));
- Assert.assertEquals(msg, loc, interval.classify(Vector1D.of(x)));
+ Assertions.assertEquals(loc, interval.classify(x), msg);
+ Assertions.assertEquals(loc, interval.classify(Vector1D.of(x)), msg);
}
}
@@ -894,8 +894,8 @@ public class IntervalTest {
for (final double x : points) {
final String msg = "Unexpected location for point " + x;
- Assert.assertEquals(msg, loc, tree.classify(x));
- Assert.assertEquals(msg, loc, tree.classify(Vector1D.of(x)));
+ Assertions.assertEquals(loc, tree.classify(x), msg);
+ Assertions.assertEquals(loc, tree.classify(Vector1D.of(x)), msg);
}
}
@@ -904,7 +904,7 @@ public class IntervalTest {
final Vector1D proj = interval.project(pt);
- Assert.assertEquals(projectedLocation, proj.getX(), TEST_EPS);
+ Assertions.assertEquals(projectedLocation, proj.getX(), TEST_EPS);
}
/** Check that the given interval matches the arguments and is internally consistent.
@@ -923,27 +923,27 @@ public class IntervalTest {
* @param precision
*/
private static void checkInterval(final Interval interval, final double min, final double max, final DoublePrecisionContext precision) {
- Assert.assertEquals(min, interval.getMin(), TEST_EPS);
- Assert.assertEquals(max, interval.getMax(), TEST_EPS);
+ Assertions.assertEquals(min, interval.getMin(), TEST_EPS);
+ Assertions.assertEquals(max, interval.getMax(), TEST_EPS);
final boolean finiteMin = Double.isFinite(min);
final boolean finiteMax = Double.isFinite(max);
- Assert.assertEquals(finiteMin, interval.hasMinBoundary());
- Assert.assertEquals(finiteMax, interval.hasMaxBoundary());
+ Assertions.assertEquals(finiteMin, interval.hasMinBoundary());
+ Assertions.assertEquals(finiteMax, interval.hasMaxBoundary());
if (finiteMin) {
- Assert.assertEquals(min, interval.getMinBoundary().getLocation(), TEST_EPS);
+ Assertions.assertEquals(min, interval.getMinBoundary().getLocation(), TEST_EPS);
} else {
- Assert.assertNull(interval.getMinBoundary());
+ Assertions.assertNull(interval.getMinBoundary());
}
if (finiteMax) {
- Assert.assertEquals(max, interval.getMaxBoundary().getLocation(), TEST_EPS);
+ Assertions.assertEquals(max, interval.getMaxBoundary().getLocation(), TEST_EPS);
} else {
- Assert.assertNull(interval.getMaxBoundary());
+ Assertions.assertNull(interval.getMaxBoundary());
}
- Assert.assertFalse(interval.isEmpty()); // always false
+ Assertions.assertFalse(interval.isEmpty()); // always false
}
}
diff --git a/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/oned/OrientedPointTest.java b/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/oned/OrientedPointTest.java
index f961507..be4842b 100644
--- a/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/oned/OrientedPointTest.java
+++ b/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/oned/OrientedPointTest.java
@@ -28,8 +28,8 @@ import org.apache.commons.geometry.core.precision.DoublePrecisionContext;
import org.apache.commons.geometry.core.precision.EpsilonDoublePrecisionContext;
import org.apache.commons.geometry.euclidean.EuclideanTestUtils;
import org.apache.commons.numbers.core.Precision;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
public class OrientedPointTest {
@@ -123,14 +123,14 @@ public class OrientedPointTest {
final OrientedPoint pt = OrientedPoints.fromPointAndDirection(Vector1D.of(-2.0), true, TEST_PRECISION);
// act/assert
- Assert.assertEquals(-98.0, pt.offset(Vector1D.of(-100)), Precision.EPSILON);
- Assert.assertEquals(-0.1, pt.offset(Vector1D.of(-2.1)), Precision.EPSILON);
- Assert.assertEquals(0.0, pt.offset(Vector1D.of(-2)), Precision.EPSILON);
- Assert.assertEquals(0.99, pt.offset(Vector1D.of(-1.01)), Precision.EPSILON);
- Assert.assertEquals(1.0, pt.offset(Vector1D.of(-1.0)), Precision.EPSILON);
- Assert.assertEquals(1.01, pt.offset(Vector1D.of(-0.99)), Precision.EPSILON);
- Assert.assertEquals(2.0, pt.offset(Vector1D.of(0)), Precision.EPSILON);
- Assert.assertEquals(102, pt.offset(Vector1D.of(100)), Precision.EPSILON);
+ Assertions.assertEquals(-98.0, pt.offset(Vector1D.of(-100)), Precision.EPSILON);
+ Assertions.assertEquals(-0.1, pt.offset(Vector1D.of(-2.1)), Precision.EPSILON);
+ Assertions.assertEquals(0.0, pt.offset(Vector1D.of(-2)), Precision.EPSILON);
+ Assertions.assertEquals(0.99, pt.offset(Vector1D.of(-1.01)), Precision.EPSILON);
+ Assertions.assertEquals(1.0, pt.offset(Vector1D.of(-1.0)), Precision.EPSILON);
+ Assertions.assertEquals(1.01, pt.offset(Vector1D.of(-0.99)), Precision.EPSILON);
+ Assertions.assertEquals(2.0, pt.offset(Vector1D.of(0)), Precision.EPSILON);
+ Assertions.assertEquals(102, pt.offset(Vector1D.of(100)), Precision.EPSILON);
}
@Test
@@ -139,14 +139,14 @@ public class OrientedPointTest {
final OrientedPoint pt = OrientedPoints.fromPointAndDirection(Vector1D.of(-2.0), false, TEST_PRECISION);
// act/assert
- Assert.assertEquals(98.0, pt.offset(Vector1D.of(-100)), Precision.EPSILON);
- Assert.assertEquals(0.1, pt.offset(Vector1D.of(-2.1)), Precision.EPSILON);
- Assert.assertEquals(0.0, pt.offset(Vector1D.of(-2)), Precision.EPSILON);
- Assert.assertEquals(-0.99, pt.offset(Vector1D.of(-1.01)), Precision.EPSILON);
- Assert.assertEquals(-1.0, pt.offset(Vector1D.of(-1.0)), Precision.EPSILON);
- Assert.assertEquals(-1.01, pt.offset(Vector1D.of(-0.99)), Precision.EPSILON);
- Assert.assertEquals(-2, pt.offset(Vector1D.of(0)), Precision.EPSILON);
- Assert.assertEquals(-102, pt.offset(Vector1D.of(100)), Precision.EPSILON);
+ Assertions.assertEquals(98.0, pt.offset(Vector1D.of(-100)), Precision.EPSILON);
+ Assertions.assertEquals(0.1, pt.offset(Vector1D.of(-2.1)), Precision.EPSILON);
+ Assertions.assertEquals(0.0, pt.offset(Vector1D.of(-2)), Precision.EPSILON);
+ Assertions.assertEquals(-0.99, pt.offset(Vector1D.of(-1.01)), Precision.EPSILON);
+ Assertions.assertEquals(-1.0, pt.offset(Vector1D.of(-1.0)), Precision.EPSILON);
+ Assertions.assertEquals(-1.01, pt.offset(Vector1D.of(-0.99)), Precision.EPSILON);
+ Assertions.assertEquals(-2, pt.offset(Vector1D.of(0)), Precision.EPSILON);
+ Assertions.assertEquals(-102, pt.offset(Vector1D.of(100)), Precision.EPSILON);
}
@Test
@@ -165,7 +165,7 @@ public class OrientedPointTest {
final OrientedPoint pt = OrientedPoints.fromPointAndDirection(Vector1D.of(Double.POSITIVE_INFINITY), true, TEST_PRECISION);
// act/assert
- Assert.assertTrue(Double.isNaN(pt.offset(Vector1D.of(Double.POSITIVE_INFINITY))));
+ Assertions.assertTrue(Double.isNaN(pt.offset(Vector1D.of(Double.POSITIVE_INFINITY))));
GeometryTestUtils.assertNegativeInfinity(pt.offset(Vector1D.of(Double.NEGATIVE_INFINITY)));
GeometryTestUtils.assertNegativeInfinity(pt.offset(Vector1D.of(0)));
@@ -205,7 +205,7 @@ public class OrientedPointTest {
final HyperplaneConvexSubset<Vector1D> result = pt.span();
// assert
- Assert.assertSame(pt, result.getHyperplane());
+ Assertions.assertSame(pt, result.getHyperplane());
}
@Test
@@ -217,16 +217,16 @@ public class OrientedPointTest {
final OrientedPoint positiveDir2 = OrientedPoints.fromPointAndDirection(Vector1D.of(-2.0), true, TEST_PRECISION);
// act/assert
- Assert.assertTrue(negativeDir1.similarOrientation(negativeDir1));
- Assert.assertTrue(negativeDir1.similarOrientation(negativeDir2));
- Assert.assertTrue(negativeDir2.similarOrientation(negativeDir1));
+ Assertions.assertTrue(negativeDir1.similarOrientation(negativeDir1));
+ Assertions.assertTrue(negativeDir1.similarOrientation(negativeDir2));
+ Assertions.assertTrue(negativeDir2.similarOrientation(negativeDir1));
- Assert.assertTrue(positiveDir1.similarOrientation(positiveDir1));
- Assert.assertTrue(positiveDir1.similarOrientation(positiveDir2));
- Assert.assertTrue(positiveDir2.similarOrientation(positiveDir1));
+ Assertions.assertTrue(positiveDir1.similarOrientation(positiveDir1));
+ Assertions.assertTrue(positiveDir1.similarOrientation(positiveDir2));
+ Assertions.assertTrue(positiveDir2.similarOrientation(positiveDir1));
- Assert.assertFalse(negativeDir1.similarOrientation(positiveDir1));
- Assert.assertFalse(positiveDir1.similarOrientation(negativeDir1));
+ Assertions.assertFalse(negativeDir1.similarOrientation(positiveDir1));
+ Assertions.assertFalse(positiveDir1.similarOrientation(negativeDir1));
}
@Test
@@ -235,10 +235,10 @@ public class OrientedPointTest {
final OrientedPoint pt = OrientedPoints.fromPointAndDirection(Vector1D.of(1.0), true, TEST_PRECISION);
// act/assert
- Assert.assertEquals(1.0, pt.project(Vector1D.of(-1.0)).getX(), Precision.EPSILON);
- Assert.assertEquals(1.0, pt.project(Vector1D.of(0.0)).getX(), Precision.EPSILON);
- Assert.assertEquals(1.0, pt.project(Vector1D.of(1.0)).getX(), Precision.EPSILON);
- Assert.assertEquals(1.0, pt.project(Vector1D.of(100.0)).getX(), Precision.EPSILON);
+ Assertions.assertEquals(1.0, pt.project(Vector1D.of(-1.0)).getX(), Precision.EPSILON);
+ Assertions.assertEquals(1.0, pt.project(Vector1D.of(0.0)).getX(), Precision.EPSILON);
+ Assertions.assertEquals(1.0, pt.project(Vector1D.of(1.0)).getX(), Precision.EPSILON);
+ Assertions.assertEquals(1.0, pt.project(Vector1D.of(100.0)).getX(), Precision.EPSILON);
}
@@ -255,14 +255,14 @@ public class OrientedPointTest {
final OrientedPoint e = OrientedPoints.createPositiveFacing(1e-4, precision);
// act/assert
- Assert.assertTrue(a.eq(a, precision));
- Assert.assertTrue(a.eq(b, precision));
+ Assertions.assertTrue(a.eq(a, precision));
+ Assertions.assertTrue(a.eq(b, precision));
- Assert.assertFalse(a.eq(c, precision));
- Assert.assertFalse(a.eq(d, precision));
+ Assertions.assertFalse(a.eq(c, precision));
+ Assertions.assertFalse(a.eq(d, precision));
- Assert.assertTrue(a.eq(e, precision));
- Assert.assertTrue(e.eq(a, precision));
+ Assertions.assertTrue(a.eq(e, precision));
+ Assertions.assertTrue(e.eq(a, precision));
}
@Test
@@ -280,13 +280,13 @@ public class OrientedPointTest {
final OrientedPoint f = OrientedPoints.fromPointAndDirection(Vector1D.of(2.0), true, precisionB);
// act/assert
- Assert.assertNotEquals(a.hashCode(), b.hashCode());
- Assert.assertNotEquals(b.hashCode(), c.hashCode());
- Assert.assertNotEquals(c.hashCode(), a.hashCode());
+ Assertions.assertNotEquals(a.hashCode(), b.hashCode());
+ Assertions.assertNotEquals(b.hashCode(), c.hashCode());
+ Assertions.assertNotEquals(c.hashCode(), a.hashCode());
- Assert.assertEquals(a.hashCode(), d.hashCode());
- Assert.assertEquals(b.hashCode(), e.hashCode());
- Assert.assertEquals(c.hashCode(), f.hashCode());
+ Assertions.assertEquals(a.hashCode(), d.hashCode());
+ Assertions.assertEquals(b.hashCode(), e.hashCode());
+ Assertions.assertEquals(c.hashCode(), f.hashCode());
}
@Test
@@ -309,12 +309,12 @@ public class OrientedPointTest {
// act/assert
GeometryTestUtils.assertSimpleEqualsCases(a);
- Assert.assertNotEquals(a, b);
- Assert.assertNotEquals(c, d);
- Assert.assertNotEquals(e, f);
+ Assertions.assertNotEquals(a, b);
+ Assertions.assertNotEquals(c, d);
+ Assertions.assertNotEquals(e, f);
- Assert.assertEquals(a, g);
- Assert.assertEquals(g, a);
+ Assertions.assertEquals(a, g);
+ Assertions.assertEquals(g, a);
}
@Test
@@ -326,9 +326,9 @@ public class OrientedPointTest {
final String str = pt.toString();
// assert
- Assert.assertTrue(str.contains("OrientedPoint"));
- Assert.assertTrue(str.contains("point= (2.0)"));
- Assert.assertTrue(str.contains("direction= (1.0)"));
+ Assertions.assertTrue(str.contains("OrientedPoint"));
+ Assertions.assertTrue(str.contains("point= (2.0)"));
+ Assertions.assertTrue(str.contains("direction= (1.0)"));
}
@Test
@@ -413,8 +413,8 @@ public class OrientedPointTest {
private void checkSplit(final HyperplaneConvexSubset<Vector1D> sub, final OrientedPoint splitter, final boolean minus, final boolean plus) {
final Split<? extends HyperplaneConvexSubset<Vector1D>> split = sub.split(splitter);
- Assert.assertSame(minus ? sub : null, split.getMinus());
- Assert.assertSame(plus ? sub : null, split.getPlus());
+ Assertions.assertSame(minus ? sub : null, split.getMinus());
+ Assertions.assertSame(plus ? sub : null, split.getPlus());
}
@Test
@@ -424,17 +424,17 @@ public class OrientedPointTest {
final HyperplaneConvexSubset<Vector1D> sub = pt.span();
// act/assert
- Assert.assertSame(pt, sub.getHyperplane());
- Assert.assertFalse(sub.isFull());
- Assert.assertFalse(sub.isEmpty());
- Assert.assertFalse(sub.isInfinite());
- Assert.assertTrue(sub.isFinite());
- Assert.assertEquals(0.0, sub.getSize(), TEST_EPS);
+ Assertions.assertSame(pt, sub.getHyperplane());
+ Assertions.assertFalse(sub.isFull());
+ Assertions.assertFalse(sub.isEmpty());
+ Assertions.assertFalse(sub.isInfinite());
+ Assertions.assertTrue(sub.isFinite());
+ Assertions.assertEquals(0.0, sub.getSize(), TEST_EPS);
EuclideanTestUtils.assertCoordinatesEqual(Vector1D.of(2), sub.getCentroid(), TEST_EPS);
final List<? extends HyperplaneConvexSubset<Vector1D>> list = sub.toConvex();
- Assert.assertEquals(1, list.size());
- Assert.assertSame(sub, list.get(0));
+ Assertions.assertEquals(1, list.size());
+ Assertions.assertSame(sub, list.get(0));
}
@Test
@@ -445,18 +445,18 @@ public class OrientedPointTest {
final HyperplaneConvexSubset<Vector1D> sub = pt.span();
// act/assert
- Assert.assertEquals(RegionLocation.BOUNDARY, sub.classify(Vector1D.of(0.95)));
- Assert.assertEquals(RegionLocation.BOUNDARY, sub.classify(Vector1D.of(1)));
- Assert.assertEquals(RegionLocation.BOUNDARY, sub.classify(Vector1D.of(1.05)));
+ Assertions.assertEquals(RegionLocation.BOUNDARY, sub.classify(Vector1D.of(0.95)));
+ Assertions.assertEquals(RegionLocation.BOUNDARY, sub.classify(Vector1D.of(1)));
+ Assertions.assertEquals(RegionLocation.BOUNDARY, sub.classify(Vector1D.of(1.05)));
- Assert.assertEquals(RegionLocation.OUTSIDE, sub.classify(Vector1D.of(1.11)));
- Assert.assertEquals(RegionLocation.OUTSIDE, sub.classify(Vector1D.of(0.89)));
+ Assertions.assertEquals(RegionLocation.OUTSIDE, sub.classify(Vector1D.of(1.11)));
+ Assertions.assertEquals(RegionLocation.OUTSIDE, sub.classify(Vector1D.of(0.89)));
- Assert.assertEquals(RegionLocation.OUTSIDE, sub.classify(Vector1D.of(-3)));
- Assert.assertEquals(RegionLocation.OUTSIDE, sub.classify(Vector1D.of(10)));
+ Assertions.assertEquals(RegionLocation.OUTSIDE, sub.classify(Vector1D.of(-3)));
+ Assertions.assertEquals(RegionLocation.OUTSIDE, sub.classify(Vector1D.of(10)));
- Assert.assertEquals(RegionLocation.OUTSIDE, sub.classify(Vector1D.NEGATIVE_INFINITY));
- Assert.assertEquals(RegionLocation.OUTSIDE, sub.classify(Vector1D.POSITIVE_INFINITY));
+ Assertions.assertEquals(RegionLocation.OUTSIDE, sub.classify(Vector1D.NEGATIVE_INFINITY));
+ Assertions.assertEquals(RegionLocation.OUTSIDE, sub.classify(Vector1D.POSITIVE_INFINITY));
}
@Test
@@ -467,18 +467,18 @@ public class OrientedPointTest {
final HyperplaneConvexSubset<Vector1D> sub = pt.span();
// act/assert
- Assert.assertTrue(sub.contains(Vector1D.of(0.95)));
- Assert.assertTrue(sub.contains(Vector1D.of(1)));
- Assert.assertTrue(sub.contains(Vector1D.of(1.05)));
+ Assertions.assertTrue(sub.contains(Vector1D.of(0.95)));
+ Assertions.assertTrue(sub.contains(Vector1D.of(1)));
+ Assertions.assertTrue(sub.contains(Vector1D.of(1.05)));
- Assert.assertFalse(sub.contains(Vector1D.of(1.11)));
- Assert.assertFalse(sub.contains(Vector1D.of(0.89)));
+ Assertions.assertFalse(sub.contains(Vector1D.of(1.11)));
+ Assertions.assertFalse(sub.contains(Vector1D.of(0.89)));
- Assert.assertFalse(sub.contains(Vector1D.of(-3)));
- Assert.assertFalse(sub.contains(Vector1D.of(10)));
+ Assertions.assertFalse(sub.contains(Vector1D.of(-3)));
+ Assertions.assertFalse(sub.contains(Vector1D.of(10)));
- Assert.assertFalse(sub.contains(Vector1D.NEGATIVE_INFINITY));
- Assert.assertFalse(sub.contains(Vector1D.POSITIVE_INFINITY));
+ Assertions.assertFalse(sub.contains(Vector1D.NEGATIVE_INFINITY));
+ Assertions.assertFalse(sub.contains(Vector1D.POSITIVE_INFINITY));
}
@Test
@@ -530,10 +530,10 @@ public class OrientedPointTest {
final HyperplaneConvexSubset<Vector1D> result = sub.reverse();
// assert
- Assert.assertEquals(2.0, ((OrientedPoint) result.getHyperplane()).getLocation(), TEST_EPS);
- Assert.assertFalse(((OrientedPoint) result.getHyperplane()).isPositiveFacing());
+ Assertions.assertEquals(2.0, ((OrientedPoint) result.getHyperplane()).getLocation(), TEST_EPS);
+ Assertions.assertFalse(((OrientedPoint) result.getHyperplane()).isPositiveFacing());
- Assert.assertEquals(sub.getHyperplane(), result.reverse().getHyperplane());
+ Assertions.assertEquals(sub.getHyperplane(), result.reverse().getHyperplane());
}
@Test
@@ -546,26 +546,26 @@ public class OrientedPointTest {
final String str = sub.toString();
//assert
- Assert.assertTrue(str.contains("OrientedPointConvexSubset"));
- Assert.assertTrue(str.contains("point= (2.0)"));
- Assert.assertTrue(str.contains("direction= (1.0)"));
+ Assertions.assertTrue(str.contains("OrientedPointConvexSubset"));
+ Assertions.assertTrue(str.contains("point= (2.0)"));
+ Assertions.assertTrue(str.contains("direction= (1.0)"));
}
private static void assertOrientedPoint(final OrientedPoint pt, final double location, final boolean positiveFacing,
final DoublePrecisionContext precision) {
- Assert.assertEquals(location, pt.getPoint().getX(), TEST_EPS);
- Assert.assertEquals(location, pt.getLocation(), TEST_EPS);
- Assert.assertEquals(positiveFacing ? 1.0 : -1.0, pt.getDirection().getX(), TEST_EPS);
- Assert.assertEquals(positiveFacing, pt.isPositiveFacing());
- Assert.assertSame(precision, pt.getPrecision());
+ Assertions.assertEquals(location, pt.getPoint().getX(), TEST_EPS);
+ Assertions.assertEquals(location, pt.getLocation(), TEST_EPS);
+ Assertions.assertEquals(positiveFacing ? 1.0 : -1.0, pt.getDirection().getX(), TEST_EPS);
+ Assertions.assertEquals(positiveFacing, pt.isPositiveFacing());
+ Assertions.assertSame(precision, pt.getPrecision());
}
private static void assertClassify(final HyperplaneLocation expected, final OrientedPoint pt, final double... locations) {
for (final double location : locations) {
final String msg = "Unexpected classification for location " + location;
- Assert.assertEquals(msg, expected, pt.classify(location));
- Assert.assertEquals(msg, expected, pt.classify(Vector1D.of(location)));
+ Assertions.assertEquals(expected, pt.classify(location), msg);
+ Assertions.assertEquals(expected, pt.classify(Vector1D.of(location)), msg);
}
}
}
diff --git a/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/oned/RegionBSPTree1DTest.java b/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/oned/RegionBSPTree1DTest.java
index 408d68a..3211674 100644
--- a/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/oned/RegionBSPTree1DTest.java
+++ b/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/oned/RegionBSPTree1DTest.java
@@ -28,8 +28,8 @@ import org.apache.commons.geometry.core.precision.DoublePrecisionContext;
import org.apache.commons.geometry.core.precision.EpsilonDoublePrecisionContext;
import org.apache.commons.geometry.euclidean.EuclideanTestUtils;
import org.apache.commons.geometry.euclidean.oned.RegionBSPTree1D.RegionNode1D;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
public class RegionBSPTree1DTest {
@@ -48,8 +48,8 @@ public class RegionBSPTree1DTest {
final RegionBSPTree1D copy = tree.copy();
// assert
- Assert.assertNotSame(tree, copy);
- Assert.assertEquals(3, copy.count());
+ Assertions.assertNotSame(tree, copy);
+ Assertions.assertEquals(3, copy.count());
}
@Test
@@ -141,9 +141,9 @@ public class RegionBSPTree1DTest {
@Test
public void testGetBoundarySize_alwaysReturnsZero() {
// act/assert
- Assert.assertEquals(0.0, RegionBSPTree1D.full().getBoundarySize(), TEST_EPS);
- Assert.assertEquals(0.0, RegionBSPTree1D.empty().getBoundarySize(), TEST_EPS);
- Assert.assertEquals(0.0, RegionBSPTree1D.from(
+ Assertions.assertEquals(0.0, RegionBSPTree1D.full().getBoundarySize(), TEST_EPS);
+ Assertions.assertEquals(0.0, RegionBSPTree1D.empty().getBoundarySize(), TEST_EPS);
+ Assertions.assertEquals(0.0, RegionBSPTree1D.from(
Interval.of(1, 2, TEST_PRECISION),
Interval.of(4, 5, TEST_PRECISION)
).getBoundarySize(), TEST_EPS);
@@ -155,9 +155,9 @@ public class RegionBSPTree1DTest {
final RegionBSPTree1D full = RegionBSPTree1D.full();
// act/assert
- Assert.assertNull(full.project(Vector1D.of(Double.NEGATIVE_INFINITY)));
- Assert.assertNull(full.project(Vector1D.of(0)));
- Assert.assertNull(full.project(Vector1D.of(Double.POSITIVE_INFINITY)));
+ Assertions.assertNull(full.project(Vector1D.of(Double.NEGATIVE_INFINITY)));
+ Assertions.assertNull(full.project(Vector1D.of(0)));
+ Assertions.assertNull(full.project(Vector1D.of(Double.POSITIVE_INFINITY)));
}
@Test
@@ -166,9 +166,9 @@ public class RegionBSPTree1DTest {
final RegionBSPTree1D empty = RegionBSPTree1D.empty();
// act/assert
- Assert.assertNull(empty.project(Vector1D.of(Double.NEGATIVE_INFINITY)));
- Assert.assertNull(empty.project(Vector1D.of(0)));
- Assert.assertNull(empty.project(Vector1D.of(Double.POSITIVE_INFINITY)));
+ Assertions.assertNull(empty.project(Vector1D.of(Double.NEGATIVE_INFINITY)));
+ Assertions.assertNull(empty.project(Vector1D.of(0)));
+ Assertions.assertNull(empty.project(Vector1D.of(Double.POSITIVE_INFINITY)));
}
@Test
@@ -342,8 +342,8 @@ public class RegionBSPTree1DTest {
tree.add(Interval.of(Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, TEST_PRECISION));
// assert
- Assert.assertTrue(tree.isFull());
- Assert.assertEquals(1, tree.count());
+ Assertions.assertTrue(tree.isFull());
+ Assertions.assertEquals(1, tree.count());
}
@Test
@@ -374,7 +374,7 @@ public class RegionBSPTree1DTest {
final List<Interval> intervals = tree.toIntervals();
// assert
- Assert.assertEquals(1, intervals.size());
+ Assertions.assertEquals(1, intervals.size());
checkInterval(intervals.get(0), Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY);
}
@@ -387,7 +387,7 @@ public class RegionBSPTree1DTest {
final List<Interval> intervals = tree.toIntervals();
// assert
- Assert.assertEquals(0, intervals.size());
+ Assertions.assertEquals(0, intervals.size());
}
@Test
@@ -402,7 +402,7 @@ public class RegionBSPTree1DTest {
final List<Interval> intervals = tree.toIntervals();
// assert
- Assert.assertEquals(1, intervals.size());
+ Assertions.assertEquals(1, intervals.size());
checkInterval(intervals.get(0), Double.NEGATIVE_INFINITY, 1);
}
@@ -418,7 +418,7 @@ public class RegionBSPTree1DTest {
final List<Interval> intervals = tree.toIntervals();
// assert
- Assert.assertEquals(1, intervals.size());
+ Assertions.assertEquals(1, intervals.size());
checkInterval(intervals.get(0), -1, Double.POSITIVE_INFINITY);
}
@@ -434,7 +434,7 @@ public class RegionBSPTree1DTest {
final List<Interval> intervals = tree.toIntervals();
// assert
- Assert.assertEquals(1, intervals.size());
+ Assertions.assertEquals(1, intervals.size());
checkInterval(intervals.get(0), -1, 1);
}
@@ -451,7 +451,7 @@ public class RegionBSPTree1DTest {
final List<Interval> intervals = tree.toIntervals();
// assert
- Assert.assertEquals(2, intervals.size());
+ Assertions.assertEquals(2, intervals.size());
checkInterval(intervals.get(0), Double.NEGATIVE_INFINITY, -1);
checkInterval(intervals.get(1), 1, Double.POSITIVE_INFINITY);
}
@@ -470,7 +470,7 @@ public class RegionBSPTree1DTest {
final List<Interval> intervals = tree.toIntervals();
// assert
- Assert.assertEquals(3, intervals.size());
+ Assertions.assertEquals(3, intervals.size());
checkInterval(intervals.get(0), Double.NEGATIVE_INFINITY, -10);
checkInterval(intervals.get(1), -1, 1);
checkInterval(intervals.get(2), 10, Double.POSITIVE_INFINITY);
@@ -488,7 +488,7 @@ public class RegionBSPTree1DTest {
final List<Interval> intervals = tree.toIntervals();
// assert
- Assert.assertEquals(1, intervals.size());
+ Assertions.assertEquals(1, intervals.size());
checkInterval(intervals.get(0), 1, 1);
}
@@ -505,7 +505,7 @@ public class RegionBSPTree1DTest {
final List<Interval> intervals = tree.toIntervals();
// assert
- Assert.assertEquals(2, intervals.size());
+ Assertions.assertEquals(2, intervals.size());
checkInterval(intervals.get(0), Double.NEGATIVE_INFINITY, 1);
checkInterval(intervals.get(1), 1, Double.POSITIVE_INFINITY);
}
@@ -523,7 +523,7 @@ public class RegionBSPTree1DTest {
final List<Interval> intervals = tree.toIntervals();
// assert
- Assert.assertEquals(2, intervals.size());
+ Assertions.assertEquals(2, intervals.size());
checkInterval(intervals.get(0), 1, 1);
checkInterval(intervals.get(1), 2, 2);
}
@@ -542,7 +542,7 @@ public class RegionBSPTree1DTest {
final List<Interval> intervals = tree.toIntervals();
// assert
- Assert.assertEquals(3, intervals.size());
+ Assertions.assertEquals(3, intervals.size());
checkInterval(intervals.get(0), Double.NEGATIVE_INFINITY, 1);
checkInterval(intervals.get(1), 1, 2);
checkInterval(intervals.get(2), 2, Double.POSITIVE_INFINITY);
@@ -560,7 +560,7 @@ public class RegionBSPTree1DTest {
final List<Interval> intervals = tree.toIntervals();
// assert
- Assert.assertEquals(1, intervals.size());
+ Assertions.assertEquals(1, intervals.size());
checkInterval(intervals.get(0), 1, 3);
}
@@ -580,7 +580,7 @@ public class RegionBSPTree1DTest {
final List<Interval> intervals = tree.toIntervals();
// assert
- Assert.assertEquals(3, intervals.size());
+ Assertions.assertEquals(3, intervals.size());
checkInterval(intervals.get(0), -2, -1);
checkInterval(intervals.get(1), 1, 4);
checkInterval(intervals.get(2), 5, 6);
@@ -598,7 +598,7 @@ public class RegionBSPTree1DTest {
final List<Interval> intervals = tree.toIntervals();
// assert
- Assert.assertEquals(1, intervals.size());
+ Assertions.assertEquals(1, intervals.size());
checkInterval(intervals.get(0), -1, 6);
}
@@ -634,7 +634,7 @@ public class RegionBSPTree1DTest {
tree.transform(transform);
// assert
- Assert.assertTrue(tree.isFull());
+ Assertions.assertTrue(tree.isFull());
}
@Test
@@ -654,7 +654,7 @@ public class RegionBSPTree1DTest {
// assert
final List<Interval> intervals = tree.toIntervals();
- Assert.assertEquals(2, intervals.size());
+ Assertions.assertEquals(2, intervals.size());
checkInterval(intervals.get(0), 5, 7);
checkInterval(intervals.get(1), 9, Double.POSITIVE_INFINITY);
}
@@ -676,7 +676,7 @@ public class RegionBSPTree1DTest {
// assert
final List<Interval> intervals = tree.toIntervals();
- Assert.assertEquals(2, intervals.size());
+ Assertions.assertEquals(2, intervals.size());
checkInterval(intervals.get(0), Double.NEGATIVE_INFINITY, -3);
checkInterval(intervals.get(1), -1, 1);
}
@@ -697,7 +697,7 @@ public class RegionBSPTree1DTest {
// assert
final List<Interval> intervals = tree.toIntervals();
- Assert.assertEquals(2, intervals.size());
+ Assertions.assertEquals(2, intervals.size());
checkInterval(intervals.get(0), Double.NEGATIVE_INFINITY, -3);
checkInterval(intervals.get(1), -2, -1);
}
@@ -712,14 +712,14 @@ public class RegionBSPTree1DTest {
final Split<RegionBSPTree1D> split = tree.split(splitter);
// assert
- Assert.assertEquals(SplitLocation.BOTH, split.getLocation());
+ Assertions.assertEquals(SplitLocation.BOTH, split.getLocation());
final List<Interval> minusIntervals = split.getMinus().toIntervals();
- Assert.assertEquals(1, minusIntervals.size());
+ Assertions.assertEquals(1, minusIntervals.size());
checkInterval(minusIntervals.get(0), Double.NEGATIVE_INFINITY, 2);
final List<Interval> plusIntervals = split.getPlus().toIntervals();
- Assert.assertEquals(1, plusIntervals.size());
+ Assertions.assertEquals(1, plusIntervals.size());
checkInterval(plusIntervals.get(0), 2, Double.POSITIVE_INFINITY);
}
@@ -733,10 +733,10 @@ public class RegionBSPTree1DTest {
final Split<RegionBSPTree1D> split = tree.split(splitter);
// assert
- Assert.assertEquals(SplitLocation.NEITHER, split.getLocation());
+ Assertions.assertEquals(SplitLocation.NEITHER, split.getLocation());
- Assert.assertNull(split.getMinus());
- Assert.assertNull(split.getPlus());
+ Assertions.assertNull(split.getMinus());
+ Assertions.assertNull(split.getPlus());
}
@Test
@@ -752,14 +752,14 @@ public class RegionBSPTree1DTest {
final Split<RegionBSPTree1D> split = tree.split(splitter);
// assert
- Assert.assertEquals(SplitLocation.BOTH, split.getLocation());
+ Assertions.assertEquals(SplitLocation.BOTH, split.getLocation());
final List<Interval> minusIntervals = split.getMinus().toIntervals();
- Assert.assertEquals(1, minusIntervals.size());
+ Assertions.assertEquals(1, minusIntervals.size());
checkInterval(minusIntervals.get(0), 2, 4);
final List<Interval> plusIntervals = split.getPlus().toIntervals();
- Assert.assertEquals(2, plusIntervals.size());
+ Assertions.assertEquals(2, plusIntervals.size());
checkInterval(plusIntervals.get(0), Double.NEGATIVE_INFINITY, -2);
checkInterval(plusIntervals.get(1), 1, 2);
}
@@ -776,13 +776,13 @@ public class RegionBSPTree1DTest {
final Split<RegionBSPTree1D> split = tree.split(splitter);
// assert
- Assert.assertEquals(SplitLocation.MINUS, split.getLocation());
+ Assertions.assertEquals(SplitLocation.MINUS, split.getLocation());
final List<Interval> minusIntervals = split.getMinus().toIntervals();
- Assert.assertEquals(1, minusIntervals.size());
+ Assertions.assertEquals(1, minusIntervals.size());
checkInterval(minusIntervals.get(0), 1, 4);
- Assert.assertNull(split.getPlus());
+ Assertions.assertNull(split.getPlus());
}
@Test
@@ -797,12 +797,12 @@ public class RegionBSPTree1DTest {
final Split<RegionBSPTree1D> split = tree.split(splitter);
// assert
- Assert.assertEquals(SplitLocation.PLUS, split.getLocation());
+ Assertions.assertEquals(SplitLocation.PLUS, split.getLocation());
- Assert.assertNull(split.getMinus());
+ Assertions.assertNull(split.getMinus());
final List<Interval> plusIntervals = split.getPlus().toIntervals();
- Assert.assertEquals(1, plusIntervals.size());
+ Assertions.assertEquals(1, plusIntervals.size());
checkInterval(plusIntervals.get(0), 1, 4);
}
@@ -817,12 +817,12 @@ public class RegionBSPTree1DTest {
final Split<RegionBSPTree1D> split = tree.split(splitter);
// assert
- Assert.assertEquals(SplitLocation.PLUS, split.getLocation());
+ Assertions.assertEquals(SplitLocation.PLUS, split.getLocation());
- Assert.assertNull(split.getMinus());
+ Assertions.assertNull(split.getMinus());
final List<Interval> plusIntervals = split.getPlus().toIntervals();
- Assert.assertEquals(1, plusIntervals.size());
+ Assertions.assertEquals(1, plusIntervals.size());
checkInterval(plusIntervals.get(0), 1, 1);
}
@@ -837,12 +837,12 @@ public class RegionBSPTree1DTest {
final Split<RegionBSPTree1D> split = tree.split(splitter);
// assert
- Assert.assertEquals(SplitLocation.PLUS, split.getLocation());
+ Assertions.assertEquals(SplitLocation.PLUS, split.getLocation());
- Assert.assertNull(split.getMinus());
+ Assertions.assertNull(split.getMinus());
final List<Interval> plusIntervals = split.getPlus().toIntervals();
- Assert.assertEquals(1, plusIntervals.size());
+ Assertions.assertEquals(1, plusIntervals.size());
checkInterval(plusIntervals.get(0), 1, 1);
}
@@ -857,13 +857,13 @@ public class RegionBSPTree1DTest {
final Split<RegionBSPTree1D> split = tree.split(splitter);
// assert
- Assert.assertEquals(SplitLocation.MINUS, split.getLocation());
+ Assertions.assertEquals(SplitLocation.MINUS, split.getLocation());
final List<Interval> minusIntervals = split.getMinus().toIntervals();
- Assert.assertEquals(1, minusIntervals.size());
+ Assertions.assertEquals(1, minusIntervals.size());
checkInterval(minusIntervals.get(0), 1, 1);
- Assert.assertNull(split.getPlus());
+ Assertions.assertNull(split.getPlus());
}
@Test
@@ -878,9 +878,9 @@ public class RegionBSPTree1DTest {
negHalfSpace.getRoot().cut(OrientedPoints.createPositiveFacing(3.0, TEST_PRECISION));
// act/assert
- Assert.assertEquals(Double.POSITIVE_INFINITY, full.getSize(), TEST_EPS);
- Assert.assertEquals(Double.POSITIVE_INFINITY, posHalfSpace.getSize(), TEST_EPS);
- Assert.assertEquals(Double.POSITIVE_INFINITY, negHalfSpace.getSize(), TEST_EPS);
+ Assertions.assertEquals(Double.POSITIVE_INFINITY, full.getSize(), TEST_EPS);
+ Assertions.assertEquals(Double.POSITIVE_INFINITY, posHalfSpace.getSize(), TEST_EPS);
+ Assertions.assertEquals(Double.POSITIVE_INFINITY, negHalfSpace.getSize(), TEST_EPS);
}
@Test
@@ -889,7 +889,7 @@ public class RegionBSPTree1DTest {
final RegionBSPTree1D tree = RegionBSPTree1D.empty();
// act/assert
- Assert.assertEquals(0, tree.getSize(), TEST_EPS);
+ Assertions.assertEquals(0, tree.getSize(), TEST_EPS);
}
@Test
@@ -904,8 +904,8 @@ public class RegionBSPTree1DTest {
multiplePoints.add(Interval.of(2, 2, TEST_PRECISION));
// act/assert
- Assert.assertEquals(0, singlePoint.getSize(), TEST_EPS);
- Assert.assertEquals(0, multiplePoints.getSize(), TEST_EPS);
+ Assertions.assertEquals(0, singlePoint.getSize(), TEST_EPS);
+ Assertions.assertEquals(0, multiplePoints.getSize(), TEST_EPS);
}
@Test
@@ -922,8 +922,8 @@ public class RegionBSPTree1DTest {
multiplePoints.add(Interval.of(2, 2.02, precision));
// act/assert
- Assert.assertEquals(0.02, singlePoint.getSize(), TEST_EPS);
- Assert.assertEquals(0.06, multiplePoints.getSize(), TEST_EPS);
+ Assertions.assertEquals(0.02, singlePoint.getSize(), TEST_EPS);
+ Assertions.assertEquals(0.06, multiplePoints.getSize(), TEST_EPS);
}
@Test
@@ -934,7 +934,7 @@ public class RegionBSPTree1DTest {
tree.add(Interval.of(3, 5, TEST_PRECISION));
// act/assert
- Assert.assertEquals(3, tree.getSize(), TEST_EPS);
+ Assertions.assertEquals(3, tree.getSize(), TEST_EPS);
}
@Test
@@ -946,7 +946,7 @@ public class RegionBSPTree1DTest {
tree.add(Interval.of(5, 5, TEST_PRECISION));
// act/assert
- Assert.assertEquals(1, tree.getSize(), TEST_EPS);
+ Assertions.assertEquals(1, tree.getSize(), TEST_EPS);
}
@Test
@@ -959,7 +959,7 @@ public class RegionBSPTree1DTest {
tree.complement();
// act/assert
- Assert.assertEquals(2, tree.getSize(), TEST_EPS);
+ Assertions.assertEquals(2, tree.getSize(), TEST_EPS);
}
@Test
@@ -974,9 +974,9 @@ public class RegionBSPTree1DTest {
negHalfSpace.getRoot().cut(OrientedPoints.createPositiveFacing(3.0, TEST_PRECISION));
// act/assert
- Assert.assertNull(full.getCentroid());
- Assert.assertNull(posHalfSpace.getCentroid());
- Assert.assertNull(negHalfSpace.getCentroid());
+ Assertions.assertNull(full.getCentroid());
+ Assertions.assertNull(posHalfSpace.getCentroid());
+ Assertions.assertNull(negHalfSpace.getCentroid());
}
@Test
@@ -985,7 +985,7 @@ public class RegionBSPTree1DTest {
final RegionBSPTree1D tree = RegionBSPTree1D.empty();
// act/assert
- Assert.assertNull(tree.getCentroid());
+ Assertions.assertNull(tree.getCentroid());
}
@Test
@@ -1088,11 +1088,11 @@ public class RegionBSPTree1DTest {
negHalfSpace.getRoot().cut(OrientedPoints.createPositiveFacing(3.0, TEST_PRECISION));
// act/assert
- Assert.assertEquals(-2, posHalfSpace.getMin(), TEST_EPS);
+ Assertions.assertEquals(-2, posHalfSpace.getMin(), TEST_EPS);
GeometryTestUtils.assertPositiveInfinity(posHalfSpace.getMax());
GeometryTestUtils.assertNegativeInfinity(negHalfSpace.getMin());
- Assert.assertEquals(3, negHalfSpace.getMax(), TEST_EPS);
+ Assertions.assertEquals(3, negHalfSpace.getMax(), TEST_EPS);
}
@Test
@@ -1105,8 +1105,8 @@ public class RegionBSPTree1DTest {
));
// act/assert
- Assert.assertEquals(-4, tree.getMin(), TEST_EPS);
- Assert.assertEquals(5, tree.getMax(), TEST_EPS);
+ Assertions.assertEquals(-4, tree.getMin(), TEST_EPS);
+ Assertions.assertEquals(5, tree.getMax(), TEST_EPS);
}
@Test
@@ -1119,8 +1119,8 @@ public class RegionBSPTree1DTest {
));
// act/assert
- Assert.assertEquals(-4, tree.getMin(), TEST_EPS);
- Assert.assertEquals(5, tree.getMax(), TEST_EPS);
+ Assertions.assertEquals(-4, tree.getMin(), TEST_EPS);
+ Assertions.assertEquals(5, tree.getMax(), TEST_EPS);
}
@Test
@@ -1129,9 +1129,9 @@ public class RegionBSPTree1DTest {
final RegionBSPTree1D tree = RegionBSPTree1D.full();
// assert
- Assert.assertTrue(tree.isFull());
- Assert.assertFalse(tree.isEmpty());
- Assert.assertNotSame(tree, RegionBSPTree1D.full());
+ Assertions.assertTrue(tree.isFull());
+ Assertions.assertFalse(tree.isEmpty());
+ Assertions.assertNotSame(tree, RegionBSPTree1D.full());
}
@Test
@@ -1140,9 +1140,9 @@ public class RegionBSPTree1DTest {
final RegionBSPTree1D tree = RegionBSPTree1D.empty();
// assert
- Assert.assertFalse(tree.isFull());
- Assert.assertTrue(tree.isEmpty());
- Assert.assertNotSame(tree, RegionBSPTree1D.full());
+ Assertions.assertFalse(tree.isFull());
+ Assertions.assertTrue(tree.isEmpty());
+ Assertions.assertNotSame(tree, RegionBSPTree1D.full());
}
@Test
@@ -1154,14 +1154,14 @@ public class RegionBSPTree1DTest {
));
// assert
- Assert.assertFalse(tree.isFull());
- Assert.assertFalse(tree.isEmpty());
+ Assertions.assertFalse(tree.isFull());
+ Assertions.assertFalse(tree.isEmpty());
checkClassify(tree, RegionLocation.INSIDE, 1.5, 3.5);
checkClassify(tree, RegionLocation.BOUNDARY, 1, 2, 3, 4);
checkClassify(tree, RegionLocation.OUTSIDE, 0, 2.5, 5);
- Assert.assertEquals(2, tree.toIntervals().size());
+ Assertions.assertEquals(2, tree.toIntervals().size());
}
@Test
@@ -1170,10 +1170,10 @@ public class RegionBSPTree1DTest {
final RegionBSPTree1D tree = RegionBSPTree1D.from(Collections.emptyList());
// assert
- Assert.assertFalse(tree.isFull());
- Assert.assertTrue(tree.isEmpty());
+ Assertions.assertFalse(tree.isFull());
+ Assertions.assertTrue(tree.isEmpty());
- Assert.assertEquals(0, tree.toIntervals().size());
+ Assertions.assertEquals(0, tree.toIntervals().size());
}
@Test
@@ -1185,22 +1185,22 @@ public class RegionBSPTree1DTest {
);
// assert
- Assert.assertFalse(tree.isFull());
- Assert.assertFalse(tree.isEmpty());
+ Assertions.assertFalse(tree.isFull());
+ Assertions.assertFalse(tree.isEmpty());
checkClassify(tree, RegionLocation.INSIDE, 1.5, 3.5);
checkClassify(tree, RegionLocation.BOUNDARY, 1, 2, 3, 4);
checkClassify(tree, RegionLocation.OUTSIDE, 0, 2.5, 5);
- Assert.assertEquals(2, tree.toIntervals().size());
+ Assertions.assertEquals(2, tree.toIntervals().size());
}
private static void checkClassify(final RegionBSPTree1D tree, final RegionLocation loc, final double... points) {
for (final double x : points) {
final String msg = "Unexpected location for point " + x;
- Assert.assertEquals(msg, loc, tree.classify(x));
- Assert.assertEquals(msg, loc, tree.classify(Vector1D.of(x)));
+ Assertions.assertEquals(loc, tree.classify(x), msg);
+ Assertions.assertEquals(loc, tree.classify(Vector1D.of(x)), msg);
}
}
@@ -1208,8 +1208,8 @@ public class RegionBSPTree1DTest {
for (final double x : points) {
final String msg = "Unexpected contains status for point " + x;
- Assert.assertEquals(msg, contains, tree.contains(x));
- Assert.assertEquals(msg, contains, tree.contains(Vector1D.of(x)));
+ Assertions.assertEquals(contains, tree.contains(x), msg);
+ Assertions.assertEquals(contains, tree.contains(Vector1D.of(x)), msg);
}
}
@@ -1218,7 +1218,7 @@ public class RegionBSPTree1DTest {
final Vector1D proj = tree.project(pt);
- Assert.assertEquals(projectedLocation, proj.getX(), TEST_EPS);
+ Assertions.assertEquals(projectedLocation, proj.getX(), TEST_EPS);
}
private static void checkInterval(final Interval interval, final double min, final double max) {
@@ -1226,7 +1226,7 @@ public class RegionBSPTree1DTest {
}
private static void checkInterval(final Interval interval, final double min, final double max, final DoublePrecisionContext precision) {
- Assert.assertEquals(min, interval.getMin(), TEST_EPS);
- Assert.assertEquals(max, interval.getMax(), TEST_EPS);
+ Assertions.assertEquals(min, interval.getMin(), TEST_EPS);
+ Assertions.assertEquals(max, interval.getMax(), TEST_EPS);
}
}
diff --git a/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/oned/Vector1DTest.java b/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/oned/Vector1DTest.java
index ce93fd4..f36c632 100644
--- a/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/oned/Vector1DTest.java
+++ b/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/oned/Vector1DTest.java
@@ -24,8 +24,10 @@ import org.apache.commons.geometry.core.precision.DoublePrecisionContext;
import org.apache.commons.geometry.core.precision.EpsilonDoublePrecisionContext;
import org.apache.commons.numbers.angle.PlaneAngleRadians;
import org.apache.commons.numbers.core.Precision;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertThrows;
public class Vector1DTest {
@@ -50,8 +52,8 @@ public class Vector1DTest {
GeometryTestUtils.assertThrows(Vector1D.POSITIVE_INFINITY::normalize, IllegalArgumentException.class);
GeometryTestUtils.assertThrows(Vector1D.NEGATIVE_INFINITY::normalize, IllegalArgumentException.class);
- Assert.assertSame(Vector1D.Unit.PLUS, Vector1D.Unit.PLUS.normalize());
- Assert.assertSame(Vector1D.Unit.MINUS, Vector1D.Unit.MINUS.normalize());
+ Assertions.assertSame(Vector1D.Unit.PLUS, Vector1D.Unit.PLUS.normalize());
+ Assertions.assertSame(Vector1D.Unit.MINUS, Vector1D.Unit.MINUS.normalize());
}
@Test
@@ -60,25 +62,25 @@ public class Vector1DTest {
final Comparator<Vector1D> cmp = Vector1D.COORDINATE_ASCENDING_ORDER;
// act/assert
- Assert.assertEquals(0, cmp.compare(Vector1D.of(1), Vector1D.of(1)));
- Assert.assertEquals(1, cmp.compare(Vector1D.of(2), Vector1D.of(1)));
- Assert.assertEquals(-1, cmp.compare(Vector1D.of(0), Vector1D.of(1)));
+ Assertions.assertEquals(0, cmp.compare(Vector1D.of(1), Vector1D.of(1)));
+ Assertions.assertEquals(1, cmp.compare(Vector1D.of(2), Vector1D.of(1)));
+ Assertions.assertEquals(-1, cmp.compare(Vector1D.of(0), Vector1D.of(1)));
- Assert.assertEquals(0, cmp.compare(Vector1D.of(0), Vector1D.of(0)));
- Assert.assertEquals(1, cmp.compare(Vector1D.of(1e-15), Vector1D.of(0)));
- Assert.assertEquals(-1, cmp.compare(Vector1D.of(-1e-15), Vector1D.of(0)));
+ Assertions.assertEquals(0, cmp.compare(Vector1D.of(0), Vector1D.of(0)));
+ Assertions.assertEquals(1, cmp.compare(Vector1D.of(1e-15), Vector1D.of(0)));
+ Assertions.assertEquals(-1, cmp.compare(Vector1D.of(-1e-15), Vector1D.of(0)));
- Assert.assertEquals(-1, cmp.compare(Vector1D.of(1), null));
- Assert.assertEquals(1, cmp.compare(null, Vector1D.of(1)));
- Assert.assertEquals(0, cmp.compare(null, null));
+ Assertions.assertEquals(-1, cmp.compare(Vector1D.of(1), null));
+ Assertions.assertEquals(1, cmp.compare(null, Vector1D.of(1)));
+ Assertions.assertEquals(0, cmp.compare(null, null));
}
@Test
public void testCoordinates() {
// act/assert
- Assert.assertEquals(-1, Vector1D.of(-1).getX(), 0.0);
- Assert.assertEquals(0, Vector1D.of(0).getX(), 0.0);
- Assert.assertEquals(1, Vector1D.of(1).getX(), 0.0);
+ Assertions.assertEquals(-1, Vector1D.of(-1).getX(), 0.0);
+ Assertions.assertEquals(0, Vector1D.of(0).getX(), 0.0);
+ Assertions.assertEquals(1, Vector1D.of(1).getX(), 0.0);
}
@Test
@@ -87,38 +89,38 @@ public class Vector1DTest {
final Vector1D v = Vector1D.of(2);
// act/assert
- Assert.assertEquals(1, v.getDimension());
+ Assertions.assertEquals(1, v.getDimension());
}
@Test
public void testNaN() {
// act/assert
- Assert.assertTrue(Vector1D.of(Double.NaN).isNaN());
+ Assertions.assertTrue(Vector1D.of(Double.NaN).isNaN());
- Assert.assertFalse(Vector1D.of(1).isNaN());
- Assert.assertFalse(Vector1D.of(Double.NEGATIVE_INFINITY).isNaN());
+ Assertions.assertFalse(Vector1D.of(1).isNaN());
+ Assertions.assertFalse(Vector1D.of(Double.NEGATIVE_INFINITY).isNaN());
}
@Test
public void testInfinite() {
// act/assert
- Assert.assertTrue(Vector1D.of(Double.NEGATIVE_INFINITY).isInfinite());
- Assert.assertTrue(Vector1D.of(Double.POSITIVE_INFINITY).isInfinite());
+ Assertions.assertTrue(Vector1D.of(Double.NEGATIVE_INFINITY).isInfinite());
+ Assertions.assertTrue(Vector1D.of(Double.POSITIVE_INFINITY).isInfinite());
- Assert.assertFalse(Vector1D.of(1).isInfinite());
- Assert.assertFalse(Vector1D.of(Double.NaN).isInfinite());
+ Assertions.assertFalse(Vector1D.of(1).isInfinite());
+ Assertions.assertFalse(Vector1D.of(Double.NaN).isInfinite());
}
@Test
public void testFinite() {
// act/assert
- Assert.assertTrue(Vector1D.ZERO.isFinite());
- Assert.assertTrue(Vector1D.of(1).isFinite());
+ Assertions.assertTrue(Vector1D.ZERO.isFinite());
+ Assertions.assertTrue(Vector1D.of(1).isFinite());
- Assert.assertFalse(Vector1D.of(Double.NEGATIVE_INFINITY).isFinite());
- Assert.assertFalse(Vector1D.of(Double.POSITIVE_INFINITY).isFinite());
+ Assertions.assertFalse(Vector1D.of(Double.NEGATIVE_INFINITY).isFinite());
+ Assertions.assertFalse(Vector1D.of(Double.POSITIVE_INFINITY).isFinite());
- Assert.assertFalse(Vector1D.of(Double.NaN).isFinite());
+ Assertions.assertFalse(Vector1D.of(Double.NaN).isFinite());
}
@Test
@@ -134,9 +136,9 @@ public class Vector1DTest {
@Test
public void testNorm() {
// act/assert
- Assert.assertEquals(0.0, Vector1D.ZERO.norm(), TEST_TOLERANCE);
- Assert.assertEquals(3.0, Vector1D.of(3).norm(), TEST_TOLERANCE);
- Assert.assertEquals(3.0, Vector1D.of(-3).norm(), TEST_TOLERANCE);
+ Assertions.assertEquals(0.0, Vector1D.ZERO.norm(), TEST_TOLERANCE);
+ Assertions.assertEquals(3.0, Vector1D.of(3).norm(), TEST_TOLERANCE);
+ Assertions.assertEquals(3.0, Vector1D.of(-3).norm(), TEST_TOLERANCE);
}
@Test
@@ -145,15 +147,15 @@ public class Vector1DTest {
final Vector1D v = Vector1D.of(2.0).normalize();
// act/assert
- Assert.assertEquals(1.0, v.norm(), 0.0);
+ Assertions.assertEquals(1.0, v.norm(), 0.0);
}
@Test
public void testNormSq() {
// act/assert
- Assert.assertEquals(0.0, Vector1D.of(0).normSq(), TEST_TOLERANCE);
- Assert.assertEquals(9.0, Vector1D.of(3).normSq(), TEST_TOLERANCE);
- Assert.assertEquals(9.0, Vector1D.of(-3).normSq(), TEST_TOLERANCE);
+ Assertions.assertEquals(0.0, Vector1D.of(0).normSq(), TEST_TOLERANCE);
+ Assertions.assertEquals(9.0, Vector1D.of(3).normSq(), TEST_TOLERANCE);
+ Assertions.assertEquals(9.0, Vector1D.of(-3).normSq(), TEST_TOLERANCE);
}
@Test
@@ -162,7 +164,7 @@ public class Vector1DTest {
final Vector1D v = Vector1D.of(2.0).normalize();
// act/assert
- Assert.assertEquals(1.0, v.normSq(), 0.0);
+ Assertions.assertEquals(1.0, v.normSq(), 0.0);
}
@Test
@@ -200,7 +202,7 @@ public class Vector1DTest {
checkVector(Vector1D.Unit.MINUS.withNorm(3.14), -3.14);
for (double mag = -10.0; mag <= 10.0; ++mag) {
- Assert.assertEquals(Math.abs(mag), v.withNorm(mag).norm(), TEST_TOLERANCE);
+ Assertions.assertEquals(Math.abs(mag), v.withNorm(mag).norm(), TEST_TOLERANCE);
}
}
@@ -294,7 +296,7 @@ public class Vector1DTest {
final Vector1D v = Vector1D.of(2).normalize();
// act/assert
- Assert.assertSame(v, v.normalize());
+ Assertions.assertSame(v, v.normalize());
checkVector(v.normalize(), 1.0);
}
@@ -333,13 +335,13 @@ public class Vector1DTest {
final Vector1D v2 = Vector1D.of(-4);
// act/assert
- Assert.assertEquals(0.0, v1.distance(v1), TEST_TOLERANCE);
+ Assertions.assertEquals(0.0, v1.distance(v1), TEST_TOLERANCE);
- Assert.assertEquals(5.0, v1.distance(v2), TEST_TOLERANCE);
- Assert.assertEquals(5.0, v2.distance(v1), TEST_TOLERANCE);
- Assert.assertEquals(v1.subtract(v2).norm(), v1.distance(v2), TEST_TOLERANCE);
+ Assertions.assertEquals(5.0, v1.distance(v2), TEST_TOLERANCE);
+ Assertions.assertEquals(5.0, v2.distance(v1), TEST_TOLERANCE);
+ Assertions.assertEquals(v1.subtract(v2).norm(), v1.distance(v2), TEST_TOLERANCE);
- Assert.assertEquals(0.0, Vector1D.of(-1).distance(Vector1D.of(-1)), TEST_TOLERANCE);
+ Assertions.assertEquals(0.0, Vector1D.of(-1).distance(Vector1D.of(-1)), TEST_TOLERANCE);
}
@Test
@@ -349,9 +351,9 @@ public class Vector1DTest {
final Vector1D v2 = Vector1D.of(-4);
// act/assert
- Assert.assertEquals(0.0, Vector1D.of(-1).distanceSq(Vector1D.of(-1)), TEST_TOLERANCE);
- Assert.assertEquals(25.0, v1.distanceSq(v2), TEST_TOLERANCE);
- Assert.assertEquals(25.0, v2.distanceSq(v1), TEST_TOLERANCE);
+ Assertions.assertEquals(0.0, Vector1D.of(-1).distanceSq(Vector1D.of(-1)), TEST_TOLERANCE);
+ Assertions.assertEquals(25.0, v1.distanceSq(v2), TEST_TOLERANCE);
+ Assertions.assertEquals(25.0, v2.distanceSq(v1), TEST_TOLERANCE);
}
@Test
@@ -362,11 +364,11 @@ public class Vector1DTest {
final Vector1D v3 = Vector1D.of(3);
// act/assert
- Assert.assertEquals(-6.0, v1.dot(v2), TEST_TOLERANCE);
- Assert.assertEquals(-6.0, v2.dot(v1), TEST_TOLERANCE);
+ Assertions.assertEquals(-6.0, v1.dot(v2), TEST_TOLERANCE);
+ Assertions.assertEquals(-6.0, v2.dot(v1), TEST_TOLERANCE);
- Assert.assertEquals(6.0, v1.dot(v3), TEST_TOLERANCE);
- Assert.assertEquals(6.0, v3.dot(v1), TEST_TOLERANCE);
+ Assertions.assertEquals(6.0, v1.dot(v3), TEST_TOLERANCE);
+ Assertions.assertEquals(6.0, v3.dot(v1), TEST_TOLERANCE);
}
@Test
@@ -378,25 +380,25 @@ public class Vector1DTest {
final Vector1D v4 = Vector1D.of(-5);
// act/assert
- Assert.assertEquals(0.0, v1.angle(v1), TEST_TOLERANCE);
- Assert.assertEquals(PlaneAngleRadians.PI, v1.angle(v2), TEST_TOLERANCE);
- Assert.assertEquals(0.0, v1.angle(v3), TEST_TOLERANCE);
- Assert.assertEquals(PlaneAngleRadians.PI, v1.angle(v4), TEST_TOLERANCE);
+ Assertions.assertEquals(0.0, v1.angle(v1), TEST_TOLERANCE);
+ Assertions.assertEquals(PlaneAngleRadians.PI, v1.angle(v2), TEST_TOLERANCE);
+ Assertions.assertEquals(0.0, v1.angle(v3), TEST_TOLERANCE);
+ Assertions.assertEquals(PlaneAngleRadians.PI, v1.angle(v4), TEST_TOLERANCE);
- Assert.assertEquals(PlaneAngleRadians.PI, v2.angle(v1), TEST_TOLERANCE);
- Assert.assertEquals(0.0, v2.angle(v2), TEST_TOLERANCE);
- Assert.assertEquals(PlaneAngleRadians.PI, v2.angle(v3), TEST_TOLERANCE);
- Assert.assertEquals(0.0, v2.angle(v4), TEST_TOLERANCE);
+ Assertions.assertEquals(PlaneAngleRadians.PI, v2.angle(v1), TEST_TOLERANCE);
+ Assertions.assertEquals(0.0, v2.angle(v2), TEST_TOLERANCE);
+ Assertions.assertEquals(PlaneAngleRadians.PI, v2.angle(v3), TEST_TOLERANCE);
+ Assertions.assertEquals(0.0, v2.angle(v4), TEST_TOLERANCE);
- Assert.assertEquals(0.0, v3.angle(v1), TEST_TOLERANCE);
- Assert.assertEquals(PlaneAngleRadians.PI, v3.angle(v2), TEST_TOLERANCE);
- Assert.assertEquals(0.0, v3.angle(v3), TEST_TOLERANCE);
- Assert.assertEquals(PlaneAngleRadians.PI, v3.angle(v4), TEST_TOLERANCE);
+ Assertions.assertEquals(0.0, v3.angle(v1), TEST_TOLERANCE);
+ Assertions.assertEquals(PlaneAngleRadians.PI, v3.angle(v2), TEST_TOLERANCE);
+ Assertions.assertEquals(0.0, v3.angle(v3), TEST_TOLERANCE);
+ Assertions.assertEquals(PlaneAngleRadians.PI, v3.angle(v4), TEST_TOLERANCE);
- Assert.assertEquals(PlaneAngleRadians.PI, v4.angle(v1), TEST_TOLERANCE);
- Assert.assertEquals(0.0, v4.angle(v2), TEST_TOLERANCE);
- Assert.assertEquals(PlaneAngleRadians.PI, v4.angle(v3), TEST_TOLERANCE);
- Assert.assertEquals(0.0, v4.angle(v4), TEST_TOLERANCE);
+ Assertions.assertEquals(PlaneAngleRadians.PI, v4.angle(v1), TEST_TOLERANCE);
+ Assertions.assertEquals(0.0, v4.angle(v2), TEST_TOLERANCE);
+ Assertions.assertEquals(PlaneAngleRadians.PI, v4.angle(v3), TEST_TOLERANCE);
+ Assertions.assertEquals(0.0, v4.angle(v4), TEST_TOLERANCE);
}
@Test
@@ -529,17 +531,17 @@ public class Vector1DTest {
final Vector1D vec = Vector1D.of(1);
// act/assert
- Assert.assertTrue(vec.eq(vec, smallEps));
- Assert.assertTrue(vec.eq(vec, largeEps));
+ Assertions.assertTrue(vec.eq(vec, smallEps));
+ Assertions.assertTrue(vec.eq(vec, largeEps));
- Assert.assertTrue(vec.eq(Vector1D.of(1.0000007), smallEps));
- Assert.assertTrue(vec.eq(Vector1D.of(1.0000007), largeEps));
+ Assertions.assertTrue(vec.eq(Vector1D.of(1.0000007), smallEps));
+ Assertions.assertTrue(vec.eq(Vector1D.of(1.0000007), largeEps));
- Assert.assertFalse(vec.eq(Vector1D.of(1.004), smallEps));
- Assert.assertTrue(vec.eq(Vector1D.of(1.004), largeEps));
+ Assertions.assertFalse(vec.eq(Vector1D.of(1.004), smallEps));
+ Assertions.assertTrue(vec.eq(Vector1D.of(1.004), largeEps));
- Assert.assertFalse(vec.eq(Vector1D.of(2), smallEps));
- Assert.assertFalse(vec.eq(Vector1D.of(-2), largeEps));
+ Assertions.assertFalse(vec.eq(Vector1D.of(2), smallEps));
+ Assertions.assertFalse(vec.eq(Vector1D.of(-2), largeEps));
}
@Test
@@ -549,17 +551,17 @@ public class Vector1DTest {
final DoublePrecisionContext largeEps = new EpsilonDoublePrecisionContext(1e-1);
// act/assert
- Assert.assertTrue(Vector1D.of(0.0).isZero(smallEps));
- Assert.assertTrue(Vector1D.of(-0.0).isZero(largeEps));
+ Assertions.assertTrue(Vector1D.of(0.0).isZero(smallEps));
+ Assertions.assertTrue(Vector1D.of(-0.0).isZero(largeEps));
- Assert.assertTrue(Vector1D.of(1e-7).isZero(smallEps));
- Assert.assertTrue(Vector1D.of(-1e-7).isZero(largeEps));
+ Assertions.assertTrue(Vector1D.of(1e-7).isZero(smallEps));
+ Assertions.assertTrue(Vector1D.of(-1e-7).isZero(largeEps));
- Assert.assertFalse(Vector1D.of(1e-2).isZero(smallEps));
- Assert.assertTrue(Vector1D.of(-1e-2).isZero(largeEps));
+ Assertions.assertFalse(Vector1D.of(1e-2).isZero(smallEps));
+ Assertions.assertTrue(Vector1D.of(-1e-2).isZero(largeEps));
- Assert.assertFalse(Vector1D.of(0.2).isZero(smallEps));
- Assert.assertFalse(Vector1D.of(-0.2).isZero(largeEps));
+ Assertions.assertFalse(Vector1D.of(0.2).isZero(smallEps));
+ Assertions.assertFalse(Vector1D.of(-0.2).isZero(largeEps));
}
@Test
@@ -570,11 +572,11 @@ public class Vector1DTest {
final Vector1D w = Vector1D.of(1);
// act/assert
- Assert.assertTrue(u.hashCode() != v.hashCode());
- Assert.assertEquals(u.hashCode(), w.hashCode());
+ Assertions.assertTrue(u.hashCode() != v.hashCode());
+ Assertions.assertEquals(u.hashCode(), w.hashCode());
- Assert.assertEquals(Vector1D.of(Double.NaN).hashCode(), Vector1D.NaN.hashCode());
- Assert.assertEquals(Vector1D.of(Double.NaN).hashCode(), Vector1D.of(Double.NaN).hashCode());
+ Assertions.assertEquals(Vector1D.of(Double.NaN).hashCode(), Vector1D.NaN.hashCode());
+ Assertions.assertEquals(Vector1D.of(Double.NaN).hashCode(), Vector1D.of(Double.NaN).hashCode());
}
@Test
@@ -585,14 +587,14 @@ public class Vector1DTest {
// act/assert
GeometryTestUtils.assertSimpleEqualsCases(u1);
- Assert.assertEquals(u1, u2);
+ Assertions.assertEquals(u1, u2);
- Assert.assertNotEquals(u1, Vector1D.of(-1));
- Assert.assertNotEquals(u1, Vector1D.of(1 + 10 * Precision.EPSILON));
+ Assertions.assertNotEquals(u1, Vector1D.of(-1));
+ Assertions.assertNotEquals(u1, Vector1D.of(1 + 10 * Precision.EPSILON));
- Assert.assertEquals(Vector1D.of(Double.NaN), Vector1D.of(Double.NaN));
- Assert.assertEquals(Vector1D.of(Double.POSITIVE_INFINITY), Vector1D.of(Double.POSITIVE_INFINITY));
- Assert.assertEquals(Vector1D.of(Double.NEGATIVE_INFINITY), Vector1D.of(Double.NEGATIVE_INFINITY));
+ Assertions.assertEquals(Vector1D.of(Double.NaN), Vector1D.of(Double.NaN));
+ Assertions.assertEquals(Vector1D.of(Double.POSITIVE_INFINITY), Vector1D.of(Double.POSITIVE_INFINITY));
+ Assertions.assertEquals(Vector1D.of(Double.NEGATIVE_INFINITY), Vector1D.of(Double.NEGATIVE_INFINITY));
}
@Test
@@ -604,14 +606,14 @@ public class Vector1DTest {
final Vector1D d = Vector1D.of(-0.0);
// act/assert
- Assert.assertFalse(a.equals(b));
- Assert.assertNotEquals(a.hashCode(), b.hashCode());
+ Assertions.assertFalse(a.equals(b));
+ Assertions.assertNotEquals(a.hashCode(), b.hashCode());
- Assert.assertTrue(a.equals(c));
- Assert.assertEquals(a.hashCode(), c.hashCode());
+ Assertions.assertTrue(a.equals(c));
+ Assertions.assertEquals(a.hashCode(), c.hashCode());
- Assert.assertTrue(b.equals(d));
- Assert.assertEquals(b.hashCode(), d.hashCode());
+ Assertions.assertTrue(b.equals(d));
+ Assertions.assertEquals(b.hashCode(), d.hashCode());
}
@Test
@@ -624,8 +626,7 @@ public class Vector1DTest {
final String str = v.toString();
// assert
- Assert.assertTrue("Expected string " + str + " to match regex " + pattern,
- pattern.matcher(str).matches());
+ Assertions.assertTrue(pattern.matcher(str).matches(), "Expected string " + str + " to match regex " + pattern);
}
@Test
@@ -643,10 +644,10 @@ public class Vector1DTest {
checkVector(Vector1D.parse(Vector1D.Unit.PLUS.toString()), 1);
}
- @Test(expected = IllegalArgumentException.class)
+ @Test
public void testParse_failure() {
// act/assert
- Vector1D.parse("abc");
+ assertThrows(IllegalArgumentException.class, () -> Vector1D.parse("abc"));
}
@Test
@@ -676,7 +677,7 @@ public class Vector1DTest {
// act/assert
checkVector(Vector1D.Unit.from(vec), 1);
- Assert.assertSame(unitVec, Vector1D.Unit.from(unitVec));
+ Assertions.assertSame(unitVec, Vector1D.Unit.from(unitVec));
}
@Test
@@ -741,10 +742,10 @@ public class Vector1DTest {
public void testUnitFactoryOptimization() {
// An already normalized vector will avoid unnecessary creation.
final Vector1D v = Vector1D.of(3).normalize();
- Assert.assertSame(v, v.normalize());
+ Assertions.assertSame(v, v.normalize());
}
private void checkVector(final Vector1D v, final double x) {
- Assert.assertEquals(x, v.getX(), TEST_TOLERANCE);
+ Assertions.assertEquals(x, v.getX(), TEST_TOLERANCE);
}
}
diff --git a/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/threed/AffineTransformMatrix3DTest.java b/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/threed/AffineTransformMatrix3DTest.java
index 971a798..7669812 100644
--- a/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/threed/AffineTransformMatrix3DTest.java
+++ b/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/threed/AffineTransformMatrix3DTest.java
@@ -26,8 +26,8 @@ import org.apache.commons.geometry.euclidean.EuclideanTestUtils.PermuteCallback3
import org.apache.commons.geometry.euclidean.threed.rotation.QuaternionRotation;
import org.apache.commons.geometry.euclidean.threed.rotation.StandardRotations;
import org.apache.commons.numbers.angle.PlaneAngleRadians;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
public class AffineTransformMatrix3DTest {
@@ -50,8 +50,8 @@ public class AffineTransformMatrix3DTest {
// assert
final double[] result = transform.toArray();
- Assert.assertNotSame(arr, result);
- Assert.assertArrayEquals(arr, result, 0.0);
+ Assertions.assertNotSame(arr, result);
+ Assertions.assertArrayEquals(arr, result, 0.0);
}
@Test
@@ -72,7 +72,7 @@ public class AffineTransformMatrix3DTest {
final AffineTransformMatrix3D transform = AffineTransformMatrix3D.fromColumnVectors(u, v, w);
// assert
- Assert.assertArrayEquals(new double[] {
+ Assertions.assertArrayEquals(new double[] {
1, 4, 7, 0,
2, 5, 8, 0,
3, 6, 9, 0
@@ -91,7 +91,7 @@ public class AffineTransformMatrix3DTest {
final AffineTransformMatrix3D transform = AffineTransformMatrix3D.fromColumnVectors(u, v, w, t);
// assert
- Assert.assertArrayEquals(new double[] {
+ Assertions.assertArrayEquals(new double[] {
1, 4, 7, 10,
2, 5, 8, 11,
3, 6, 9, 12
@@ -101,22 +101,22 @@ public class AffineTransformMatrix3DTest {
@Test
public void testFrom() {
// act/assert
- Assert.assertArrayEquals(new double[] {
+ Assertions.assertArrayEquals(new double[] {
1, 0, 0, 0,
0, 1, 0, 0,
0, 0, 1, 0
}, AffineTransformMatrix3D.from(UnaryOperator.identity()).toArray(), EPS);
- Assert.assertArrayEquals(new double[] {
+ Assertions.assertArrayEquals(new double[] {
1, 0, 0, 2,
0, 1, 0, 3,
0, 0, 1, -4
}, AffineTransformMatrix3D.from(v -> v.add(Vector3D.of(2, 3, -4))).toArray(), EPS);
- Assert.assertArrayEquals(new double[] {
+ Assertions.assertArrayEquals(new double[] {
3, 0, 0, 0,
0, 3, 0, 0,
0, 0, 3, 0
}, AffineTransformMatrix3D.from(v -> v.multiply(3)).toArray(), EPS);
- Assert.assertArrayEquals(new double[] {
+ Assertions.assertArrayEquals(new double[] {
3, 0, 0, 6,
0, 3, 0, 9,
0, 0, 3, 12
@@ -142,7 +142,7 @@ public class AffineTransformMatrix3DTest {
0, 1, 0, 0,
0, 0, 1, 0
};
- Assert.assertArrayEquals(expected, transform.toArray(), 0.0);
+ Assertions.assertArrayEquals(expected, transform.toArray(), 0.0);
}
@Test
@@ -156,7 +156,7 @@ public class AffineTransformMatrix3DTest {
0, 1, 0, 3,
0, 0, 1, 4
};
- Assert.assertArrayEquals(expected, transform.toArray(), 0.0);
+ Assertions.assertArrayEquals(expected, transform.toArray(), 0.0);
}
@Test
@@ -170,7 +170,7 @@ public class AffineTransformMatrix3DTest {
0, 1, 0, 6,
0, 0, 1, 7
};
- Assert.assertArrayEquals(expected, transform.toArray(), 0.0);
+ Assertions.assertArrayEquals(expected, transform.toArray(), 0.0);
}
@Test
@@ -184,7 +184,7 @@ public class AffineTransformMatrix3DTest {
0, 3, 0, 0,
0, 0, 4, 0
};
- Assert.assertArrayEquals(expected, transform.toArray(), 0.0);
+ Assertions.assertArrayEquals(expected, transform.toArray(), 0.0);
}
@Test
@@ -205,7 +205,7 @@ public class AffineTransformMatrix3DTest {
0, 3, 0, 16,
0, 0, 4, 18
};
- Assert.assertArrayEquals(expected, result.toArray(), 0.0);
+ Assertions.assertArrayEquals(expected, result.toArray(), 0.0);
}
@Test
@@ -226,7 +226,7 @@ public class AffineTransformMatrix3DTest {
0, 3, 0, 19,
0, 0, 4, 21
};
- Assert.assertArrayEquals(expected, result.toArray(), 0.0);
+ Assertions.assertArrayEquals(expected, result.toArray(), 0.0);
}
@Test
@@ -240,7 +240,7 @@ public class AffineTransformMatrix3DTest {
0, 5, 0, 0,
0, 0, 6, 0
};
- Assert.assertArrayEquals(expected, transform.toArray(), 0.0);
+ Assertions.assertArrayEquals(expected, transform.toArray(), 0.0);
}
@Test
@@ -254,7 +254,7 @@ public class AffineTransformMatrix3DTest {
0, 7, 0, 0,
0, 0, 7, 0
};
- Assert.assertArrayEquals(expected, transform.toArray(), 0.0);
+ Assertions.assertArrayEquals(expected, transform.toArray(), 0.0);
}
@Test
@@ -275,7 +275,7 @@ public class AffineTransformMatrix3DTest {
0, 15, 0, 55,
0, 0, 24, 72
};
- Assert.assertArrayEquals(expected, result.toArray(), 0.0);
+ Assertions.assertArrayEquals(expected, result.toArray(), 0.0);
}
@Test
@@ -296,7 +296,7 @@ public class AffineTransformMatrix3DTest {
0, 24, 0, 88,
0, 0, 36, 108
};
- Assert.assertArrayEquals(expected, result.toArray(), 0.0);
+ Assertions.assertArrayEquals(expected, result.toArray(), 0.0);
}
@Test
@@ -317,7 +317,7 @@ public class AffineTransformMatrix3DTest {
0, 30, 0, 110,
0, 0, 40, 120
};
- Assert.assertArrayEquals(expected, result.toArray(), 0.0);
+ Assertions.assertArrayEquals(expected, result.toArray(), 0.0);
}
@Test
@@ -335,7 +335,7 @@ public class AffineTransformMatrix3DTest {
1, 0, 0, 1,
0, 0, 1, 0
};
- Assert.assertArrayEquals(expected, result.toArray(), EPS);
+ Assertions.assertArrayEquals(expected, result.toArray(), EPS);
}
@Test
@@ -358,7 +358,7 @@ public class AffineTransformMatrix3DTest {
1, 2, 3, 4,
9, 10, 11, 12
};
- Assert.assertArrayEquals(expected, result.toArray(), EPS);
+ Assertions.assertArrayEquals(expected, result.toArray(), EPS);
}
@Test
@@ -382,7 +382,7 @@ public class AffineTransformMatrix3DTest {
1, 2, 3, 5,
9, 10, 11, 12
};
- Assert.assertArrayEquals(expected, result.toArray(), EPS);
+ Assertions.assertArrayEquals(expected, result.toArray(), EPS);
}
@Test
@@ -688,7 +688,7 @@ public class AffineTransformMatrix3DTest {
// assert
final double[] arr = result.toArray();
- Assert.assertArrayEquals(new double[] {
+ Assertions.assertArrayEquals(new double[] {
110, 116, 122, 132,
314, 332, 350, 376,
518, 548, 578, 620
@@ -698,33 +698,33 @@ public class AffineTransformMatrix3DTest {
@Test
public void testDeterminant() {
// act/assert
- Assert.assertEquals(1.0, AffineTransformMatrix3D.identity().determinant(), EPS);
- Assert.assertEquals(1.0, AffineTransformMatrix3D.of(
+ Assertions.assertEquals(1.0, AffineTransformMatrix3D.identity().determinant(), EPS);
+ Assertions.assertEquals(1.0, AffineTransformMatrix3D.of(
1, 0, 0, 10,
0, 1, 0, 11,
0, 0, 1, 12
).determinant(), EPS);
- Assert.assertEquals(-1.0, AffineTransformMatrix3D.of(
+ Assertions.assertEquals(-1.0, AffineTransformMatrix3D.of(
-1, 0, 0, 10,
0, 1, 0, 11,
0, 0, 1, 12
).determinant(), EPS);
- Assert.assertEquals(1.0, AffineTransformMatrix3D.of(
+ Assertions.assertEquals(1.0, AffineTransformMatrix3D.of(
-1, 0, 0, 10,
0, -1, 0, 11,
0, 0, 1, 12
).determinant(), EPS);
- Assert.assertEquals(-1.0, AffineTransformMatrix3D.of(
+ Assertions.assertEquals(-1.0, AffineTransformMatrix3D.of(
-1, 0, 0, 10,
0, -1, 0, 11,
0, 0, -1, 12
).determinant(), EPS);
- Assert.assertEquals(49.0, AffineTransformMatrix3D.of(
+ Assertions.assertEquals(49.0, AffineTransformMatrix3D.of(
2, -3, 1, 10,
2, 0, -1, 11,
1, 4, 5, -12
).determinant(), EPS);
- Assert.assertEquals(0.0, AffineTransformMatrix3D.of(
+ Assertions.assertEquals(0.0, AffineTransformMatrix3D.of(
1, 2, 3, 0,
4, 5, 6, 0,
7, 8, 9, 0
@@ -734,36 +734,36 @@ public class AffineTransformMatrix3DTest {
@Test
public void testPreservesOrientation() {
// act/assert
- Assert.assertTrue(AffineTransformMatrix3D.identity().preservesOrientation());
- Assert.assertTrue(AffineTransformMatrix3D.of(
+ Assertions.assertTrue(AffineTransformMatrix3D.identity().preservesOrientation());
+ Assertions.assertTrue(AffineTransformMatrix3D.of(
1, 0, 0, 10,
0, 1, 0, 11,
0, 0, 1, 12
).preservesOrientation());
- Assert.assertTrue(AffineTransformMatrix3D.of(
+ Assertions.assertTrue(AffineTransformMatrix3D.of(
2, -3, 1, 10,
2, 0, -1, 11,
1, 4, 5, -12
).preservesOrientation());
- Assert.assertFalse(AffineTransformMatrix3D.of(
+ Assertions.assertFalse(AffineTransformMatrix3D.of(
-1, 0, 0, 10,
0, 1, 0, 11,
0, 0, 1, 12
).preservesOrientation());
- Assert.assertTrue(AffineTransformMatrix3D.of(
+ Assertions.assertTrue(AffineTransformMatrix3D.of(
-1, 0, 0, 10,
0, -1, 0, 11,
0, 0, 1, 12
).preservesOrientation());
- Assert.assertFalse(AffineTransformMatrix3D.of(
+ Assertions.assertFalse(AffineTransformMatrix3D.of(
-1, 0, 0, 10,
0, -1, 0, 11,
0, 0, -1, 12
).preservesOrientation());
- Assert.assertFalse(AffineTransformMatrix3D.of(
+ Assertions.assertFalse(AffineTransformMatrix3D.of(
1, 2, 3, 0,
4, 5, 6, 0,
7, 8, 9, 0
@@ -817,7 +817,7 @@ public class AffineTransformMatrix3DTest {
// assert
final double[] arr = result.toArray();
- Assert.assertArrayEquals(new double[] {
+ Assertions.assertArrayEquals(new double[] {
110, 116, 122, 132,
314, 332, 350, 376,
518, 548, 578, 620
@@ -863,7 +863,7 @@ public class AffineTransformMatrix3DTest {
0, 1, 0, 0,
0, 0, 1, 0
};
- Assert.assertArrayEquals(expected, inverse.toArray(), 0.0);
+ Assertions.assertArrayEquals(expected, inverse.toArray(), 0.0);
}
@Test
@@ -886,7 +886,7 @@ public class AffineTransformMatrix3DTest {
0, 1, 0, 0,
0, 0, 1, 0
};
- Assert.assertArrayEquals(expected, result.toArray(), EPS);
+ Assertions.assertArrayEquals(expected, result.toArray(), EPS);
}
@Test
@@ -903,7 +903,7 @@ public class AffineTransformMatrix3DTest {
0, 1, 0, 2,
0, 0, 1, -4
};
- Assert.assertArrayEquals(expected, inverse.toArray(), 0.0);
+ Assertions.assertArrayEquals(expected, inverse.toArray(), 0.0);
}
@Test
@@ -920,7 +920,7 @@ public class AffineTransformMatrix3DTest {
0, -0.5, 0, 0,
0, 0, 0.25, 0
};
- Assert.assertArrayEquals(expected, inverse.toArray(), 0.0);
+ Assertions.assertArrayEquals(expected, inverse.toArray(), 0.0);
}
@Test
@@ -940,7 +940,7 @@ public class AffineTransformMatrix3DTest {
-1, 0, 0, 3,
0, 0, 1, 0
};
- Assert.assertArrayEquals(expected, inverse.toArray(), EPS);
+ Assertions.assertArrayEquals(expected, inverse.toArray(), EPS);
}
@Test
@@ -1041,7 +1041,7 @@ public class AffineTransformMatrix3DTest {
6, 7, 8, 0,
10, 11, 12, 0
};
- Assert.assertArrayEquals(expected, result.toArray(), 0.0);
+ Assertions.assertArrayEquals(expected, result.toArray(), 0.0);
}
@Test
@@ -1061,7 +1061,7 @@ public class AffineTransformMatrix3DTest {
3, 7, 11, 0,
4, 8, 12, 0
};
- Assert.assertArrayEquals(expected, result.toArray(), 0.0);
+ Assertions.assertArrayEquals(expected, result.toArray(), 0.0);
}
@Test
@@ -1139,7 +1139,7 @@ public class AffineTransformMatrix3DTest {
final int orig = AffineTransformMatrix3D.of(values).hashCode();
final int same = AffineTransformMatrix3D.of(values).hashCode();
- Assert.assertEquals(orig, same);
+ Assertions.assertEquals(orig, same);
double[] temp;
for (int i = 0; i < values.length; ++i) {
@@ -1148,7 +1148,7 @@ public class AffineTransformMatrix3DTest {
final int modified = AffineTransformMatrix3D.of(temp).hashCode();
- Assert.assertNotEquals(orig, modified);
+ Assertions.assertNotEquals(orig, modified);
}
}
@@ -1173,7 +1173,7 @@ public class AffineTransformMatrix3DTest {
final AffineTransformMatrix3D modified = AffineTransformMatrix3D.of(temp);
- Assert.assertNotEquals(a, modified);
+ Assertions.assertNotEquals(a, modified);
}
}
@@ -1196,14 +1196,14 @@ public class AffineTransformMatrix3DTest {
final AffineTransformMatrix3D d = AffineTransformMatrix3D.of(arrWithNegZero);
// act/assert
- Assert.assertFalse(a.equals(b));
- Assert.assertNotEquals(a.hashCode(), b.hashCode());
+ Assertions.assertFalse(a.equals(b));
+ Assertions.assertNotEquals(a.hashCode(), b.hashCode());
- Assert.assertTrue(a.equals(c));
- Assert.assertEquals(a.hashCode(), c.hashCode());
+ Assertions.assertTrue(a.equals(c));
+ Assertions.assertEquals(a.hashCode(), c.hashCode());
- Assert.assertTrue(b.equals(d));
- Assert.assertEquals(b.hashCode(), d.hashCode());
+ Assertions.assertTrue(b.equals(d));
+ Assertions.assertEquals(b.hashCode(), d.hashCode());
}
@Test
@@ -1219,7 +1219,7 @@ public class AffineTransformMatrix3DTest {
final String result = a.toString();
// assert
- Assert.assertEquals(
+ Assertions.assertEquals(
"[ 1.0, 2.0, 3.0, 4.0; " +
"5.0, 6.0, 7.0, 8.0; " +
"9.0, 10.0, 11.0, 12.0 ]", result);
diff --git a/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/threed/BoundarySource3DTest.java b/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/threed/BoundarySource3DTest.java
index 0eb0fb3..16bd1d9 100644
--- a/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/threed/BoundarySource3DTest.java
+++ b/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/threed/BoundarySource3DTest.java
@@ -23,8 +23,8 @@ import java.util.stream.Collectors;
import org.apache.commons.geometry.core.precision.DoublePrecisionContext;
import org.apache.commons.geometry.core.precision.EpsilonDoublePrecisionContext;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
public class BoundarySource3DTest {
@@ -47,9 +47,9 @@ public class BoundarySource3DTest {
final RegionBSPTree3D tree = src.toTree();
// assert
- Assert.assertEquals(5, tree.count());
- Assert.assertFalse(tree.isFull());
- Assert.assertFalse(tree.isEmpty());
+ Assertions.assertEquals(5, tree.count());
+ Assertions.assertFalse(tree.isFull());
+ Assertions.assertFalse(tree.isEmpty());
}
@Test
@@ -61,9 +61,9 @@ public class BoundarySource3DTest {
final RegionBSPTree3D tree = src.toTree();
// assert
- Assert.assertEquals(1, tree.count());
- Assert.assertFalse(tree.isFull());
- Assert.assertTrue(tree.isEmpty());
+ Assertions.assertEquals(1, tree.count());
+ Assertions.assertFalse(tree.isFull());
+ Assertions.assertTrue(tree.isEmpty());
}
@Test
@@ -73,7 +73,7 @@ public class BoundarySource3DTest {
// assert
final List<PlaneConvexSubset> segments = src.boundaryStream().collect(Collectors.toList());
- Assert.assertEquals(0, segments.size());
+ Assertions.assertEquals(0, segments.size());
}
@Test
@@ -88,10 +88,10 @@ public class BoundarySource3DTest {
// assert
final List<PlaneConvexSubset> boundaries = src.boundaryStream().collect(Collectors.toList());
- Assert.assertEquals(2, boundaries.size());
+ Assertions.assertEquals(2, boundaries.size());
- Assert.assertSame(a, boundaries.get(0));
- Assert.assertSame(b, boundaries.get(1));
+ Assertions.assertSame(a, boundaries.get(0));
+ Assertions.assertSame(b, boundaries.get(1));
}
@Test
@@ -104,7 +104,7 @@ public class BoundarySource3DTest {
// assert
final List<PlaneConvexSubset> segments = src.boundaryStream().collect(Collectors.toList());
- Assert.assertEquals(0, segments.size());
+ Assertions.assertEquals(0, segments.size());
}
@Test
@@ -123,9 +123,9 @@ public class BoundarySource3DTest {
// assert
final List<PlaneConvexSubset> segments = src.boundaryStream().collect(Collectors.toList());
- Assert.assertEquals(2, segments.size());
+ Assertions.assertEquals(2, segments.size());
- Assert.assertSame(a, segments.get(0));
- Assert.assertSame(b, segments.get(1));
+ Assertions.assertSame(a, segments.get(0));
+ Assertions.assertSame(b, segments.get(1));
}
}
diff --git a/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/threed/BoundarySourceBoundsBuilder3DTest.java b/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/threed/BoundarySourceBoundsBuilder3DTest.java
index ec6e6a5..920d344 100644
--- a/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/threed/BoundarySourceBoundsBuilder3DTest.java
+++ b/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/threed/BoundarySourceBoundsBuilder3DTest.java
@@ -22,8 +22,8 @@ import java.util.Arrays;
import org.apache.commons.geometry.core.precision.DoublePrecisionContext;
import org.apache.commons.geometry.core.precision.EpsilonDoublePrecisionContext;
import org.apache.commons.geometry.euclidean.EuclideanTestUtils;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
public class BoundarySourceBoundsBuilder3DTest {
@@ -42,7 +42,7 @@ public class BoundarySourceBoundsBuilder3DTest {
final Bounds3D b = builder.getBounds(src);
// assert
- Assert.assertNull(b);
+ Assertions.assertNull(b);
}
@Test
@@ -62,7 +62,7 @@ public class BoundarySourceBoundsBuilder3DTest {
// assert
checkBounds(b, Vector3D.of(1, 0, 1), Vector3D.of(3, 4, 5));
for (final Vector3D pt : poly.getVertices()) {
- Assert.assertTrue(b.contains(pt));
+ Assertions.assertTrue(b.contains(pt));
}
}
@@ -95,7 +95,7 @@ public class BoundarySourceBoundsBuilder3DTest {
src.boundaryStream().forEach(boundary -> {
for (final Vector3D pt : boundary.getVertices()) {
- Assert.assertTrue(b.contains(pt));
+ Assertions.assertTrue(b.contains(pt));
}
});
}
@@ -112,7 +112,7 @@ public class BoundarySourceBoundsBuilder3DTest {
final Bounds3D b = builder.getBounds(src);
// assert
- Assert.assertNull(b);
+ Assertions.assertNull(b);
}
@Test
@@ -145,7 +145,7 @@ public class BoundarySourceBoundsBuilder3DTest {
final Bounds3D b = builder.getBounds(src);
// assert
- Assert.assertNull(b);
+ Assertions.assertNull(b);
}
private static void checkBounds(final Bounds3D b, final Vector3D min, final Vector3D max) {
diff --git a/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/threed/BoundarySourceLinecaster3DTest.java b/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/threed/BoundarySourceLinecaster3DTest.java
index 430077c..90b2209 100644
--- a/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/threed/BoundarySourceLinecaster3DTest.java
+++ b/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/threed/BoundarySourceLinecaster3DTest.java
@@ -22,7 +22,7 @@ import org.apache.commons.geometry.core.precision.DoublePrecisionContext;
import org.apache.commons.geometry.core.precision.EpsilonDoublePrecisionContext;
import org.apache.commons.geometry.euclidean.threed.line.Lines3D;
import org.apache.commons.geometry.euclidean.threed.shape.Parallelepiped;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
public class BoundarySourceLinecaster3DTest {
diff --git a/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/threed/Bounds3DTest.java b/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/threed/Bounds3DTest.java
index ce42aa6..f95ae10 100644
--- a/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/threed/Bounds3DTest.java
+++ b/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/threed/Bounds3DTest.java
@@ -28,8 +28,8 @@ import org.apache.commons.geometry.core.precision.DoublePrecisionContext;
import org.apache.commons.geometry.core.precision.EpsilonDoublePrecisionContext;
import org.apache.commons.geometry.euclidean.EuclideanTestUtils;
import org.apache.commons.geometry.euclidean.threed.shape.Parallelepiped;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
public class Bounds3DTest {
@@ -165,20 +165,20 @@ public class Bounds3DTest {
final Vector3D p5 = Vector3D.of(1, 1, 1);
// act/assert
- Assert.assertFalse(Bounds3D.from(p1).hasSize(high));
- Assert.assertFalse(Bounds3D.from(p1).hasSize(low));
+ Assertions.assertFalse(Bounds3D.from(p1).hasSize(high));
+ Assertions.assertFalse(Bounds3D.from(p1).hasSize(low));
- Assert.assertTrue(Bounds3D.from(p1, p2).hasSize(high));
- Assert.assertFalse(Bounds3D.from(p1, p2).hasSize(low));
+ Assertions.assertTrue(Bounds3D.from(p1, p2).hasSize(high));
+ Assertions.assertFalse(Bounds3D.from(p1, p2).hasSize(low));
- Assert.assertTrue(Bounds3D.from(p1, p3).hasSize(high));
- Assert.assertFalse(Bounds3D.from(p1, p3).hasSize(low));
+ Assertions.assertTrue(Bounds3D.from(p1, p3).hasSize(high));
+ Assertions.assertFalse(Bounds3D.from(p1, p3).hasSize(low));
- Assert.assertTrue(Bounds3D.from(p1, p4).hasSize(high));
- Assert.assertFalse(Bounds3D.from(p1, p4).hasSize(low));
+ Assertions.assertTrue(Bounds3D.from(p1, p4).hasSize(high));
+ Assertions.assertFalse(Bounds3D.from(p1, p4).hasSize(low));
- Assert.assertTrue(Bounds3D.from(p1, p5).hasSize(high));
- Assert.assertTrue(Bounds3D.from(p1, p5).hasSize(low));
+ Assertions.assertTrue(Bounds3D.from(p1, p5).hasSize(high));
+ Assertions.assertTrue(Bounds3D.from(p1, p5).hasSize(low));
}
@Test
@@ -253,44 +253,44 @@ public class Bounds3DTest {
// check all possible interval relationships
// start below minValue
- Assert.assertFalse(b.intersects(Bounds3D.from(
+ Assertions.assertFalse(b.intersects(Bounds3D.from(
setter.apply(min, minValue - 2), setter.apply(max, minValue - 1))));
- Assert.assertTrue(b.intersects(Bounds3D.from(
+ Assertions.assertTrue(b.intersects(Bounds3D.from(
setter.apply(min, minValue - 2), setter.apply(max, minValue))));
- Assert.assertTrue(b.intersects(Bounds3D.from(
+ Assertions.assertTrue(b.intersects(Bounds3D.from(
setter.apply(min, minValue - 2), setter.apply(max, midValue))));
- Assert.assertTrue(b.intersects(Bounds3D.from(
+ Assertions.assertTrue(b.intersects(Bounds3D.from(
setter.apply(min, minValue - 2), setter.apply(max, maxValue))));
- Assert.assertTrue(b.intersects(Bounds3D.from(
+ Assertions.assertTrue(b.intersects(Bounds3D.from(
setter.apply(min, minValue - 2), setter.apply(max, maxValue + 1))));
// start on minValue
- Assert.assertTrue(b.intersects(Bounds3D.from(
+ Assertions.assertTrue(b.intersects(Bounds3D.from(
setter.apply(min, minValue), setter.apply(max, minValue))));
- Assert.assertTrue(b.intersects(Bounds3D.from(
+ Assertions.assertTrue(b.intersects(Bounds3D.from(
setter.apply(min, minValue), setter.apply(max, midValue))));
- Assert.assertTrue(b.intersects(Bounds3D.from(
+ Assertions.assertTrue(b.intersects(Bounds3D.from(
setter.apply(min, minValue), setter.apply(max, maxValue))));
- Assert.assertTrue(b.intersects(Bounds3D.from(
+ Assertions.assertTrue(b.intersects(Bounds3D.from(
setter.apply(min, minValue), setter.apply(max, maxValue + 1))));
// start on midValue
- Assert.assertTrue(b.intersects(Bounds3D.from(
+ Assertions.assertTrue(b.intersects(Bounds3D.from(
setter.apply(min, midValue), setter.apply(max, midValue))));
- Assert.assertTrue(b.intersects(Bounds3D.from(
+ Assertions.assertTrue(b.intersects(Bounds3D.from(
setter.apply(min, midValue), setter.apply(max, maxValue))));
- Assert.assertTrue(b.intersects(Bounds3D.from(
+ Assertions.assertTrue(b.intersects(Bounds3D.from(
setter.apply(min, midValue), setter.apply(max, maxValue + 1))));
// start on maxValue
- Assert.assertTrue(b.intersects(Bounds3D.from(
+ Assertions.assertTrue(b.intersects(Bounds3D.from(
setter.apply(min, maxValue), setter.apply(max, maxValue))));
- Assert.assertTrue(b.intersects(Bounds3D.from(
+ Assertions.assertTrue(b.intersects(Bounds3D.from(
setter.apply(min, maxValue), setter.apply(max, maxValue + 1))));
// start above maxValue
- Assert.assertFalse(b.intersects(Bounds3D.from(
+ Assertions.assertFalse(b.intersects(Bounds3D.from(
setter.apply(min, maxValue + 1), setter.apply(max, maxValue + 2))));
}
@@ -302,7 +302,7 @@ public class Bounds3DTest {
// -- act/assert
// move along x-axis
- Assert.assertNull(b.intersection(Bounds3D.from(Vector3D.of(-2, 0, 0), Vector3D.of(-1, 1, 1))));
+ Assertions.assertNull(b.intersection(Bounds3D.from(Vector3D.of(-2, 0, 0), Vector3D.of(-1, 1, 1))));
checkIntersection(b, Vector3D.of(-1, 0, 0), Vector3D.of(0, 1, 1),
Vector3D.of(0, 0, 0), Vector3D.of(0, 1, 1));
checkIntersection(b, Vector3D.of(-1, 0, 0), Vector3D.of(0.5, 1, 1),
@@ -317,10 +317,10 @@ public class Bounds3DTest {
Vector3D.of(0.5, 0, 0), Vector3D.of(1, 1, 1));
checkIntersection(b, Vector3D.of(1, 0, 0), Vector3D.of(2, 1, 1),
Vector3D.of(1, 0, 0), Vector3D.of(1, 1, 1));
- Assert.assertNull(b.intersection(Bounds3D.from(Vector3D.of(2, 0, 0), Vector3D.of(3, 1, 1))));
+ Assertions.assertNull(b.intersection(Bounds3D.from(Vector3D.of(2, 0, 0), Vector3D.of(3, 1, 1))));
// move along y-axis
- Assert.assertNull(b.intersection(Bounds3D.from(Vector3D.of(0, -2, 0), Vector3D.of(1, -1, 1))));
+ Assertions.assertNull(b.intersection(Bounds3D.from(Vector3D.of(0, -2, 0), Vector3D.of(1, -1, 1))));
checkIntersection(b, Vector3D.of(0, -1, 0), Vector3D.of(1, 0, 1),
Vector3D.of(0, 0, 0), Vector3D.of(1, 0, 1));
checkIntersection(b, Vector3D.of(0, -1, 0), Vector3D.of(1, 0.5, 1),
@@ -335,10 +335,10 @@ public class Bounds3DTest {
Vector3D.of(0, 0.5, 0), Vector3D.of(1, 1, 1));
checkIntersection(b, Vector3D.of(0, 1, 0), Vector3D.of(1, 2, 1),
Vector3D.of(0, 1, 0), Vector3D.of(1, 1, 1));
- Assert.assertNull(b.intersection(Bounds3D.from(Vector3D.of(0, 2, 0), Vector3D.of(1, 3, 1))));
+ Assertions.assertNull(b.intersection(Bounds3D.from(Vector3D.of(0, 2, 0), Vector3D.of(1, 3, 1))));
// move along z-axis
- Assert.assertNull(b.intersection(Bounds3D.from(Vector3D.of(0, 0, -2), Vector3D.of(1, 1, -1))));
+ Assertions.assertNull(b.intersection(Bounds3D.from(Vector3D.of(0, 0, -2), Vector3D.of(1, 1, -1))));
checkIntersection(b, Vector3D.of(0, 0, -1), Vector3D.of(1, 1, 0),
Vector3D.of(0, 0, 0), Vector3D.of(1, 1, 0));
checkIntersection(b, Vector3D.of(0, 0, -1), Vector3D.of(1, 1, 0.5),
@@ -353,7 +353,7 @@ public class Bounds3DTest {
Vector3D.of(0, 0, 0.5), Vector3D.of(1, 1, 1));
checkIntersection(b, Vector3D.of(0, 0, 1), Vector3D.of(1, 1, 2),
Vector3D.of(0, 0, 1), Vector3D.of(1, 1, 1));
- Assert.assertNull(b.intersection(Bounds3D.from(Vector3D.of(0, 0, 2), Vector3D.of(1, 1, 3))));
+ Assertions.assertNull(b.intersection(Bounds3D.from(Vector3D.of(0, 0, 2), Vector3D.of(1, 1, 3))));
}
private void checkIntersection(final Bounds3D b, final Vector3D a1, final Vector3D a2, final Vector3D r1, final Vector3D r2) {
@@ -374,7 +374,7 @@ public class Bounds3DTest {
final Parallelepiped p = b.toRegion(TEST_PRECISION);
// assert
- Assert.assertEquals(8, p.getSize(), TEST_EPS);
+ Assertions.assertEquals(8, p.getSize(), TEST_EPS);
EuclideanTestUtils.assertCoordinatesEqual(Vector3D.of(1, 5, 9), p.getCentroid(), TEST_EPS);
}
@@ -401,16 +401,16 @@ public class Bounds3DTest {
final Bounds3D b4 = Bounds3D.from(Vector3D.of(1.001, 1.001, 1.001), Vector3D.of(2.001, 2.001, 2.001));
// act/assert
- Assert.assertTrue(b1.eq(b1, low));
+ Assertions.assertTrue(b1.eq(b1, low));
- Assert.assertFalse(b1.eq(b2, low));
- Assert.assertFalse(b1.eq(b3, low));
+ Assertions.assertFalse(b1.eq(b2, low));
+ Assertions.assertFalse(b1.eq(b3, low));
- Assert.assertTrue(b1.eq(b4, low));
- Assert.assertTrue(b4.eq(b1, low));
+ Assertions.assertTrue(b1.eq(b4, low));
+ Assertions.assertTrue(b4.eq(b1, low));
- Assert.assertFalse(b1.eq(b4, high));
- Assert.assertFalse(b4.eq(b1, high));
+ Assertions.assertFalse(b1.eq(b4, high));
+ Assertions.assertFalse(b4.eq(b1, high));
}
@Test
@@ -429,14 +429,14 @@ public class Bounds3DTest {
final int hash = b1.hashCode();
// assert
- Assert.assertEquals(hash, b1.hashCode());
+ Assertions.assertEquals(hash, b1.hashCode());
- Assert.assertNotEquals(hash, b2.hashCode());
- Assert.assertNotEquals(hash, b3.hashCode());
- Assert.assertNotEquals(hash, b4.hashCode());
- Assert.assertNotEquals(hash, b5.hashCode());
+ Assertions.assertNotEquals(hash, b2.hashCode());
+ Assertions.assertNotEquals(hash, b3.hashCode());
+ Assertions.assertNotEquals(hash, b4.hashCode());
+ Assertions.assertNotEquals(hash, b5.hashCode());
- Assert.assertEquals(hash, b6.hashCode());
+ Assertions.assertEquals(hash, b6.hashCode());
}
@Test
@@ -454,12 +454,12 @@ public class Bounds3DTest {
// act/assert
GeometryTestUtils.assertSimpleEqualsCases(b1);
- Assert.assertNotEquals(b1, b2);
- Assert.assertNotEquals(b1, b3);
- Assert.assertNotEquals(b1, b4);
- Assert.assertNotEquals(b1, b5);
+ Assertions.assertNotEquals(b1, b2);
+ Assertions.assertNotEquals(b1, b3);
+ Assertions.assertNotEquals(b1, b4);
+ Assertions.assertNotEquals(b1, b5);
- Assert.assertEquals(b1, b6);
+ Assertions.assertEquals(b1, b6);
}
@Test
@@ -500,21 +500,21 @@ public class Bounds3DTest {
@Test
public void testBuilder_hasBounds() {
// act/assert
- Assert.assertFalse(Bounds3D.builder().hasBounds());
+ Assertions.assertFalse(Bounds3D.builder().hasBounds());
- Assert.assertFalse(Bounds3D.builder().add(Vector3D.of(Double.NaN, 1, 1)).hasBounds());
- Assert.assertFalse(Bounds3D.builder().add(Vector3D.of(1, Double.NaN, 1)).hasBounds());
- Assert.assertFalse(Bounds3D.builder().add(Vector3D.of(1, 1, Double.NaN)).hasBounds());
+ Assertions.assertFalse(Bounds3D.builder().add(Vector3D.of(Double.NaN, 1, 1)).hasBounds());
+ Assertions.assertFalse(Bounds3D.builder().add(Vector3D.of(1, Double.NaN, 1)).hasBounds());
+ Assertions.assertFalse(Bounds3D.builder().add(Vector3D.of(1, 1, Double.NaN)).hasBounds());
- Assert.assertFalse(Bounds3D.builder().add(Vector3D.of(Double.POSITIVE_INFINITY, 1, 1)).hasBounds());
- Assert.assertFalse(Bounds3D.builder().add(Vector3D.of(1, Double.POSITIVE_INFINITY, 1)).hasBounds());
- Assert.assertFalse(Bounds3D.builder().add(Vector3D.of(1, 1, Double.POSITIVE_INFINITY)).hasBounds());
+ Assertions.assertFalse(Bounds3D.builder().add(Vector3D.of(Double.POSITIVE_INFINITY, 1, 1)).hasBounds());
+ Assertions.assertFalse(Bounds3D.builder().add(Vector3D.of(1, Double.POSITIVE_INFINITY, 1)).hasBounds());
+ Assertions.assertFalse(Bounds3D.builder().add(Vector3D.of(1, 1, Double.POSITIVE_INFINITY)).hasBounds());
- Assert.assertFalse(Bounds3D.builder().add(Vector3D.of(Double.NEGATIVE_INFINITY, 1, 1)).hasBounds());
- Assert.assertFalse(Bounds3D.builder().add(Vector3D.of(1, Double.NEGATIVE_INFINITY, 1)).hasBounds());
- Assert.assertFalse(Bounds3D.builder().add(Vector3D.of(1, 1, Double.NEGATIVE_INFINITY)).hasBounds());
+ Assertions.assertFalse(Bounds3D.builder().add(Vector3D.of(Double.NEGATIVE_INFINITY, 1, 1)).hasBounds());
+ Assertions.assertFalse(Bounds3D.builder().add(Vector3D.of(1, Double.NEGATIVE_INFINITY, 1)).hasBounds());
+ Assertions.assertFalse(Bounds3D.builder().add(Vector3D.of(1, 1, Double.NEGATIVE_INFINITY)).hasBounds());
- Assert.assertTrue(Bounds3D.builder().add(Vector3D.ZERO).hasBounds());
+ Assertions.assertTrue(Bounds3D.builder().add(Vector3D.ZERO).hasBounds());
}
private static void checkBounds(final Bounds3D b, final Vector3D min, final Vector3D max) {
@@ -524,13 +524,13 @@ public class Bounds3DTest {
private static void assertContainsStrict(final Bounds3D bounds, final boolean contains, final Vector3D... pts) {
for (final Vector3D pt : pts) {
- Assert.assertEquals("Unexpected location for point " + pt, contains, bounds.contains(pt));
+ Assertions.assertEquals(contains, bounds.contains(pt), "Unexpected location for point " + pt);
}
}
private static void assertContainsWithPrecision(final Bounds3D bounds, final boolean contains, final Vector3D... pts) {
for (final Vector3D pt : pts) {
- Assert.assertEquals("Unexpected location for point " + pt, contains, bounds.contains(pt, TEST_PRECISION));
+ Assertions.assertEquals(contains, bounds.contains(pt, TEST_PRECISION), "Unexpected location for point " + pt);
}
}
}
diff --git a/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/threed/ConvexVolumeTest.java b/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/threed/ConvexVolumeTest.java
index 25cbd30..3070724 100644
--- a/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/threed/ConvexVolumeTest.java
+++ b/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/threed/ConvexVolumeTest.java
@@ -31,8 +31,8 @@ import org.apache.commons.geometry.core.precision.EpsilonDoublePrecisionContext;
import org.apache.commons.geometry.euclidean.EuclideanTestUtils;
import org.apache.commons.geometry.euclidean.threed.line.Lines3D;
import org.apache.commons.geometry.euclidean.twod.ConvexArea;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
public class ConvexVolumeTest {
@@ -47,14 +47,14 @@ public class ConvexVolumeTest {
final ConvexVolume vol = ConvexVolume.full();
// assert
- Assert.assertTrue(vol.isFull());
- Assert.assertFalse(vol.isEmpty());
+ Assertions.assertTrue(vol.isFull());
+ Assertions.assertFalse(vol.isEmpty());
GeometryTestUtils.assertPositiveInfinity(vol.getSize());
- Assert.assertNull(vol.getCentroid());
+ Assertions.assertNull(vol.getCentroid());
- Assert.assertEquals(0, vol.getBoundaries().size());
- Assert.assertEquals(0, vol.getBoundarySize(), TEST_EPS);
+ Assertions.assertEquals(0, vol.getBoundaries().size());
+ Assertions.assertEquals(0, vol.getBoundarySize(), TEST_EPS);
}
@Test
@@ -67,10 +67,10 @@ public class ConvexVolumeTest {
final List<PlaneConvexSubset> boundaries = volume.boundaryStream().collect(Collectors.toList());
// assert
- Assert.assertEquals(1, boundaries.size());
+ Assertions.assertEquals(1, boundaries.size());
final PlaneConvexSubset sp = boundaries.get(0);
- Assert.assertEquals(0, sp.getEmbedded().getSubspaceRegion().getBoundaries().size());
+ Assertions.assertEquals(0, sp.getEmbedded().getSubspaceRegion().getBoundaries().size());
EuclideanTestUtils.assertCoordinatesEqual(plane.getOrigin(), sp.getPlane().getOrigin(), TEST_EPS);
EuclideanTestUtils.assertCoordinatesEqual(plane.getNormal(), sp.getPlane().getNormal(), TEST_EPS);
}
@@ -84,7 +84,7 @@ public class ConvexVolumeTest {
final List<PlaneConvexSubset> boundaries = volume.boundaryStream().collect(Collectors.toList());
// assert
- Assert.assertEquals(0, boundaries.size());
+ Assertions.assertEquals(0, boundaries.size());
}
@Test
@@ -96,7 +96,7 @@ public class ConvexVolumeTest {
final List<Triangle3D> tris = full.triangleStream().collect(Collectors.toList());
// act/assert
- Assert.assertEquals(0, tris.size());
+ Assertions.assertEquals(0, tris.size());
}
@Test
@@ -144,7 +144,7 @@ public class ConvexVolumeTest {
final List<Triangle3D> tris = box.triangleStream().collect(Collectors.toList());
// assert
- Assert.assertEquals(12, tris.size());
+ Assertions.assertEquals(12, tris.size());
final Bounds3D.Builder boundsBuilder = Bounds3D.builder();
tris.forEach(t -> boundsBuilder.addAll(t.getVertices()));
@@ -161,8 +161,8 @@ public class ConvexVolumeTest {
final ConvexVolume halfFull = ConvexVolume.fromBounds(Planes.fromNormal(Vector3D.Unit.PLUS_Z, TEST_PRECISION));
// act/assert
- Assert.assertNull(full.getBounds());
- Assert.assertNull(halfFull.getBounds());
+ Assertions.assertNull(full.getBounds());
+ Assertions.assertNull(halfFull.getBounds());
}
@Test
@@ -187,8 +187,8 @@ public class ConvexVolumeTest {
final RegionBSPTree3D tree = volume.toTree();
// assert
- Assert.assertTrue(tree.isFull());
- Assert.assertFalse(tree.isEmpty());
+ Assertions.assertTrue(tree.isFull());
+ Assertions.assertFalse(tree.isEmpty());
}
@Test
@@ -208,8 +208,8 @@ public class ConvexVolumeTest {
final RegionBSPTree3D tree = volume.toTree();
// assert
- Assert.assertEquals(1, tree.getSize(), TEST_EPS);
- Assert.assertEquals(6, tree.getBoundarySize(), TEST_EPS);
+ Assertions.assertEquals(1, tree.getSize(), TEST_EPS);
+ Assertions.assertEquals(6, tree.getBoundarySize(), TEST_EPS);
EuclideanTestUtils.assertCoordinatesEqual(Vector3D.of(0.5, 0.5, 0.5), tree.getCentroid(), TEST_EPS);
EuclideanTestUtils.assertRegionLocation(tree, RegionLocation.OUTSIDE,
@@ -226,7 +226,7 @@ public class ConvexVolumeTest {
final ConvexVolume vol = ConvexVolume.fromBounds();
// assert
- Assert.assertSame(ConvexVolume.full(), vol);
+ Assertions.assertSame(ConvexVolume.full(), vol);
}
@Test
@@ -235,13 +235,13 @@ public class ConvexVolumeTest {
final ConvexVolume vol = ConvexVolume.fromBounds(Planes.fromNormal(Vector3D.Unit.PLUS_Z, TEST_PRECISION));
// assert
- Assert.assertFalse(vol.isFull());
- Assert.assertFalse(vol.isEmpty());
+ Assertions.assertFalse(vol.isFull());
+ Assertions.assertFalse(vol.isEmpty());
GeometryTestUtils.assertPositiveInfinity(vol.getSize());
- Assert.assertNull(vol.getCentroid());
+ Assertions.assertNull(vol.getCentroid());
- Assert.assertEquals(1, vol.getBoundaries().size());
+ Assertions.assertEquals(1, vol.getBoundaries().size());
GeometryTestUtils.assertPositiveInfinity(vol.getBoundarySize());
EuclideanTestUtils.assertRegionLocation(vol, RegionLocation.OUTSIDE, Vector3D.of(0, 0, 1));
@@ -255,14 +255,14 @@ public class ConvexVolumeTest {
final ConvexVolume vol = rect(Vector3D.of(1, 1, 1), 0.5, 1, 2);
// assert
- Assert.assertFalse(vol.isFull());
- Assert.assertFalse(vol.isEmpty());
+ Assertions.assertFalse(vol.isFull());
+ Assertions.assertFalse(vol.isEmpty());
- Assert.assertEquals(8, vol.getSize(), TEST_EPS);
+ Assertions.assertEquals(8, vol.getSize(), TEST_EPS);
EuclideanTestUtils.assertCoordinatesEqual(Vector3D.of(1, 1, 1), vol.getCentroid(), TEST_EPS);
- Assert.assertEquals(6, vol.getBoundaries().size());
- Assert.assertEquals(28, vol.getBoundarySize(), TEST_EPS);
+ Assertions.assertEquals(6, vol.getBoundaries().size());
+ Assertions.assertEquals(28, vol.getBoundarySize(), TEST_EPS);
EuclideanTestUtils.assertRegionLocation(vol, RegionLocation.INSIDE, Vector3D.of(1, 1, 1));
@@ -287,11 +287,11 @@ public class ConvexVolumeTest {
final PlaneConvexSubset trimmed = vol.trim(subplane);
// assert
- Assert.assertEquals(1, trimmed.getSize(), TEST_EPS);
+ Assertions.assertEquals(1, trimmed.getSize(), TEST_EPS);
final List<Vector3D> vertices = trimmed.getVertices();
- Assert.assertEquals(4, vertices.size());
+ Assertions.assertEquals(4, vertices.size());
EuclideanTestUtils.assertCoordinatesEqual(Vector3D.of(0, 0.5, -0.5), vertices.get(0), TEST_EPS);
EuclideanTestUtils.assertCoordinatesEqual(Vector3D.of(0, 0.5, 0.5), vertices.get(1), TEST_EPS);
EuclideanTestUtils.assertCoordinatesEqual(Vector3D.of(0, -0.5, 0.5), vertices.get(2), TEST_EPS);
@@ -309,14 +309,14 @@ public class ConvexVolumeTest {
final Split<ConvexVolume> split = vol.split(splitter);
// assert
- Assert.assertEquals(SplitLocation.BOTH, split.getLocation());
+ Assertions.assertEquals(SplitLocation.BOTH, split.getLocation());
final ConvexVolume minus = split.getMinus();
- Assert.assertEquals(0.5, minus.getSize(), TEST_EPS);
+ Assertions.assertEquals(0.5, minus.getSize(), TEST_EPS);
EuclideanTestUtils.assertCoordinatesEqual(Vector3D.of(-0.25, 0, 0), minus.getCentroid(), TEST_EPS);
final ConvexVolume plus = split.getPlus();
- Assert.assertEquals(0.5, plus.getSize(), TEST_EPS);
+ Assertions.assertEquals(0.5, plus.getSize(), TEST_EPS);
EuclideanTestUtils.assertCoordinatesEqual(Vector3D.of(0.25, 0, 0), plus.getCentroid(), TEST_EPS);
}
@@ -374,8 +374,8 @@ public class ConvexVolumeTest {
final ConvexVolume transformed = vol.transform(transform);
// assert
- Assert.assertEquals(2, transformed.getSize(), TEST_EPS);
- Assert.assertEquals(10, transformed.getBoundarySize(), TEST_EPS);
+ Assertions.assertEquals(2, transformed.getSize(), TEST_EPS);
+ Assertions.assertEquals(10, transformed.getBoundarySize(), TEST_EPS);
EuclideanTestUtils.assertCoordinatesEqual(Vector3D.of(2, 2, 3), transformed.getCentroid(), TEST_EPS);
}
diff --git a/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/threed/EmbeddedAreaPlaneConvexSubsetTest.java b/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/threed/EmbeddedAreaPlaneConvexSubsetTest.java
index 950d569..76a95ef 100644
--- a/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/threed/EmbeddedAreaPlaneConvexSubsetTest.java
+++ b/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/threed/EmbeddedAreaPlaneConvexSubsetTest.java
@@ -34,8 +34,8 @@ import org.apache.commons.geometry.euclidean.twod.Vector2D;
import org.apache.commons.geometry.euclidean.twod.path.LinePath;
import org.apache.commons.geometry.euclidean.twod.shape.Parallelogram;
import org.apache.commons.numbers.angle.PlaneAngleRadians;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
public class EmbeddedAreaPlaneConvexSubsetTest {
@@ -69,17 +69,17 @@ public class EmbeddedAreaPlaneConvexSubsetTest {
final EmbeddedAreaPlaneConvexSubset ps = new EmbeddedAreaPlaneConvexSubset(XY_PLANE_Z1, area);
// assert
- Assert.assertTrue(ps.isFull());
- Assert.assertFalse(ps.isEmpty());
- Assert.assertFalse(ps.isFinite());
- Assert.assertTrue(ps.isInfinite());
+ Assertions.assertTrue(ps.isFull());
+ Assertions.assertFalse(ps.isEmpty());
+ Assertions.assertFalse(ps.isFinite());
+ Assertions.assertTrue(ps.isInfinite());
GeometryTestUtils.assertPositiveInfinity(ps.getSize());
- Assert.assertSame(XY_PLANE_Z1, ps.getPlane());
- Assert.assertSame(area, ps.getSubspaceRegion());
+ Assertions.assertSame(XY_PLANE_Z1, ps.getPlane());
+ Assertions.assertSame(area, ps.getSubspaceRegion());
- Assert.assertEquals(0, ps.getVertices().size());
+ Assertions.assertEquals(0, ps.getVertices().size());
}
@Test
@@ -93,15 +93,15 @@ public class EmbeddedAreaPlaneConvexSubsetTest {
final EmbeddedAreaPlaneConvexSubset ps = new EmbeddedAreaPlaneConvexSubset(XY_PLANE_Z1, area);
// assert
- Assert.assertFalse(ps.isFull());
- Assert.assertFalse(ps.isEmpty());
- Assert.assertTrue(ps.isFinite());
- Assert.assertFalse(ps.isInfinite());
+ Assertions.assertFalse(ps.isFull());
+ Assertions.assertFalse(ps.isEmpty());
+ Assertions.assertTrue(ps.isFinite());
+ Assertions.assertFalse(ps.isInfinite());
- Assert.assertEquals(0.5, ps.getSize(), TEST_EPS);
+ Assertions.assertEquals(0.5, ps.getSize(), TEST_EPS);
- Assert.assertSame(XY_PLANE_Z1, ps.getPlane());
- Assert.assertSame(area, ps.getSubspaceRegion());
+ Assertions.assertSame(XY_PLANE_Z1, ps.getPlane());
+ Assertions.assertSame(area, ps.getSubspaceRegion());
EuclideanTestUtils.assertVertexLoopSequence(
Arrays.asList(Vector3D.of(0, 0, 1), Vector3D.of(1, 0, 1), Vector3D.of(0, 1, 1)),
@@ -121,7 +121,7 @@ public class EmbeddedAreaPlaneConvexSubsetTest {
final List<Vector3D> vertices = sp.getVertices();
// assert
- Assert.assertEquals(0, vertices.size());
+ Assertions.assertEquals(0, vertices.size());
}
@Test
@@ -138,7 +138,7 @@ public class EmbeddedAreaPlaneConvexSubsetTest {
final List<Vector3D> vertices = sp.getVertices();
// assert
- Assert.assertEquals(2, vertices.size());
+ Assertions.assertEquals(2, vertices.size());
EuclideanTestUtils.assertCoordinatesEqual(Vector3D.of(1, -1, 1), vertices.get(0), TEST_EPS);
EuclideanTestUtils.assertCoordinatesEqual(Vector3D.of(1, 1, 1), vertices.get(1), TEST_EPS);
@@ -188,7 +188,7 @@ public class EmbeddedAreaPlaneConvexSubsetTest {
final List<Triangle3D> tris = ps.toTriangles();
// assert
- Assert.assertEquals(2, tris.size());
+ Assertions.assertEquals(2, tris.size());
EuclideanTestUtils.assertVertexLoopSequence(Arrays.asList(p4, p1, p2),
tris.get(0).getVertices(), TEST_PRECISION);
@@ -245,8 +245,8 @@ public class EmbeddedAreaPlaneConvexSubsetTest {
ConvexArea.fromBounds(Lines.fromPointAndAngle(Vector2D.ZERO, 0, TEST_PRECISION)));
// act/assert
- Assert.assertNull(full.getBounds());
- Assert.assertNull(halfPlane.getBounds());
+ Assertions.assertNull(full.getBounds());
+ Assertions.assertNull(halfPlane.getBounds());
}
@Test
@@ -286,12 +286,12 @@ public class EmbeddedAreaPlaneConvexSubsetTest {
final EmbeddedAreaPlaneConvexSubset result = ps.transform(t);
// assert
- Assert.assertFalse(result.isFull());
- Assert.assertFalse(result.isEmpty());
- Assert.assertTrue(result.isFinite());
- Assert.assertFalse(result.isInfinite());
+ Assertions.assertFalse(result.isFull());
+ Assertions.assertFalse(result.isEmpty());
+ Assertions.assertTrue(result.isFinite());
+ Assertions.assertFalse(result.isInfinite());
- Assert.assertEquals(8, result.getSize(), TEST_EPS);
+ Assertions.assertEquals(8, result.getSize(), TEST_EPS);
EuclideanTestUtils.assertCoordinatesEqual(Vector3D.Unit.MINUS_X, result.getPlane().getNormal(), TEST_EPS);
EuclideanTestUtils.assertCoordinatesEqual(Vector3D.Unit.PLUS_Z, result.getPlane().getU(), TEST_EPS);
@@ -314,12 +314,12 @@ public class EmbeddedAreaPlaneConvexSubsetTest {
final EmbeddedAreaPlaneConvexSubset result = ps.reverse();
// assert
- Assert.assertFalse(result.isFull());
- Assert.assertFalse(result.isEmpty());
- Assert.assertTrue(result.isFinite());
- Assert.assertFalse(result.isInfinite());
+ Assertions.assertFalse(result.isFull());
+ Assertions.assertFalse(result.isEmpty());
+ Assertions.assertTrue(result.isFinite());
+ Assertions.assertFalse(result.isInfinite());
- Assert.assertEquals(4, result.getSize(), TEST_EPS);
+ Assertions.assertEquals(4, result.getSize(), TEST_EPS);
EuclideanTestUtils.assertCoordinatesEqual(Vector3D.Unit.MINUS_Z, result.getPlane().getNormal(), TEST_EPS);
EuclideanTestUtils.assertCoordinatesEqual(Vector3D.Unit.PLUS_Y, result.getPlane().getU(), TEST_EPS);
@@ -342,10 +342,10 @@ public class EmbeddedAreaPlaneConvexSubsetTest {
final Split<PlaneConvexSubset> split = ps.split(splitter);
// assert
- Assert.assertEquals(SplitLocation.PLUS, split.getLocation());
+ Assertions.assertEquals(SplitLocation.PLUS, split.getLocation());
- Assert.assertNull(split.getMinus());
- Assert.assertSame(ps, split.getPlus());
+ Assertions.assertNull(split.getMinus());
+ Assertions.assertSame(ps, split.getPlus());
}
@Test
@@ -361,10 +361,10 @@ public class EmbeddedAreaPlaneConvexSubsetTest {
final Split<PlaneConvexSubset> split = ps.split(splitter);
// assert
- Assert.assertEquals(SplitLocation.MINUS, split.getLocation());
+ Assertions.assertEquals(SplitLocation.MINUS, split.getLocation());
- Assert.assertSame(ps, split.getMinus());
- Assert.assertNull(split.getPlus());
+ Assertions.assertSame(ps, split.getMinus());
+ Assertions.assertNull(split.getPlus());
}
@Test
@@ -380,7 +380,7 @@ public class EmbeddedAreaPlaneConvexSubsetTest {
final Split<PlaneConvexSubset> split = ps.split(splitter);
// assert
- Assert.assertEquals(SplitLocation.BOTH, split.getLocation());
+ Assertions.assertEquals(SplitLocation.BOTH, split.getLocation());
final PlaneConvexSubset minus = split.getMinus();
EuclideanTestUtils.assertVertexLoopSequence(
@@ -406,10 +406,10 @@ public class EmbeddedAreaPlaneConvexSubsetTest {
final Split<PlaneConvexSubset> split = ps.split(splitter);
// assert
- Assert.assertEquals(SplitLocation.NEITHER, split.getLocation());
+ Assertions.assertEquals(SplitLocation.NEITHER, split.getLocation());
- Assert.assertNull(split.getMinus());
- Assert.assertNull(split.getPlus());
+ Assertions.assertNull(split.getMinus());
+ Assertions.assertNull(split.getPlus());
}
@Test
@@ -430,19 +430,19 @@ public class EmbeddedAreaPlaneConvexSubsetTest {
final Split<PlaneConvexSubset> split = ps.split(splitter);
// assert
- Assert.assertTrue(ps.isInfinite());
+ Assertions.assertTrue(ps.isInfinite());
- Assert.assertEquals(SplitLocation.BOTH, split.getLocation());
+ Assertions.assertEquals(SplitLocation.BOTH, split.getLocation());
final PlaneConvexSubset plus = split.getPlus();
- Assert.assertNotNull(plus);
- Assert.assertTrue(plus.isInfinite());
- Assert.assertTrue(plus instanceof EmbeddedAreaPlaneConvexSubset);
+ Assertions.assertNotNull(plus);
+ Assertions.assertTrue(plus.isInfinite());
+ Assertions.assertTrue(plus instanceof EmbeddedAreaPlaneConvexSubset);
final PlaneConvexSubset minus = split.getMinus();
- Assert.assertNotNull(minus);
- Assert.assertFalse(minus.isInfinite());
- Assert.assertTrue(minus instanceof SimpleTriangle3D);
+ Assertions.assertNotNull(minus);
+ Assertions.assertFalse(minus.isInfinite());
+ Assertions.assertTrue(minus instanceof SimpleTriangle3D);
}
@Test
@@ -462,7 +462,7 @@ public class EmbeddedAreaPlaneConvexSubsetTest {
private static void checkPoints(final EmbeddedAreaPlaneConvexSubset ps, final RegionLocation loc, final Vector3D... pts) {
for (final Vector3D pt : pts) {
- Assert.assertEquals("Unexpected location for point " + pt, loc, ps.classify(pt));
+ Assertions.assertEquals(loc, ps.classify(pt), "Unexpected location for point " + pt);
}
}
}
diff --git a/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/threed/EmbeddedTreePlaneSubsetTest.java b/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/threed/EmbeddedTreePlaneSubsetTest.java
index 6018873..83b5fd8 100644
--- a/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/threed/EmbeddedTreePlaneSubsetTest.java
+++ b/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/threed/EmbeddedTreePlaneSubsetTest.java
@@ -35,8 +35,8 @@ import org.apache.commons.geometry.euclidean.twod.RegionBSPTree2D;
import org.apache.commons.geometry.euclidean.twod.Vector2D;
import org.apache.commons.geometry.euclidean.twod.shape.Parallelogram;
import org.apache.commons.numbers.angle.PlaneAngleRadians;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
public class EmbeddedTreePlaneSubsetTest {
@@ -54,10 +54,10 @@ public class EmbeddedTreePlaneSubsetTest {
final EmbeddedTreePlaneSubset ps = new EmbeddedTreePlaneSubset(XY_PLANE);
// assert
- Assert.assertFalse(ps.isFull());
- Assert.assertTrue(ps.isEmpty());
+ Assertions.assertFalse(ps.isFull());
+ Assertions.assertTrue(ps.isEmpty());
- Assert.assertEquals(0, ps.getSize(), TEST_EPS);
+ Assertions.assertEquals(0, ps.getSize(), TEST_EPS);
}
@Test
@@ -66,10 +66,10 @@ public class EmbeddedTreePlaneSubsetTest {
final EmbeddedTreePlaneSubset ps = new EmbeddedTreePlaneSubset(XY_PLANE, false);
// assert
- Assert.assertFalse(ps.isFull());
- Assert.assertTrue(ps.isEmpty());
+ Assertions.assertFalse(ps.isFull());
+ Assertions.assertTrue(ps.isEmpty());
- Assert.assertEquals(0, ps.getSize(), TEST_EPS);
+ Assertions.assertEquals(0, ps.getSize(), TEST_EPS);
}
@Test
@@ -78,8 +78,8 @@ public class EmbeddedTreePlaneSubsetTest {
final EmbeddedTreePlaneSubset ps = new EmbeddedTreePlaneSubset(XY_PLANE, true);
// assert
- Assert.assertTrue(ps.isFull());
- Assert.assertFalse(ps.isEmpty());
+ Assertions.assertTrue(ps.isFull());
+ Assertions.assertFalse(ps.isEmpty());
GeometryTestUtils.assertPositiveInfinity(ps.getSize());
}
@@ -106,8 +106,8 @@ public class EmbeddedTreePlaneSubsetTest {
final List<PlaneConvexSubset> convex = ps.toConvex();
// assert
- Assert.assertEquals(1, convex.size());
- Assert.assertTrue(convex.get(0).isFull());
+ Assertions.assertEquals(1, convex.size());
+ Assertions.assertTrue(convex.get(0).isFull());
}
@Test
@@ -119,7 +119,7 @@ public class EmbeddedTreePlaneSubsetTest {
final List<PlaneConvexSubset> convex = ps.toConvex();
// assert
- Assert.assertEquals(0, convex.size());
+ Assertions.assertEquals(0, convex.size());
}
@Test
@@ -142,9 +142,9 @@ public class EmbeddedTreePlaneSubsetTest {
final List<PlaneConvexSubset> convex = ps.toConvex();
// assert
- Assert.assertEquals(2, convex.size());
- Assert.assertEquals(1, convex.get(0).getSize(), TEST_EPS);
- Assert.assertEquals(1, convex.get(1).getSize(), TEST_EPS);
+ Assertions.assertEquals(2, convex.size());
+ Assertions.assertEquals(1, convex.get(0).getSize(), TEST_EPS);
+ Assertions.assertEquals(1, convex.get(1).getSize(), TEST_EPS);
}
@Test
@@ -156,7 +156,7 @@ public class EmbeddedTreePlaneSubsetTest {
final List<Triangle3D> tris = ps.toTriangles();
// assert
- Assert.assertEquals(0, tris.size());
+ Assertions.assertEquals(0, tris.size());
}
@Test
@@ -205,7 +205,7 @@ public class EmbeddedTreePlaneSubsetTest {
final List<Triangle3D> tris = ps.toTriangles();
// assert
- Assert.assertEquals(2, tris.size());
+ Assertions.assertEquals(2, tris.size());
EuclideanTestUtils.assertVertexLoopSequence(Arrays.asList(p4, p1, p2),
tris.get(0).getVertices(), TEST_PRECISION);
@@ -230,7 +230,7 @@ public class EmbeddedTreePlaneSubsetTest {
final List<Triangle3D> tris = ps.toTriangles();
// assert
- Assert.assertEquals(3, tris.size());
+ Assertions.assertEquals(3, tris.size());
}
@Test
@@ -246,9 +246,9 @@ public class EmbeddedTreePlaneSubsetTest {
halfPlane.getSubspaceRegion().getRoot().insertCut(Lines.fromPointAndAngle(Vector2D.ZERO, 0, TEST_PRECISION));
// act/assert
- Assert.assertNull(full.getBounds());
- Assert.assertNull(empty.getBounds());
- Assert.assertNull(halfPlane.getBounds());
+ Assertions.assertNull(full.getBounds());
+ Assertions.assertNull(empty.getBounds());
+ Assertions.assertNull(halfPlane.getBounds());
}
@Test
@@ -281,10 +281,10 @@ public class EmbeddedTreePlaneSubsetTest {
final Split<EmbeddedTreePlaneSubset> split = ps.split(splitter);
// assert
- Assert.assertEquals(SplitLocation.NEITHER, split.getLocation());
+ Assertions.assertEquals(SplitLocation.NEITHER, split.getLocation());
- Assert.assertNull(split.getMinus());
- Assert.assertNull(split.getPlus());
+ Assertions.assertNull(split.getMinus());
+ Assertions.assertNull(split.getPlus());
}
@Test
@@ -300,7 +300,7 @@ public class EmbeddedTreePlaneSubsetTest {
final Split<EmbeddedTreePlaneSubset> split = ps.split(splitter);
// assert
- Assert.assertEquals(SplitLocation.BOTH, split.getLocation());
+ Assertions.assertEquals(SplitLocation.BOTH, split.getLocation());
final EmbeddedTreePlaneSubset minus = split.getMinus();
checkPoints(minus, RegionLocation.INSIDE, Vector3D.of(-1, 1, 0));
@@ -324,7 +324,7 @@ public class EmbeddedTreePlaneSubsetTest {
final Split<EmbeddedTreePlaneSubset> split = ps.split(splitter);
// assert
- Assert.assertEquals(SplitLocation.BOTH, split.getLocation());
+ Assertions.assertEquals(SplitLocation.BOTH, split.getLocation());
final EmbeddedTreePlaneSubset minus = split.getMinus();
checkPoints(minus, RegionLocation.INSIDE, Vector3D.of(-0.5, 0, 0));
@@ -352,10 +352,10 @@ public class EmbeddedTreePlaneSubsetTest {
final Split<EmbeddedTreePlaneSubset> split = ps.split(splitter);
// assert
- Assert.assertEquals(SplitLocation.MINUS, split.getLocation());
+ Assertions.assertEquals(SplitLocation.MINUS, split.getLocation());
- Assert.assertSame(ps, split.getMinus());
- Assert.assertNull(split.getPlus());
+ Assertions.assertSame(ps, split.getMinus());
+ Assertions.assertNull(split.getPlus());
}
@Test
@@ -371,10 +371,10 @@ public class EmbeddedTreePlaneSubsetTest {
final Split<EmbeddedTreePlaneSubset> split = ps.split(splitter);
// assert
- Assert.assertEquals(SplitLocation.PLUS, split.getLocation());
+ Assertions.assertEquals(SplitLocation.PLUS, split.getLocation());
- Assert.assertNull(split.getMinus());
- Assert.assertSame(ps, split.getPlus());
+ Assertions.assertNull(split.getMinus());
+ Assertions.assertSame(ps, split.getPlus());
}
@Test
@@ -390,10 +390,10 @@ public class EmbeddedTreePlaneSubsetTest {
final Split<EmbeddedTreePlaneSubset> split = ps.split(splitter);
// assert
- Assert.assertEquals(SplitLocation.MINUS, split.getLocation());
+ Assertions.assertEquals(SplitLocation.MINUS, split.getLocation());
- Assert.assertSame(ps, split.getMinus());
- Assert.assertNull(split.getPlus());
+ Assertions.assertSame(ps, split.getMinus());
+ Assertions.assertNull(split.getPlus());
}
@Test
@@ -409,10 +409,10 @@ public class EmbeddedTreePlaneSubsetTest {
final Split<EmbeddedTreePlaneSubset> split = ps.split(splitter);
// assert
- Assert.assertEquals(SplitLocation.PLUS, split.getLocation());
+ Assertions.assertEquals(SplitLocation.PLUS, split.getLocation());
- Assert.assertNull(split.getMinus());
- Assert.assertSame(ps, split.getPlus());
+ Assertions.assertNull(split.getMinus());
+ Assertions.assertSame(ps, split.getPlus());
}
@Test
@@ -426,10 +426,10 @@ public class EmbeddedTreePlaneSubsetTest {
final Split<EmbeddedTreePlaneSubset> split = ps.split(ps.getPlane());
// assert
- Assert.assertEquals(SplitLocation.NEITHER, split.getLocation());
+ Assertions.assertEquals(SplitLocation.NEITHER, split.getLocation());
- Assert.assertNull(split.getMinus());
- Assert.assertNull(split.getPlus());
+ Assertions.assertNull(split.getMinus());
+ Assertions.assertNull(split.getPlus());
}
@Test
@@ -443,14 +443,14 @@ public class EmbeddedTreePlaneSubsetTest {
final EmbeddedTreePlaneSubset result = ps.transform(transform);
// assert
- Assert.assertNotSame(ps, result);
+ Assertions.assertNotSame(ps, result);
final Plane resultPlane = result.getPlane();
EuclideanTestUtils.assertCoordinatesEqual(Vector3D.of(0, 0, 1), resultPlane.getOrigin(), TEST_EPS);
EuclideanTestUtils.assertCoordinatesEqual(Vector3D.Unit.PLUS_Z, resultPlane.getNormal(), TEST_EPS);
- Assert.assertFalse(result.isFull());
- Assert.assertTrue(result.isEmpty());
+ Assertions.assertFalse(result.isFull());
+ Assertions.assertTrue(result.isEmpty());
}
@Test
@@ -464,14 +464,14 @@ public class EmbeddedTreePlaneSubsetTest {
final EmbeddedTreePlaneSubset result = ps.transform(transform);
// assert
- Assert.assertNotSame(ps, result);
+ Assertions.assertNotSame(ps, result);
final Plane resultPlane = result.getPlane();
EuclideanTestUtils.assertCoordinatesEqual(Vector3D.of(0, 0, 1), resultPlane.getOrigin(), TEST_EPS);
EuclideanTestUtils.assertCoordinatesEqual(Vector3D.Unit.PLUS_Z, resultPlane.getNormal(), TEST_EPS);
- Assert.assertTrue(result.isFull());
- Assert.assertFalse(result.isEmpty());
+ Assertions.assertTrue(result.isFull());
+ Assertions.assertFalse(result.isEmpty());
}
@Test
@@ -491,7 +491,7 @@ public class EmbeddedTreePlaneSubsetTest {
final EmbeddedTreePlaneSubset result = ps.transform(transform);
// assert
- Assert.assertNotSame(ps, result);
+ Assertions.assertNotSame(ps, result);
final Plane resultPlane = result.getPlane();
EuclideanTestUtils.assertCoordinatesEqual(Vector3D.of(2, 0, 0), resultPlane.getOrigin(), TEST_EPS);
@@ -519,7 +519,7 @@ public class EmbeddedTreePlaneSubsetTest {
final EmbeddedTreePlaneSubset result = ps.transform(transform);
// assert
- Assert.assertNotSame(ps, result);
+ Assertions.assertNotSame(ps, result);
final Plane resultPlane = result.getPlane();
EuclideanTestUtils.assertCoordinatesEqual(Vector3D.of(0, 0, 1), resultPlane.getOrigin(), TEST_EPS);
@@ -551,12 +551,12 @@ public class EmbeddedTreePlaneSubsetTest {
ps.add(new EmbeddedTreePlaneSubset(plane, tree));
// assert
- Assert.assertFalse(ps.isFull());
- Assert.assertFalse(ps.isEmpty());
- Assert.assertTrue(ps.isFinite());
- Assert.assertFalse(ps.isInfinite());
+ Assertions.assertFalse(ps.isFull());
+ Assertions.assertFalse(ps.isEmpty());
+ Assertions.assertTrue(ps.isFinite());
+ Assertions.assertFalse(ps.isInfinite());
- Assert.assertEquals(1, ps.getSize(), TEST_EPS);
+ Assertions.assertEquals(1, ps.getSize(), TEST_EPS);
checkPoints(ps, RegionLocation.INSIDE, Vector3D.of(0.5, 0.5, 1));
checkPoints(ps, RegionLocation.BOUNDARY,
@@ -592,7 +592,7 @@ public class EmbeddedTreePlaneSubsetTest {
ps.add(Planes.subsetFromConvexArea(otherPlane2, area));
// assert
- Assert.assertEquals(4, ps.getSize(), TEST_EPS);
+ Assertions.assertEquals(4, ps.getSize(), TEST_EPS);
EuclideanTestUtils.assertCoordinatesEqual(Vector3D.of(0, 0, 1), ps.getCentroid(), TEST_EPS);
final Bounds3D bounds = ps.getBounds();
@@ -619,7 +619,7 @@ public class EmbeddedTreePlaneSubsetTest {
ps.add(Planes.subsetFromConvexArea(otherPlane1, area));
// assert
- Assert.assertEquals(2, ps.getSize(), TEST_EPS);
+ Assertions.assertEquals(2, ps.getSize(), TEST_EPS);
EuclideanTestUtils.assertCoordinatesEqual(Vector3D.of(-1, 0.5, 1), ps.getCentroid(), TEST_EPS);
final Bounds3D bounds = ps.getBounds();
@@ -646,7 +646,7 @@ public class EmbeddedTreePlaneSubsetTest {
ps.add(new EmbeddedTreePlaneSubset(otherPlane1, area.toTree()));
// assert
- Assert.assertEquals(2, ps.getSize(), TEST_EPS);
+ Assertions.assertEquals(2, ps.getSize(), TEST_EPS);
EuclideanTestUtils.assertCoordinatesEqual(Vector3D.of(-0.5, -1, 1), ps.getCentroid(), TEST_EPS);
final Bounds3D bounds = ps.getBounds();
@@ -689,7 +689,7 @@ public class EmbeddedTreePlaneSubsetTest {
private static void checkPoints(final EmbeddedTreePlaneSubset ps, final RegionLocation loc, final Vector3D... pts) {
for (final Vector3D pt : pts) {
- Assert.assertEquals("Unexpected location for point " + pt, loc, ps.classify(pt));
+ Assertions.assertEquals(loc, ps.classify(pt), "Unexpected location for point " + pt);
}
}
}
diff --git a/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/threed/EmbeddingPlaneTest.java b/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/threed/EmbeddingPlaneTest.java
index e9a3b41..5c0e90d 100644
--- a/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/threed/EmbeddingPlaneTest.java
+++ b/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/threed/EmbeddingPlaneTest.java
@@ -25,8 +25,8 @@ import org.apache.commons.geometry.euclidean.threed.rotation.QuaternionRotation;
import org.apache.commons.geometry.euclidean.twod.AffineTransformMatrix2D;
import org.apache.commons.geometry.euclidean.twod.Vector2D;
import org.apache.commons.numbers.angle.PlaneAngleRadians;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
public class EmbeddingPlaneTest {
@@ -86,7 +86,7 @@ public class EmbeddingPlaneTest {
Vector3D.Unit.PLUS_X, Vector3D.Unit.MINUS_Y, TEST_PRECISION);
// act/assert
- Assert.assertSame(plane, plane.getEmbedding());
+ Assertions.assertSame(plane, plane.getEmbedding());
}
@Test
@@ -119,11 +119,11 @@ public class EmbeddingPlaneTest {
// assert
checkPlane(reversed, pt, Vector3D.Unit.PLUS_Y, Vector3D.Unit.PLUS_X);
- Assert.assertTrue(reversed.contains(Vector3D.of(1, 1, 1)));
- Assert.assertTrue(reversed.contains(Vector3D.of(-1, -1, 1)));
- Assert.assertFalse(reversed.contains(Vector3D.ZERO));
+ Assertions.assertTrue(reversed.contains(Vector3D.of(1, 1, 1)));
+ Assertions.assertTrue(reversed.contains(Vector3D.of(-1, -1, 1)));
+ Assertions.assertFalse(reversed.contains(Vector3D.ZERO));
- Assert.assertEquals(1.0, reversed.offset(Vector3D.ZERO), TEST_EPS);
+ Assertions.assertEquals(1.0, reversed.offset(Vector3D.ZERO), TEST_EPS);
}
@Test
@@ -163,8 +163,8 @@ public class EmbeddingPlaneTest {
checkPlane(result, expectedOrigin, expectedU, expectedV);
- Assert.assertTrue(result.contains(transformedPt));
- Assert.assertFalse(plane.contains(transformedPt));
+ Assertions.assertTrue(result.contains(transformedPt));
+ Assertions.assertFalse(plane.contains(transformedPt));
}
@Test
@@ -248,12 +248,12 @@ public class EmbeddingPlaneTest {
EuclideanTestUtils.assertCoordinatesEqual(expectedNormal, result.getNormal(), TEST_EPS);
- Assert.assertTrue(result.contains(t.apply(p1)));
- Assert.assertTrue(result.contains(t.apply(p2)));
- Assert.assertTrue(result.contains(t.apply(p3)));
+ Assertions.assertTrue(result.contains(t.apply(p1)));
+ Assertions.assertTrue(result.contains(t.apply(p2)));
+ Assertions.assertTrue(result.contains(t.apply(p3)));
- Assert.assertFalse(result.contains(t.apply(notOnPlane1)));
- Assert.assertFalse(result.contains(t.apply(notOnPlane2)));
+ Assertions.assertFalse(result.contains(t.apply(notOnPlane1)));
+ Assertions.assertFalse(result.contains(t.apply(notOnPlane2)));
});
}
@@ -268,19 +268,19 @@ public class EmbeddingPlaneTest {
// act/assert
plane = plane.rotate(p2, QuaternionRotation.fromAxisAngle(p2.subtract(p1), 1.7));
- Assert.assertTrue(plane.contains(p1));
- Assert.assertTrue(plane.contains(p2));
- Assert.assertFalse(plane.contains(p3));
+ Assertions.assertTrue(plane.contains(p1));
... 21001 lines suppressed ...