use of org.orekit.errors.OrekitException in project Orekit by CS-SI.
the class TDMParserTest method testInconsistentDataLineKeyValue.
@Test
public void testInconsistentDataLineKeyValue() {
// Inconsistent data line in KeyValue file (3 fields after keyword instead of 2)
final String ex = "/ccsds/TDM-data-inconsistent-line.txt";
final InputStream inEntry = getClass().getResourceAsStream(ex);
try {
new TDMParser().parse(inEntry, ex);
Assert.fail("An exception \"CCSDS_TDM_INCONSISTENT_DATA_LINE\"should have been thrown");
} catch (OrekitException oe) {
Assert.assertEquals(OrekitMessages.CCSDS_TDM_INCONSISTENT_DATA_LINE, oe.getSpecifier());
Assert.assertEquals(25, oe.getParts()[0]);
Assert.assertEquals("/ccsds/TDM-data-inconsistent-line.txt", oe.getParts()[1]);
Assert.assertEquals("RECEIVE_FREQ_1 = 2005-159T17:41:02 -333.0551 this-should-not-be-here", oe.getParts()[2]);
}
}
use of org.orekit.errors.OrekitException in project Orekit by CS-SI.
the class SP3ParserTest method testWrongNumberOfEpochs.
@Test
public void testWrongNumberOfEpochs() throws IOException {
try {
final String ex = "/sp3/wrong-number-of-epochs.sp3";
final Frame frame = FramesFactory.getITRF(IERSConventions.IERS_2003, true);
final SP3Parser parser = new SP3Parser(Constants.EIGEN5C_EARTH_MU, 3, s -> frame);
final InputStream inEntry = getClass().getResourceAsStream(ex);
parser.parse(inEntry);
Assert.fail("an exception should have been thrown");
} catch (OrekitException oe) {
Assert.assertEquals(OrekitMessages.SP3_NUMBER_OF_EPOCH_MISMATCH, oe.getSpecifier());
Assert.assertEquals(2, ((Integer) oe.getParts()[0]).intValue());
Assert.assertEquals(192, ((Integer) oe.getParts()[2]).intValue());
}
}
use of org.orekit.errors.OrekitException in project Orekit by CS-SI.
the class SP3ParserTest method testTruncatedLine.
@Test
public void testTruncatedLine() throws IOException {
try {
final String ex = "/sp3/truncated-line.sp3";
final Frame frame = FramesFactory.getITRF(IERSConventions.IERS_2003, true);
final SP3Parser parser = new SP3Parser(Constants.EIGEN5C_EARTH_MU, 3, s -> frame);
final InputStream inEntry = getClass().getResourceAsStream(ex);
parser.parse(inEntry);
Assert.fail("an exception should have been thrown");
} catch (OrekitException oe) {
Assert.assertEquals(OrekitMessages.UNABLE_TO_PARSE_LINE_IN_FILE, oe.getSpecifier());
Assert.assertEquals(27, ((Integer) oe.getParts()[0]).intValue());
}
}
use of org.orekit.errors.OrekitException in project Orekit by CS-SI.
the class SP3ParserTest method testMissingEOF.
@Test
public void testMissingEOF() throws IOException {
try {
final String ex = "/sp3/missing-eof.sp3";
final Frame frame = FramesFactory.getITRF(IERSConventions.IERS_2003, true);
final SP3Parser parser = new SP3Parser(Constants.EIGEN5C_EARTH_MU, 3, s -> frame);
final InputStream inEntry = getClass().getResourceAsStream(ex);
parser.parse(inEntry);
Assert.fail("an exception should have been thrown");
} catch (OrekitException oe) {
Assert.assertEquals(OrekitMessages.SP3_UNEXPECTED_END_OF_FILE, oe.getSpecifier());
Assert.assertEquals(24, ((Integer) oe.getParts()[0]).intValue());
}
}
use of org.orekit.errors.OrekitException in project Orekit by CS-SI.
the class SP3ParserTest method testUnsupportedVersion.
@Test
public void testUnsupportedVersion() throws IOException {
try {
final String ex = "/sp3/unsupported-version.sp3";
final Frame frame = FramesFactory.getITRF(IERSConventions.IERS_2003, true);
final SP3Parser parser = new SP3Parser(Constants.EIGEN5C_EARTH_MU, 3, s -> frame);
final InputStream inEntry = getClass().getResourceAsStream(ex);
parser.parse(inEntry);
Assert.fail("an exception should have been thrown");
} catch (OrekitException oe) {
Assert.assertEquals(OrekitMessages.SP3_UNSUPPORTED_VERSION, oe.getSpecifier());
Assert.assertEquals('z', ((Character) oe.getParts()[0]).charValue());
}
}
Aggregations