Commit fbb873bb authored by Luc Maisonobe's avatar Luc Maisonobe
Browse files

Merge branch 'develop' into issue-474

parents 8c314b1e 0a172779
Pipeline #1053 passed with stage
in 24 minutes and 39 seconds
......@@ -108,11 +108,11 @@ public class AttitudeEndoints implements AttitudeBuilder {
if (frameA == null) {
if (frameB == null || frameB.asSpacecraftBodyFrame() == null) {
throw new OrekitException(OrekitMessages.UNINITIALIZED_VALUE_FOR_KEY, aKey);
throw new OrekitException(OrekitMessages.UNINITIALIZED_VALUE_FOR_KEY, aKey.name());
}
} else if (frameA.asSpacecraftBodyFrame() == null) {
if (frameB == null) {
throw new OrekitException(OrekitMessages.UNINITIALIZED_VALUE_FOR_KEY, bKey);
throw new OrekitException(OrekitMessages.UNINITIALIZED_VALUE_FOR_KEY, bKey.name());
} else if (frameB.asSpacecraftBodyFrame() == null) {
// at least one of the frame must be a spacecraft body frame
throw new OrekitException(OrekitMessages.CCSDS_INVALID_FRAME, frameB.getName());
......
......@@ -16,8 +16,6 @@
*/
package org.orekit.files.ccsds.ndm.adm.apm;
import org.orekit.errors.OrekitException;
import org.orekit.errors.OrekitMessages;
import org.orekit.files.ccsds.definitions.Units;
import org.orekit.files.ccsds.utils.ContextBinding;
import org.orekit.files.ccsds.utils.lexical.ParseToken;
......@@ -43,17 +41,7 @@ public enum ApmQuaternionKey {
Q_FRAME_A((token, context, container) -> token.processAsFrame(container.getEndpoints()::setFrameA, context, true, true, true)),
/** Second reference frame entry. */
Q_FRAME_B((token, context, container) -> {
if (token.getType() == TokenType.ENTRY) {
if (container.getEndpoints().getFrameA() == null) {
throw new OrekitException(OrekitMessages.UNINITIALIZED_VALUE_FOR_KEY, Q_FRAME_A.name());
}
final boolean aIsSpaceraftBody = container.getEndpoints().getFrameA().asSpacecraftBodyFrame() != null;
return token.processAsFrame(container.getEndpoints()::setFrameB, context,
aIsSpaceraftBody, aIsSpaceraftBody, !aIsSpaceraftBody);
}
return true;
}),
Q_FRAME_B((token, context, container) -> token.processAsFrame(container.getEndpoints()::setFrameB, context, true, true, true)),
/** Rotation direction entry. */
Q_DIR((token, context, container) -> {
......
......@@ -183,14 +183,6 @@ public class CommonMetadata extends OdmMetadata {
this.referenceFrame = referenceFrame;
}
/** Get epoch of reference frame, if not intrinsic to the definition of the
* reference frame.
* @return epoch of reference frame
*/
String getFrameEpochString() {
return frameEpochString;
}
/** Set epoch of reference frame, if not intrinsic to the definition of the
* reference frame.
* @param frameEpochString the epoch of reference frame to be set
......
......@@ -138,36 +138,6 @@ public class OemMetadata extends CommonMetadata {
this.useableStopTime = useableStopTime;
}
/**
* Get the start date of this ephemeris segment.
*
* @return ephemeris segment start date.
*/
public AbsoluteDate getStart() {
// useable start time overrides start time if it is set
final AbsoluteDate start = this.getUseableStartTime();
if (start != null) {
return start;
} else {
return this.getStartTime();
}
}
/**
* Get the stop date of this ephemeris segment.
*
* @return ephemeris segment stop date.
*/
public AbsoluteDate getStop() {
// useable stop time overrides stop time if it is set
final AbsoluteDate stop = this.getUseableStopTime();
if (stop != null) {
return stop;
} else {
return this.getStopTime();
}
}
/** Get the interpolation method to be used.
* @return the interpolation method
*/
......@@ -216,9 +186,7 @@ public class OemMetadata extends CommonMetadata {
// copy object
copy.setObjectName(getObjectName());
copy.setObjectID(getObjectID());
if (getCenter().getName() != null) {
copy.setCenter(getCenter());
}
copy.setCenter(getCenter());
// copy frames
copy.setFrameEpoch(getFrameEpoch());
......
......@@ -79,7 +79,7 @@ class XmlLexicalAnalyzer implements LexicalAnalyzer {
} catch (SAXException se) {
final OrekitException oe;
if (se.getException() != null && se.getException() instanceof OrekitException) {
if (se.getException() instanceof OrekitException) {
oe = (OrekitException) se.getException();
} else {
oe = new OrekitException(se, new DummyLocalizable(se.getMessage()));
......
......@@ -168,7 +168,7 @@ public class EOPHistory implements Serializable {
* @return true if the instance uses interpolation on tidal corrections
*/
public boolean usesInterpolation() {
return tidalCorrection != null && tidalCorrection instanceof CachedCorrection;
return tidalCorrection instanceof CachedCorrection;
}
/** Get the IERS conventions to which these EOP apply.
......
......@@ -130,13 +130,8 @@ class RapidDataAndPredictionXMLLoader extends AbstractEopLoader
return history;
} catch (SAXException se) {
if (se.getCause() != null && se.getCause() instanceof OrekitException) {
throw (OrekitException) se.getCause();
}
throw new OrekitException(se, LocalizedCoreFormats.SIMPLE_MESSAGE, se.getMessage());
} catch (ParserConfigurationException pce) {
throw new OrekitException(pce, LocalizedCoreFormats.SIMPLE_MESSAGE, pce.getMessage());
} catch (SAXException | ParserConfigurationException e) {
throw new OrekitException(e, LocalizedCoreFormats.SIMPLE_MESSAGE, e.getMessage());
}
}
......@@ -301,16 +296,11 @@ class RapidDataAndPredictionXMLLoader extends AbstractEopLoader
/** {@inheritDoc} */
@Override
public void endElement(final String uri, final String localName, final String qName)
throws SAXException {
try {
if (content == DataFileContent.DAILY) {
endDailyElement(qName);
} else if (content == DataFileContent.FINAL) {
endFinalElement(qName);
}
} catch (OrekitException oe) {
throw new SAXException(oe);
public void endElement(final String uri, final String localName, final String qName) {
if (content == DataFileContent.DAILY) {
endDailyElement(qName);
} else if (content == DataFileContent.FINAL) {
endFinalElement(qName);
}
}
......
......@@ -1153,8 +1153,7 @@ public class NRLMSISE00 implements Atmosphere {
final Frame frame) {
// check if data are available :
if (date.compareTo(inputParams.getMaxDate()) > 0 ||
date.compareTo(inputParams.getMinDate()) < 0) {
if (!date.isBetweenOrEqualTo(inputParams.getMinDate(), inputParams.getMaxDate())) {
throw new OrekitException(OrekitMessages.NO_SOLAR_ACTIVITY_AT_DATE,
date, inputParams.getMinDate(), inputParams.getMaxDate());
}
......@@ -1190,8 +1189,7 @@ public class NRLMSISE00 implements Atmosphere {
final Frame frame) {
// check if data are available :
final AbsoluteDate dateD = date.toAbsoluteDate();
if (dateD.compareTo(inputParams.getMaxDate()) > 0 ||
dateD.compareTo(inputParams.getMinDate()) < 0) {
if (!dateD.isBetweenOrEqualTo(inputParams.getMinDate(), inputParams.getMaxDate())) {
throw new OrekitException(OrekitMessages.NO_SOLAR_ACTIVITY_AT_DATE,
dateD, inputParams.getMinDate(), inputParams.getMaxDate());
}
......
......@@ -31,7 +31,6 @@ import org.hipparchus.util.MathUtils;
import org.orekit.annotation.DefaultDataContext;
import org.orekit.data.DataContext;
import org.orekit.errors.OrekitException;
import org.orekit.errors.OrekitInternalError;
import org.orekit.errors.OrekitMessages;
import org.orekit.orbits.EquinoctialOrbit;
import org.orekit.orbits.KeplerianOrbit;
......@@ -703,11 +702,7 @@ public class TLE implements TimeStamped, Serializable {
* @return string representation of this TLE set
*/
public String toString() {
try {
return getLine1() + System.getProperty("line.separator") + getLine2();
} catch (OrekitException oe) {
throw new OrekitInternalError(oe);
}
return getLine1() + System.getProperty("line.separator") + getLine2();
}
/**
......
......@@ -264,7 +264,7 @@ public class JacobiPolynomials {
@Override
public boolean equals(final Object key) {
if (key == null || !(key instanceof JacobiKey)) {
if (!(key instanceof JacobiKey)) {
return false;
}
......
......@@ -426,11 +426,11 @@ public class AbsoluteDate
final SumAndResidual sumAndResidual = MathUtils.twoSum(since.offset, elapsedDuration);
if (Double.isInfinite(sumAndResidual.getSum())) {
offset = sumAndResidual.getSum();
epoch = (sumAndResidual.getSum() < 0) ? Long.MIN_VALUE : Long.MAX_VALUE;
epoch = (sumAndResidual.getSum() < 0) ? Long.MIN_VALUE : Long.MAX_VALUE;
} else {
final long dl = (long) FastMath.floor(sumAndResidual.getSum());
offset = (sumAndResidual.getSum() - dl) + sumAndResidual.getResidual();
epoch = since.epoch + dl;
epoch = since.epoch + dl;
}
}
......@@ -1192,7 +1192,7 @@ public class AbsoluteDate
return true;
}
if (date != null && date instanceof AbsoluteDate) {
if (date instanceof AbsoluteDate) {
return durationFrom((AbsoluteDate) date) == 0;
}
......
......@@ -1365,7 +1365,7 @@ public class FieldAbsoluteDate<T extends RealFieldElement<T>>
return true;
}
if (date != null && date instanceof FieldAbsoluteDate) {
if (date instanceof FieldAbsoluteDate) {
return durationFrom((FieldAbsoluteDate<T>) date).getReal() == 0.0;
}
......
......@@ -51,6 +51,7 @@ import org.orekit.time.AbsoluteDate;
import org.orekit.time.TimeScalesFactory;
import org.orekit.utils.IERSConventions;
import org.orekit.utils.PVCoordinates;
import org.orekit.utils.PVCoordinatesProvider;
import org.orekit.utils.TimeStampedPVCoordinates;
public class APMParserTest {
......@@ -759,11 +760,11 @@ public class APMParserTest {
Assert.assertEquals(new AbsoluteDate(2021, 1, 1, 0, 0, 0.0, TimeScalesFactory.getTDB()),
segment.getData().getQuaternionBlock().getEpoch());
final PVCoordinatesProvider prov = (date, frame) -> new TimeStampedPVCoordinates(date,
new PVCoordinates(new Vector3D( 1.234e7, -0.567e7, 9.876e6),
new Vector3D(-0.772e4, 5.002e4, 4.892e2)));
try {
file.getAttitude(FramesFactory.getEME2000(),
(date, frame) -> new TimeStampedPVCoordinates(date,
new PVCoordinates(new Vector3D( 1.234e7, -0.567e7, 9.876e6),
new Vector3D(-0.772e4, 5.002e4, 4.892e2))));
file.getAttitude(FramesFactory.getEME2000(), prov);
Assert.fail("an exception should have been thrown");
} catch (OrekitException oe) {
Assert.assertEquals(OrekitMessages.UNSUPPORTED_LOCAL_ORBITAL_FRAME, oe.getSpecifier());
......@@ -909,6 +910,54 @@ public class APMParserTest {
}
}
@Test
public void testMissingTwoSpacecraftFrames() throws URISyntaxException {
final String name = "/ccsds/adm/apm/APM-two-spacecraft-frames.txt";
try {
final DataSource source = new DataSource(name, () -> getClass().getResourceAsStream(name));
new ParserBuilder().
withMissionReferenceDate(AbsoluteDate.J2000_EPOCH).
buildApmParser().
parseMessage(source);
Assert.fail("an exception should have been thrown");
} catch (OrekitException oe) {
Assert.assertEquals(OrekitMessages.CCSDS_INVALID_FRAME, oe.getSpecifier());
Assert.assertEquals("INSTRUMENT_2", oe.getParts()[0]);
}
}
@Test
public void testNoSpacecraftFrames() throws URISyntaxException {
final String name = "/ccsds/adm/apm/APM-no-spacecraft-frames.txt";
try {
final DataSource source = new DataSource(name, () -> getClass().getResourceAsStream(name));
new ParserBuilder().
withMissionReferenceDate(AbsoluteDate.J2000_EPOCH).
buildApmParser().
parseMessage(source);
Assert.fail("an exception should have been thrown");
} catch (OrekitException oe) {
Assert.assertEquals(OrekitMessages.CCSDS_INVALID_FRAME, oe.getSpecifier());
Assert.assertEquals("EME2000", oe.getParts()[0]);
}
}
@Test
public void testMissingFrame() throws URISyntaxException {
final String name = "/ccsds/adm/apm/APM-missing-frame.txt";
try {
final DataSource source = new DataSource(name, () -> getClass().getResourceAsStream(name));
new ParserBuilder().
withMissionReferenceDate(AbsoluteDate.J2000_EPOCH).
buildApmParser().
parseMessage(source);
Assert.fail("an exception should have been thrown");
} catch (OrekitException oe) {
Assert.assertEquals(OrekitMessages.UNINITIALIZED_VALUE_FOR_KEY, oe.getSpecifier());
Assert.assertEquals("Q_FRAME_A", oe.getParts()[0]);
}
}
@Test
public void testMissingQuaternionComponent() throws URISyntaxException {
final String name = "/ccsds/adm/apm/APM-missing-quaternion-component.txt";
......
......@@ -249,7 +249,7 @@ public class EphemerisWriterTest {
++count;
}
}
assertEquals(79, count);
assertEquals(80, count);
}
......@@ -353,6 +353,7 @@ public class EphemerisWriterTest {
private OemMetadata dummyMetadata() {
OemMetadata metadata = new OemMetadata(4);
metadata.addComment("dummy comment");
metadata.setTimeSystem(TimeSystem.TT);
metadata.setObjectID("9999-999ZZZ");
metadata.setObjectName("transgalactic");
......
......@@ -589,6 +589,24 @@ public class OpmParserTest {
validate6(parser.parseMessage(source));
}
@Test
public void testParseOPM7() {
final String ex = "/ccsds/odm/opm/OPMExample7.txt";
final DataSource source = new DataSource(ex, () -> getClass().getResourceAsStream(ex));
final OpmFile file = new ParserBuilder().buildOpmParser().parseMessage(source);
Frame frame = file.getMetadata().getFrame();
Assert.assertSame(CelestialBodyFactory.getMars().getInertiallyOrientedFrame(), frame);
}
@Test
public void testParseOPM8() {
final String ex = "/ccsds/odm/opm/OPMExample8.txt";
final DataSource source = new DataSource(ex, () -> getClass().getResourceAsStream(ex));
final OpmFile file = new ParserBuilder().buildOpmParser().parseMessage(source);
Frame frame = file.getMetadata().getFrame();
Assert.assertSame(CelestialBodyFactory.getSolarSystemBarycenter().getInertiallyOrientedFrame(), frame);
}
@Test
public void testParseNonStandardUnits() throws URISyntaxException {
// this file is similar to OPMExample6.txt but uses non-standard units
......
......@@ -28,10 +28,12 @@ import org.junit.Assert;
import org.junit.Test;
import org.orekit.data.AbstractFilesLoaderTest;
import org.orekit.errors.OrekitException;
import org.orekit.errors.OrekitMessages;
import org.orekit.time.AbsoluteDate;
import org.orekit.time.ChronologicalComparator;
import org.orekit.time.TimeScalesFactory;
import org.orekit.utils.IERSConventions;
import org.xml.sax.SAXException;
public class RapidDataAndPredictionXMLLoaderTest extends AbstractFilesLoaderTest {
......@@ -65,6 +67,34 @@ public class RapidDataAndPredictionXMLLoaderTest extends AbstractFilesLoaderTest
Assert.assertEquals(0, history.size());
}
@Test
public void testInconsistentDate() {
setRoot("rapid-data-xml");
IERSConventions.NutationCorrectionConverter converter =
IERSConventions.IERS_1996.getNutationCorrectionConverter();
SortedSet<EOPEntry> history = new TreeSet<EOPEntry>(new ChronologicalComparator());
try {
new RapidDataAndPredictionXMLLoader("^inconsistent-date\\.xml$", manager, () -> utc).fillHistory(converter, history);
Assert.fail("an exception should have been thrown");
} catch (OrekitException oe) {
Assert.assertEquals(OrekitMessages.INCONSISTENT_DATES_IN_IERS_FILE, oe.getSpecifier());
}
}
@Test
public void testMalformedXml() {
setRoot("rapid-data-xml");
IERSConventions.NutationCorrectionConverter converter =
IERSConventions.IERS_1996.getNutationCorrectionConverter();
SortedSet<EOPEntry> history = new TreeSet<EOPEntry>(new ChronologicalComparator());
try {
new RapidDataAndPredictionXMLLoader("^malformed\\.xml$", manager, () -> utc).fillHistory(converter, history);
Assert.fail("an exception should have been thrown");
} catch (OrekitException oe) {
Assert.assertTrue(oe.getCause() instanceof SAXException);
}
}
@Test
public void testStartDateDaily1980() {
setRoot("rapid-data-xml");
......
......@@ -42,6 +42,7 @@ import org.orekit.bodies.CelestialBodyFactory;
import org.orekit.bodies.GeodeticPoint;
import org.orekit.bodies.OneAxisEllipsoid;
import org.orekit.errors.OrekitException;
import org.orekit.errors.OrekitMessages;
import org.orekit.frames.Frame;
import org.orekit.frames.FramesFactory;
import org.orekit.time.AbsoluteDate;
......@@ -216,6 +217,13 @@ public class NRLMSISE00Test {
final Vector3D pos = earth.transform(point);
// Run
try {
atm.getDensity(date.shiftedBy(2 * Constants.JULIAN_YEAR), pos, itrf);
Assert.fail("an exception should have been thrown");
} catch (OrekitException oe) {
Assert.assertEquals(OrekitMessages.NO_SOLAR_ACTIVITY_AT_DATE, oe.getSpecifier());
}
final double rho = atm.getDensity(date, pos, itrf);
final double lst = 29000. / 3600. - 70. / 15.;
final double[] ap = {4., 100., 100., 100., 100., 100., 100.};
......@@ -269,6 +277,15 @@ public class NRLMSISE00Test {
Field<Decimal64> field = Decimal64Field.getInstance();
// Run
try {
atm.getDensity(new FieldAbsoluteDate<>(field, date).shiftedBy(2 * Constants.JULIAN_YEAR),
new FieldVector3D<>(field.getOne(), pos),
itrf);
Assert.fail("an exception should have been thrown");
} catch (OrekitException oe) {
Assert.assertEquals(OrekitMessages.NO_SOLAR_ACTIVITY_AT_DATE, oe.getSpecifier());
}
final double rho = atm.getDensity(date, pos, itrf);
final Decimal64 rho64 = atm.getDensity(new FieldAbsoluteDate<>(field, date),
new FieldVector3D<>(field.getOne(), pos),
......
/* Copyright 2002-2021 CS GROUP
* Licensed to CS GROUP (CS) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* CS licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.orekit.propagation.analytical.tle;
import org.hipparchus.util.Precision;
import org.junit.Assert;
import org.junit.Test;
public class TLEConstantsTest {
@Test
public void testCoverage() {
// this test is specially awkward
// it doesn't really test anything…
// its *sole* purpose is to work around a false positive coverage in SonarQube
Assert.assertTrue(Precision.equals(1.0 / 3.0, TLEConstants.ONE_THIRD, 1));
Assert.assertTrue(Precision.equals(2.0 / 3.0, TLEConstants.TWO_THIRD, 1));
Assert.assertTrue(Precision.equals(6378.135, TLEConstants.EARTH_RADIUS, 1));
Assert.assertTrue(Precision.equals(1.0, TLEConstants.NORMALIZED_EQUATORIAL_RADIUS, 1));
Assert.assertTrue(Precision.equals(1440.0, TLEConstants.MINUTES_PER_DAY, 1));
Assert.assertTrue(Precision.equals(0.0743669161331734132, TLEConstants.XKE, 1));
Assert.assertTrue(Precision.equals(-2.53881e-6, TLEConstants.XJ3, 1));
Assert.assertTrue(Precision.equals(1.082616e-3, TLEConstants.XJ2, 1));
Assert.assertTrue(Precision.equals(-1.65597e-6, TLEConstants.XJ4, 1));
Assert.assertTrue(Precision.equals(0.5 * TLEConstants.XJ2, TLEConstants.CK2, 1));
Assert.assertTrue(Precision.equals(-0.375 * TLEConstants.XJ4, TLEConstants.CK4, 1));
Assert.assertTrue(Precision.equals(1. + 78. / TLEConstants.EARTH_RADIUS, TLEConstants.S, 1));
Assert.assertTrue(Precision.equals(1.880279159015270643865e-9, TLEConstants.QOMS2T, 1));
Assert.assertTrue(Precision.equals(-TLEConstants.XJ3 / TLEConstants.CK2, TLEConstants.A3OVK2, 1));
Assert.assertTrue(Precision.equals(1.19459E-5, TLEConstants.ZNS, 1));
Assert.assertTrue(Precision.equals(0.01675, TLEConstants.ZES, 1));
Assert.assertTrue(Precision.equals(1.5835218E-4, TLEConstants.ZNL, 1));
Assert.assertTrue(Precision.equals(0.05490, TLEConstants.ZEL, 1));
Assert.assertTrue(Precision.equals(4.3752691E-3, TLEConstants.THDT, 1));
Assert.assertTrue(Precision.equals(2.9864797E-6, TLEConstants.C1SS, 1));
Assert.assertTrue(Precision.equals(4.7968065E-7, TLEConstants.C1L, 1));
Assert.assertTrue(Precision.equals(1.7891679E-6, TLEConstants.ROOT22, 1));
Assert.assertTrue(Precision.equals(3.7393792E-7, TLEConstants.ROOT32, 1));
Assert.assertTrue(Precision.equals(7.3636953E-9, TLEConstants.ROOT44, 1));
Assert.assertTrue(Precision.equals(1.1428639E-7, TLEConstants.ROOT52, 1));
Assert.assertTrue(Precision.equals(2.1765803E-9, TLEConstants.ROOT54, 1));
Assert.assertTrue(Precision.equals(1.7891679E-6, TLEConstants.Q22, 1));
Assert.assertTrue(Precision.equals(2.1460748E-6, TLEConstants.Q31, 1));
Assert.assertTrue(Precision.equals(2.2123015E-7, TLEConstants.Q33, 1));
Assert.assertTrue(Precision.equals(0.99139134268488593, TLEConstants.C_FASX2, 1));
Assert.assertTrue(Precision.equals(0.13093206501640101, TLEConstants.S_FASX2, 1));
Assert.assertTrue(Precision.equals(0.87051638752972937, TLEConstants.C_2FASX4, 1));
Assert.assertTrue(Precision.equals(-0.49213943048915526, TLEConstants.S_2FASX4, 1));
Assert.assertTrue(Precision.equals(0.43258117585763334, TLEConstants.C_3FASX6, 1));
Assert.assertTrue(Precision.equals(0.90159499016666422, TLEConstants.S_3FASX6, 1));
Assert.assertTrue(Precision.equals(0.87051638752972937, TLEConstants.C_G22, 1));
Assert.assertTrue(Precision.equals(-0.49213943048915526, TLEConstants.S_G22, 1));
Assert.assertTrue(Precision.equals(0.57972190187001149, TLEConstants.C_G32, 1));
Assert.assertTrue(Precision.equals(0.81481440616389245, TLEConstants.S_G32, 1));
Assert.assertTrue(Precision.equals(-0.22866241528815548, TLEConstants.C_G44, 1));
Assert.assertTrue(Precision.equals(0.97350577801807991, TLEConstants.S_G44, 1));
Assert.assertTrue(Precision.equals(0.49684831179884198, TLEConstants.C_G52, 1));
Assert.assertTrue(Precision.equals(0.86783740128127729, TLEConstants.S_G52, 1));
Assert.assertTrue(Precision.equals(-0.29695209575316894, TLEConstants.C_G54, 1));
Assert.assertTrue(Precision.equals(-0.95489237761529999, TLEConstants.S_G54, 1));
}
}
\ No newline at end of file
......@@ -470,7 +470,8 @@ public class TLETest {
"2 27421 98.7490 199.5121 0001333 133.9522 226.1918 14.26113993 62");
TLE tleB = new TLE("1 27421U 02021A 02124.48976499 -.00021470 00000-0 -89879-2 0 20",
"2 27421 98.7490 199.5121 0001333 133.9522 226.1918 14.26113993 62");
Assert.assertTrue(tleA.equals(tleB));
Assert.assertEquals(tleA, tleB);
Assert.assertEquals(tleA, tleA);
}
@Test
......@@ -479,7 +480,8 @@ public class TLETest {
"2 27421 98.7490 199.5121 0001333 133.9522 226.1918 14.26113993 62");
TLE tleB = new TLE("1 05555U 71086J 12026.96078249 -.00000004 00001-9 01234-9 0 9082",
"2 05555 74.0161 228.9750 0075476 328.9888 30.6709 12.26882470804545");
Assert.assertFalse(tleA.equals(tleB));
Assert.assertNotEquals(tleA, tleB);
Assert.assertNotEquals(tleA, tleA.getLine1());