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.gnss.metric.parser;
18  
19  import org.junit.jupiter.api.Assertions;
20  import org.junit.jupiter.api.Test;
21  import org.orekit.errors.OrekitInternalError;
22  
23  public class DataFieldTest {
24  
25      @Test
26      public void testDefaultMethods() {
27          MockDataField mdf = new MockDataField();
28  
29          // Boolean
30          try {
31              mdf.booleanValue(null);
32              Assertions.fail("an exception should have been thrown");
33          } catch (OrekitInternalError oie) {
34              Assertions.assertNull(oie.getCause());
35          }
36  
37          // Integer
38          try {
39              mdf.intValue(null);
40              Assertions.fail("an exception should have been thrown");
41          } catch (OrekitInternalError oie) {
42              Assertions.assertNull(oie.getCause());
43          }
44  
45          // Double
46          try {
47              mdf.doubleValue(null);
48              Assertions.fail("an exception should have been thrown");
49          } catch (OrekitInternalError oie) {
50              Assertions.assertNull(oie.getCause());
51          }
52  
53          // String
54          try {
55              mdf.stringValue(null, 0);
56              Assertions.fail("an exception should have been thrown");
57          } catch (OrekitInternalError oie) {
58              Assertions.assertNull(oie.getCause());
59          }
60  
61      }
62  
63      private static class MockDataField implements DataField {
64          // Noting to do ...
65      }
66  
67  }