Commit 6f9d8f73 authored by Luc Maisonobe's avatar Luc Maisonobe

More tests.

parent a97f1418
Pipeline #1029 passed with stage
in 25 minutes and 34 seconds
......@@ -274,6 +274,7 @@ public class OcmParser extends CommonParser<OcmFile, OcmParser> implements Ephem
currentOrbitStateHistory = new ArrayList<>();
setFallback(this::processOrbitStateToken);
} else {
setFallback(structureProcessor);
if (currentOrbitStateHistoryMetadata.getCenter().getBody() != null) {
setMuCreated(currentOrbitStateHistoryMetadata.getCenter().getBody().getGM());
}
......@@ -298,6 +299,8 @@ public class OcmParser extends CommonParser<OcmFile, OcmParser> implements Ephem
physicBlock = new PhysicalProperties(metadata.getEpochT0());
}
setFallback(this::processPhysicalPropertyToken);
} else {
setFallback(structureProcessor);
}
return true;
}
......@@ -317,6 +320,7 @@ public class OcmParser extends CommonParser<OcmFile, OcmParser> implements Ephem
currentCovarianceHistory = new ArrayList<>();
setFallback(this::processCovarianceToken);
} else {
setFallback(structureProcessor);
covarianceBlocks.add(new CovarianceHistory(currentCovarianceHistoryMetadata,
currentCovarianceHistory));
currentCovarianceHistoryMetadata = null;
......@@ -340,6 +344,7 @@ public class OcmParser extends CommonParser<OcmFile, OcmParser> implements Ephem
currentManeuverHistory = new ArrayList<>();
setFallback(this::processManeuverToken);
} else {
setFallback(structureProcessor);
maneuverBlocks.add(new ManeuverHistory(currentManeuverHistoryMetadata,
currentManeuverHistory));
currentManeuverHistoryMetadata = null;
......@@ -360,6 +365,8 @@ public class OcmParser extends CommonParser<OcmFile, OcmParser> implements Ephem
perturbationsBlock = new Perturbations(context.getDataContext().getCelestialBodies());
}
setFallback(this::processPerturbationToken);
} else {
setFallback(structureProcessor);
}
return true;
}
......@@ -376,6 +383,8 @@ public class OcmParser extends CommonParser<OcmFile, OcmParser> implements Ephem
orbitDeterminationBlock = new OrbitDetermination();
}
setFallback(this::processOrbitDeterminationToken);
} else {
setFallback(structureProcessor);
}
return true;
}
......
/* 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.files.ccsds.ndm.odm.ocm;
import org.junit.Test;
import org.orekit.files.ccsds.ndm.AbstractNdmWriterTest;
import org.orekit.files.ccsds.ndm.ParserBuilder;
import org.orekit.files.ccsds.ndm.WriterBuilder;
import org.orekit.files.ccsds.section.Header;
import org.orekit.files.ccsds.section.Segment;
import org.orekit.utils.Constants;
public class OcmWriterTest extends AbstractNdmWriterTest<Header, Segment<OcmMetadata, OcmData>, OcmFile> {
protected OcmParser getParser() {
return new ParserBuilder().withMu(Constants.EIGEN5C_EARTH_MU).buildOcmParser();
}
protected OcmWriter getWriter() {
return new WriterBuilder().buildOcmWriter();
}
@Test
public void testWriteExample1() {
doTest("/ccsds/odm/ocm/OCMExample1.txt");
}
@Test
public void testWriteKvnExample2() {
doTest("/ccsds/odm/ocm/OCMExample2.txt");
}
@Test
public void testWriteXmlExample2() {
doTest("/ccsds/odm/ocm/OCMExample2.xml");
}
@Test
public void testWriteExample3() {
doTest("/ccsds/odm/ocm/OCMExample3.txt");
}
@Test
public void testWriteExample4() {
doTest("/ccsds/odm/ocm/OCMExample4.txt");
}
}
......@@ -54,3 +54,7 @@ EOP_SOURCE = IERS
INTERP_METHOD_EOP = LAGRANGE_ORDER_5
CELESTIAL_SOURCE = JPL_DE_430
META_STOP
USER_START
USER_DEFINED_LIBRARY = OREKIT
USER_STOP
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment