diff --git a/src/test/org/openscience/cdk/CDKTestCase.java b/src/test/org/openscience/cdk/CDKTestCase.java index 93b83038e4d..7d58518d3b8 100644 --- a/src/test/org/openscience/cdk/CDKTestCase.java +++ b/src/test/org/openscience/cdk/CDKTestCase.java @@ -33,6 +33,8 @@ import javax.vecmath.Point2d; import javax.vecmath.Point3d; +import javax.vecmath.Vector3d; + import java.util.Iterator; /** @@ -101,7 +103,7 @@ public void assertEquals(Point2d p1, Point2d p2, double error) { Assert.assertEquals(p1.x, p2.x, error); Assert.assertEquals(p1.y, p2.y, error); } - + /** * Compares two Point3d objects, and asserts that the XY coordinates * are identical within the given error. @@ -118,6 +120,22 @@ public void assertEquals(Point3d p1, Point3d p2, double error) { Assert.assertEquals(p1.z, p2.z, error); } + /** + * Compares two Vector3d objects, and asserts that the XYZ coordinates + * are identical within the given error. + * + * @param v1 first Point3d + * @param v2 second Point3d + * @param error maximal allowed error + */ + public void assertEquals(Vector3d v1, Vector3d v2, double error) { + Assert.assertNotNull("The expected Vector3d is null", v1); + Assert.assertNotNull("The tested Vector3d is null", v2); + Assert.assertEquals(v1.x, v2.x, error); + Assert.assertEquals(v1.y, v2.y, error); + Assert.assertEquals(v1.z, v2.z, error); + } + /** * Tests method that asserts that for all atoms an reasonable CDK atom * type can be perceived.