use of org.hipparchus.exception.DummyLocalizable in project Orekit by CS-SI.
the class FieldKeplerianPropagatorTest method doTestStepException.
private <T extends RealFieldElement<T>> void doTestStepException(Field<T> field) throws OrekitException {
T zero = field.getZero();
final FieldKeplerianOrbit<T> orbit = new FieldKeplerianOrbit<>(zero.add(7.8e6), zero.add(0.032), zero.add(0.4), zero.add(0.1), zero.add(0.2), zero.add(0.3), PositionAngle.TRUE, FramesFactory.getEME2000(), new FieldAbsoluteDate<>(field), 3.986004415e14);
FieldKeplerianPropagator<T> propagator = new FieldKeplerianPropagator<>(orbit);
FieldOrekitStepHandlerMultiplexer<T> multiplexer = new FieldOrekitStepHandlerMultiplexer<>();
propagator.setMasterMode(multiplexer);
multiplexer.add(new FieldOrekitStepHandler<T>() {
public void init(FieldSpacecraftState<T> s0, FieldAbsoluteDate<T> t) {
}
public void handleStep(FieldOrekitStepInterpolator<T> interpolator, boolean isLast) throws OrekitException {
if (isLast) {
throw new OrekitException((Throwable) null, new DummyLocalizable("dummy error"));
}
}
});
propagator.propagate(orbit.getDate().shiftedBy(-3600));
}
use of org.hipparchus.exception.DummyLocalizable in project Orekit by CS-SI.
the class FieldKeplerianPropagatorTest method doTestWrongAttitude.
private <T extends RealFieldElement<T>> void doTestWrongAttitude(Field<T> field) throws OrekitException {
T zero = field.getZero();
FieldKeplerianOrbit<T> orbit = new FieldKeplerianOrbit<>(zero.add(1.0e10), zero.add(1.0e-4), zero.add(1.0e-2), zero, zero, zero, PositionAngle.TRUE, FramesFactory.getEME2000(), new FieldAbsoluteDate<>(field), 3.986004415e14);
AttitudeProvider wrongLaw = new AttitudeProvider() {
private static final long serialVersionUID = 1L;
@Override
public Attitude getAttitude(PVCoordinatesProvider pvProv, AbsoluteDate date, Frame frame) throws OrekitException {
throw new OrekitException(new DummyLocalizable("gasp"), new RuntimeException());
}
@Override
public <Q extends RealFieldElement<Q>> FieldAttitude<Q> getAttitude(FieldPVCoordinatesProvider<Q> pvProv, FieldAbsoluteDate<Q> date, Frame frame) throws OrekitException {
throw new OrekitException(new DummyLocalizable("gasp"), new RuntimeException());
}
};
FieldKeplerianPropagator<T> propagator = new FieldKeplerianPropagator<>(orbit, wrongLaw);
propagator.propagate(new FieldAbsoluteDate<>(field).shiftedBy(10.0));
}
Aggregations