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