1   /* Copyright 2002-2025 CS GROUP
2    * Licensed to CS GROUP (CS) under one or more
3    * contributor license agreements.  See the NOTICE file distributed with
4    * this work for additional information regarding copyright ownership.
5    * CS licenses this file to You under the Apache License, Version 2.0
6    * (the "License"); you may not use this file except in compliance with
7    * the License.  You may obtain a copy of the License at
8    *
9    *   http://www.apache.org/licenses/LICENSE-2.0
10   *
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS,
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   * See the License for the specific language governing permissions and
15   * limitations under the License.
16   */
17  package org.orekit.files.ccsds.ndm.odm.oem;
18  
19  import org.junit.jupiter.api.Test;
20  import org.orekit.files.ccsds.ndm.AbstractWriterTest;
21  import org.orekit.files.ccsds.ndm.ParsedUnitsBehavior;
22  import org.orekit.files.ccsds.ndm.ParserBuilder;
23  import org.orekit.files.ccsds.ndm.WriterBuilder;
24  import org.orekit.files.ccsds.ndm.odm.OdmHeader;
25  import org.orekit.time.AbsoluteDate;
26  import org.orekit.time.TimeScalesFactory;
27  import org.orekit.utils.Constants;
28  
29  public class OemWriterTest extends AbstractWriterTest<OdmHeader, OemSegment, Oem> {
30  
31      protected OemParser getParser() {
32          return new ParserBuilder().
33                     withMu(Constants.EIGEN5C_EARTH_MU).
34                     withMissionReferenceDate(new AbsoluteDate("1996-12-17T00:00:00.000", TimeScalesFactory.getUTC())).
35                     withParsedUnitsBehavior(ParsedUnitsBehavior.STRICT_COMPLIANCE).
36                     buildOemParser();
37      }
38  
39      protected OemWriter getWriter() {
40          return new WriterBuilder().
41                     withMissionReferenceDate(new AbsoluteDate("1996-12-17T00:00:00.000", TimeScalesFactory.getUTC())).
42                     buildOemWriter();
43      }
44  
45      @Test
46      public void testWriteExample1() {
47          doTest("/ccsds/odm/oem/OEMExample1.txt");
48      }
49  
50      @Test
51      public void testWriteExample2() {
52          doTest("/ccsds/odm/oem/OEMExample2.txt");
53      }
54  
55      @Test
56      public void testWriteKvnExample3() {
57          doTest("/ccsds/odm/oem/OEMExample3.txt");
58      }
59  
60      @Test
61      public void testWriteXmlExample3() {
62          doTest("/ccsds/odm/oem/OEMExample3.txt");
63      }
64  
65      @Test
66      public void testWriteExample4() {
67          doTest("/ccsds/odm/oem/OEMExample4.txt");
68      }
69  
70      @Test
71      public void testWriteExample5() {
72          doTest("/ccsds/odm/oem/OEMExample5.txt");
73      }
74  
75      @Test
76      public void testWriteExample6() {
77          doTest("/ccsds/odm/oem/OEMExample6.txt");
78      }
79  
80      @Test
81      public void testWriteExample8() {
82          doTest("/ccsds/odm/oem/OEMExample8.txt");
83      }
84  
85      @Test
86      public void testWriteExample9() {
87          doTest("/ccsds/odm/oem/OEMExample9.txt");
88      }
89  
90      @Test
91      public void testIssue839() {
92          doTest("/ccsds/odm/oem/OEM-Issue839.txt");
93      }
94  
95  }