From 7ce8fb13f47fc01aa52d6a75c0889707d2f6e1fd Mon Sep 17 00:00:00 2001 From: Guylaine Prat <guylaine.prat@c-s.fr> Date: Tue, 31 Oct 2017 13:19:59 +0100 Subject: [PATCH] Due to checkstyle corrections, add access to protected method of GroundOptimizationProblemBuilder --- .../org/orekit/rugged/api/RuggedTest.java | 25 +++++++++++++++---- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/src/test/java/org/orekit/rugged/api/RuggedTest.java b/src/test/java/org/orekit/rugged/api/RuggedTest.java index 635d318a..ff39bec2 100644 --- a/src/test/java/org/orekit/rugged/api/RuggedTest.java +++ b/src/test/java/org/orekit/rugged/api/RuggedTest.java @@ -1076,6 +1076,17 @@ public class RuggedTest { 3.0e-10, 5.0e-10, 2.0e-12, 7.0e-8); } + /** + * @param dimension + * @param lightTimeCorrection + * @param aberrationOfLightCorrection + * @param lineTolerance + * @param pixelTolerance + * @param lineDerivativeRelativeTolerance + * @param pixelDerivativeRelativeTolerance + * @throws RuggedException + * @throws OrekitException + */ private void doTestInverseLocationDerivatives(int dimension, boolean lightTimeCorrection, boolean aberrationOfLightCorrection, @@ -1146,9 +1157,13 @@ public class RuggedTest { // prepare generator final Observables measurements = new Observables(1); - GroundOptimizationProblemBuilder OptimizationProblembuilder = new GroundOptimizationProblemBuilder(Collections.singletonList(lineSensor), + GroundOptimizationProblemBuilder optimizationPbBuilder = new GroundOptimizationProblemBuilder(Collections.singletonList(lineSensor), measurements, rugged); - DSGenerator generator = OptimizationProblembuilder.getGenerator(); + + java.lang.reflect.Method getGenerator = GroundOptimizationProblemBuilder.class.getSuperclass().getDeclaredMethod("getGenerator"); + getGenerator.setAccessible(true); + + DSGenerator generator = (DSGenerator) getGenerator.invoke(optimizationPbBuilder); double referenceLine = 0.87654 * dimension; GeodeticPoint[] gp = rugged.directLocation("line", referenceLine); @@ -1234,9 +1249,9 @@ public class RuggedTest { Assert.assertEquals(dXdP, result[1].getPartialDerivative(0, 1), dXdP * pixelDerivativeRelativeTolerance); } catch (InvocationTargetException | NoSuchMethodException | - SecurityException | IllegalAccessException | - IllegalArgumentException | URISyntaxException | - OrekitExceptionWrapper | RuggedExceptionWrapper e) { + SecurityException | IllegalAccessException | + IllegalArgumentException | URISyntaxException | + OrekitExceptionWrapper | RuggedExceptionWrapper e) { Assert.fail(e.getLocalizedMessage()); } } -- GitLab