/** * Tests that {@link Matrices#createTransform(AxisDirection[], AxisDirection[])} * throw an exception if the arguments contain colinear axis directions. * * <div class="note"><b>Note:</b> * {@code Matrices.createTransform(AxisDirection[], AxisDirection[])} needs to be tested with special care, * because this method will be the most frequently invoked one when building CRS.</div> */ @Test public void testCreateTransformWithColinearAxes() { try { Matrices.createTransform( new AxisDirection[] {NORTH, EAST, UP, WEST}, new AxisDirection[] {NORTH, EAST, UP}); fail("Expected an exception."); } catch (IllegalArgumentException e) { assertMessageContainsDirection(e, EAST); assertMessageContainsDirection(e, WEST); } }
/** * Tests that {@link Matrices#createTransform(AxisDirection[], AxisDirection[])} * throw an exception if a destination axis is not in the source. * * <div class="note"><b>Note:</b> * {@code Matrices.createTransform(AxisDirection[], AxisDirection[])} needs to be tested with special care, * because this method will be the most frequently invoked one when building CRS.</div> */ @Test public void testCreateTransformWithAxisNotInSource() { try { Matrices.createTransform( new AxisDirection[] {NORTH, EAST, UP}, new AxisDirection[] {DOWN, GEOCENTRIC_X}); fail("Expected an exception."); } catch (IllegalArgumentException e) { assertMessageContainsDirection(e, GEOCENTRIC_X); } }