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.tdm;
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.section.Segment;
25  
26  public class TdmWriterTest extends AbstractWriterTest<TdmHeader, Segment<TdmMetadata, ObservationsBlock>, Tdm> {
27  
28      protected TdmParser getParser() {
29          return new ParserBuilder().
30                 withParsedUnitsBehavior(ParsedUnitsBehavior.STRICT_COMPLIANCE).
31                 buildTdmParser();
32      }
33  
34      protected TdmWriter getWriter() {
35          return new WriterBuilder().buildTdmWriter();
36      }
37  
38      @Test
39      public void testWriteKvnExample15() {
40          doTest("/ccsds/tdm/kvn/TDMExample15.txt");
41      }
42  
43      @Test
44      public void testWriteKvnExample2() {
45          doTest("/ccsds/tdm/kvn/TDMExample2.txt");
46      }
47  
48      @Test
49      public void testWriteKvnExample4() {
50          doTest("/ccsds/tdm/kvn/TDMExample4.txt");
51      }
52  
53      @Test
54      public void testWriteKvnExample6() {
55          doTest("/ccsds/tdm/kvn/TDMExample6.txt");
56      }
57  
58      @Test
59      public void testWriteKvnExample8() {
60          doTest("/ccsds/tdm/kvn/TDMExample8.txt");
61      }
62  
63      @Test
64      public void testWriteKvnExampleAllKeywordsSequential() {
65          doTest("/ccsds/tdm/kvn/TDMExampleAllKeywordsSequential.txt");
66      }
67  
68      @Test
69      public void testWriteKvnExampleAllKeywordsSingleDiff() {
70          doTest("/ccsds/tdm/kvn/TDMExampleAllKeywordsSingleDiff.txt");
71      }
72  
73      @Test
74      public void testWriteXmlExample15() {
75          doTest("/ccsds/tdm/xml/TDMExample15.xml");
76      }
77  
78      @Test
79      public void testWriteXmlExample2() {
80          doTest("/ccsds/tdm/xml/TDMExample2.xml");
81      }
82  
83      @Test
84      public void testWriteXmlExample4() {
85          doTest("/ccsds/tdm/xml/TDMExample4.xml");
86      }
87  
88      @Test
89      public void testWriteXmlExample6() {
90          doTest("/ccsds/tdm/xml/TDMExample6.xml");
91      }
92  
93      @Test
94      public void testWriteXmlExample8() {
95          doTest("/ccsds/tdm/xml/TDMExample8.xml");
96      }
97  
98      @Test
99      public void testWriteXmlExampleAllKeywordsSequential() {
100         doTest("/ccsds/tdm/xml/TDMExampleAllKeywordsSequential.xml");
101     }
102 
103     @Test
104     public void testWriteXmlExampleAllKeywordsSingleDiff() {
105         doTest("/ccsds/tdm/xml/TDMExampleAllKeywordsSingleDiff.xml");
106     }
107 
108 }