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.frames;
18
19 import org.junit.Test;
20 import org.orekit.data.ClasspathCrawler;
21 import org.orekit.data.DataProvidersManager;
22 import org.orekit.time.LazyLoadedTimeScales;
23 import org.orekit.time.TimeScales;
24 import org.orekit.utils.IERSConventions;
25
26 /**
27 * Unit tests for {@link LazyLoadedFrames}.
28 *
29 * @author Evan Ward
30 * @see FramesFactoryTest
31 */
32 public class LazyLoadedFramesTest {
33
34 /**
35 * Before 10.1 calling {@link FramesFactory#addDefaultEOP1980HistoryLoaders(String,
36 * String, String, String, String)} before leap seconds were available worked just
37 * fine. Ensure this class is capable of the same behavior.
38 */
39 @Test
40 public void testAddLoadersWithoutUtc() {
41 // setup
42 DataProvidersManager manager = new DataProvidersManager();
43 // prevent adding other providers
44 manager.addProvider(new ClasspathCrawler("no-data/dummy.txt"));
45 LazyLoadedEop eop = new LazyLoadedEop(manager);
46 TimeScales timeScales = new LazyLoadedTimeScales(eop);
47 LazyLoadedFrames frames = new LazyLoadedFrames(eop, timeScales, null);
48
49 // actions
50 frames.addDefaultEOP1980HistoryLoaders(null, null, null, null, null);
51 frames.addDefaultEOP2000HistoryLoaders(null, null, null, null, null);
52 frames.addEOPHistoryLoader(IERSConventions.IERS_2010, null);
53
54 // verify: no exceptions thrown
55 }
56
57 }