1 package org.orekit.files.iirv;
2
3 import org.junit.jupiter.api.BeforeEach;
4 import org.junit.jupiter.api.Test;
5 import org.orekit.Utils;
6 import org.orekit.errors.OrekitException;
7 import org.orekit.errors.OrekitIllegalArgumentException;
8 import org.orekit.files.iirv.terms.CheckSumTerm;
9 import org.orekit.files.iirv.terms.CoordinateSystemTerm;
10 import org.orekit.files.iirv.terms.CrossSectionalAreaTerm;
11 import org.orekit.files.iirv.terms.DataSourceTerm;
12 import org.orekit.files.iirv.terms.DayOfYearTerm;
13 import org.orekit.files.iirv.terms.DragCoefficientTerm;
14 import org.orekit.files.iirv.terms.IIRVTermUtils;
15 import org.orekit.files.iirv.terms.MassTerm;
16 import org.orekit.files.iirv.terms.MessageClassTerm;
17 import org.orekit.files.iirv.terms.MessageEndConstantTerm;
18 import org.orekit.files.iirv.terms.MessageIDTerm;
19 import org.orekit.files.iirv.terms.MessageSourceTerm;
20 import org.orekit.files.iirv.terms.MessageStartConstantTerm;
21 import org.orekit.files.iirv.terms.MessageTypeTerm;
22 import org.orekit.files.iirv.terms.OriginIdentificationTerm;
23 import org.orekit.files.iirv.terms.OriginatorRoutingIndicatorTerm;
24 import org.orekit.files.iirv.terms.PositionVectorComponentTerm;
25 import org.orekit.files.iirv.terms.RoutingIndicatorTerm;
26 import org.orekit.files.iirv.terms.SequenceNumberTerm;
27 import org.orekit.files.iirv.terms.SolarReflectivityCoefficientTerm;
28 import org.orekit.files.iirv.terms.SpareConstantTerm;
29 import org.orekit.files.iirv.terms.SupportIdCodeTerm;
30 import org.orekit.files.iirv.terms.TransferTypeConstantTerm;
31 import org.orekit.files.iirv.terms.VectorTypeTerm;
32 import org.orekit.files.iirv.terms.VehicleIdCodeTerm;
33 import org.orekit.files.iirv.terms.VelocityVectorComponentTerm;
34 import org.orekit.files.iirv.terms.base.DoubleValuedIIRVTerm;
35
36 import static org.junit.jupiter.api.Assertions.assertEquals;
37 import static org.junit.jupiter.api.Assertions.assertFalse;
38 import static org.junit.jupiter.api.Assertions.assertThrows;
39 import static org.junit.jupiter.api.Assertions.assertTrue;
40
41
42
43
44 public class IIRVTermTest {
45
46 @BeforeEach
47 public void setUp() {
48
49 Utils.setDataRoot("regular-data");
50 }
51
52
53
54
55 @Test
56 void testCheckSumTerm() {
57
58 assertEquals(12, new CheckSumTerm(12).value());
59 assertEquals(12, new CheckSumTerm("012").value());
60 assertEquals("012", new CheckSumTerm("012").toEncodedString());
61
62
63 assertThrows(OrekitIllegalArgumentException.class, () -> new CheckSumTerm(1000));
64 assertThrows(OrekitIllegalArgumentException.class, () -> new CheckSumTerm("x"));
65 assertThrows(OrekitIllegalArgumentException.class, () -> new CheckSumTerm(-12));
66
67
68 assertTrue(CheckSumTerm.validateLineCheckSum("00000000000000000-0000000001"));
69 assertFalse(CheckSumTerm.validateLineCheckSum("00000000000000000-0000000000"));
70 assertTrue(CheckSumTerm.validateLineCheckSum("00000000000000000 0000000000"));
71 assertFalse(CheckSumTerm.validateLineCheckSum("00000000000000000 0000000001"));
72
73
74 MessageClassTerm term1 = MessageClassTerm.NOMINAL;
75 DayOfYearTerm term2 = new DayOfYearTerm(202);
76 VelocityVectorComponentTerm term3 = new VelocityVectorComponentTerm(-5.211);
77
78 assertEquals(1, CheckSumTerm.fromIIRVTerms(term1).value());
79 assertEquals(4, CheckSumTerm.fromIIRVTerms(term2).value());
80 assertEquals(10, CheckSumTerm.fromIIRVTerms(term3).value());
81 assertEquals(15, CheckSumTerm.fromIIRVTerms(term1, term2, term3).value());
82 }
83
84
85
86
87 @Test
88 void testCoordinateSystemTerm() {
89
90
91
92 assertEquals(new CoordinateSystemTerm("1"), CoordinateSystemTerm.GEOCENTRIC_TRUE_OF_DATE_ROTATING);
93 assertEquals(new CoordinateSystemTerm("2"), CoordinateSystemTerm.GEOCENTRIC_MEAN_B1950);
94 assertEquals(new CoordinateSystemTerm("3"), CoordinateSystemTerm.HELIOCENTRIC_B1950);
95 assertEquals(new CoordinateSystemTerm("4"), CoordinateSystemTerm.JPL_RESERVED_1);
96 assertEquals(new CoordinateSystemTerm("5"), CoordinateSystemTerm.JPL_RESERVED_2);
97 assertEquals(new CoordinateSystemTerm("6"), CoordinateSystemTerm.GEOCENTRIC_MEAN_OF_J2000);
98 assertEquals(new CoordinateSystemTerm("7"), CoordinateSystemTerm.HELIOCENTRIC_J2000);
99
100
101 assertEquals(new CoordinateSystemTerm("6"), new CoordinateSystemTerm(6));
102
103
104 assertEquals(new CoordinateSystemTerm("6").hashCode(), new CoordinateSystemTerm(6).hashCode());
105
106
107 assertThrows(OrekitIllegalArgumentException.class, () -> new CoordinateSystemTerm("0"));
108 assertThrows(OrekitIllegalArgumentException.class, () -> new CoordinateSystemTerm("-1"));
109 assertThrows(OrekitIllegalArgumentException.class, () -> new CoordinateSystemTerm(" 1"));
110 assertThrows(OrekitIllegalArgumentException.class, () -> new CoordinateSystemTerm("1 "));
111 assertThrows(OrekitIllegalArgumentException.class, () -> new CoordinateSystemTerm(0));
112 assertThrows(OrekitIllegalArgumentException.class, () -> new CoordinateSystemTerm(-1));
113 assertThrows(OrekitIllegalArgumentException.class, () -> new CoordinateSystemTerm(8));
114 assertThrows(OrekitIllegalArgumentException.class, () -> new CoordinateSystemTerm("8"));
115
116
117 assertEquals("GTOD/2010 simple EOP", CoordinateSystemTerm.GEOCENTRIC_TRUE_OF_DATE_ROTATING.getFrame().toString());
118 assertEquals("EME2000", CoordinateSystemTerm.GEOCENTRIC_MEAN_OF_J2000.getFrame().toString());
119 assertEquals("Sun/inertial", CoordinateSystemTerm.HELIOCENTRIC_J2000.getFrame().toString());
120
121
122 assertThrows(OrekitException.class, CoordinateSystemTerm.GEOCENTRIC_MEAN_B1950::getFrame);
123 assertThrows(OrekitException.class, CoordinateSystemTerm.HELIOCENTRIC_B1950::getFrame);
124 assertThrows(OrekitException.class, CoordinateSystemTerm.JPL_RESERVED_1::getFrame);
125 assertThrows(OrekitException.class, CoordinateSystemTerm.JPL_RESERVED_2::getFrame);
126 assertThrows(OrekitException.class, CoordinateSystemTerm.JPL_RESERVED_2::getFrame);
127 }
128
129
130
131
132 @Test
133 void testCrossSectionalAreaTerm() {
134 assertEquals(CrossSectionalAreaTerm.UNUSED, new CrossSectionalAreaTerm(0));
135
136 assertEquals(new CrossSectionalAreaTerm("23181"), new CrossSectionalAreaTerm(231.81));
137 assertEquals(new CrossSectionalAreaTerm("23181"), new CrossSectionalAreaTerm(231.811));
138 assertEquals(new CrossSectionalAreaTerm("23181"), new CrossSectionalAreaTerm(231.808));
139
140 assertEquals(new CrossSectionalAreaTerm("23181").hashCode(), new CrossSectionalAreaTerm(231.808).hashCode());
141 }
142
143
144
145
146 @Test
147 void testDataSourceTerm() {
148 assertEquals(DataSourceTerm.NOMINAL, new DataSourceTerm("1"));
149 assertEquals(DataSourceTerm.NOMINAL, new DataSourceTerm(1));
150 assertEquals(DataSourceTerm.REAL_TIME, new DataSourceTerm("2"));
151 assertEquals(DataSourceTerm.REAL_TIME, new DataSourceTerm(2));
152 assertEquals(DataSourceTerm.OFFLINE, new DataSourceTerm("3"));
153 assertEquals(DataSourceTerm.OFFLINE, new DataSourceTerm(3));
154 assertEquals(DataSourceTerm.OFFLINE_MEAN, new DataSourceTerm("4"));
155 assertEquals(DataSourceTerm.OFFLINE_MEAN, new DataSourceTerm(4));
156 }
157
158
159
160
161 @Test
162 void testDragCoefficientTerm() {
163 assertEquals(new DragCoefficientTerm("1234"), new DragCoefficientTerm(12.34));
164 assertEquals(DragCoefficientTerm.UNUSED, new DragCoefficientTerm(0));
165
166 }
167
168
169
170
171 @Test
172 void testMassTerm() {
173 assertEquals(new MassTerm("00010000"), new MassTerm(1000.0));
174 assertEquals(MassTerm.UNUSED, new MassTerm(0));
175 }
176
177
178
179
180 @Test
181 void testMessageClassTerm() {
182 assertEquals(MessageClassTerm.NOMINAL, new MessageClassTerm(10));
183 assertEquals(MessageClassTerm.NOMINAL, new MessageClassTerm("10"));
184 assertEquals(MessageClassTerm.INFLIGHT_UPDATE, new MessageClassTerm(15));
185 assertEquals(MessageClassTerm.INFLIGHT_UPDATE, new MessageClassTerm("15"));
186
187
188 assertThrows(OrekitIllegalArgumentException.class, () -> new MessageClassTerm(1));
189 assertThrows(OrekitIllegalArgumentException.class, () -> new MessageClassTerm("1"));
190 assertThrows(OrekitIllegalArgumentException.class, () -> new MessageClassTerm(-10));
191 }
192
193
194
195
196 @Test
197 void testMessageEndConstantTerm() {
198 assertEquals(new MessageEndConstantTerm().value(), "ITERM");
199 assertEquals(new MessageEndConstantTerm().value(), MessageEndConstantTerm.MESSAGE_END_TERM_STRING);
200 }
201
202
203
204
205 @Test
206 void testMessageIDTerm() {
207 assertEquals(new MessageIDTerm(9381225), new MessageIDTerm("9381225"));
208
209
210 assertThrows(OrekitIllegalArgumentException.class, () -> new MessageIDTerm("938122A"));
211 }
212
213
214
215
216 @Test
217 void testMessageSourceConstantTerm() {
218 assertEquals("0", MessageSourceTerm.DEFAULT.value());
219 assertEquals("0", new MessageSourceTerm("0").value());
220 assertEquals("A", new MessageSourceTerm("A").value());
221 assertEquals("a", new MessageSourceTerm("a").value());
222
223 assertThrows(OrekitIllegalArgumentException.class, () -> new MessageSourceTerm(","));
224 assertThrows(OrekitIllegalArgumentException.class, () -> new MessageSourceTerm(""));
225 }
226
227
228
229
230 @Test
231 void testMessageStartConstantTerm() {
232 assertEquals("GIIRV", new MessageStartConstantTerm().value());
233 }
234
235
236
237
238 @Test
239 void testMessageTypeConstantTerm() {
240 assertEquals(new MessageTypeTerm("03"), MessageTypeTerm.DEFAULT);
241 assertEquals("03", new MessageTypeTerm("03").value());
242 assertEquals("B9", new MessageTypeTerm("B9").value());
243 assertEquals("a ", new MessageTypeTerm("a ").value());
244
245 assertThrows(OrekitIllegalArgumentException.class, () -> new MessageTypeTerm("$2"));
246 assertThrows(OrekitIllegalArgumentException.class, () -> new MessageTypeTerm("222"));
247 assertThrows(OrekitIllegalArgumentException.class, () -> new MessageTypeTerm("q"));
248 }
249
250
251
252
253 @Test
254 void testOriginatorRoutingIndicatorTerm() {
255 assertEquals(new OriginatorRoutingIndicatorTerm("GCQU"), OriginatorRoutingIndicatorTerm.GCQU);
256 assertEquals(new OriginatorRoutingIndicatorTerm("GAQD"), OriginatorRoutingIndicatorTerm.GAQD);
257 }
258
259
260
261
262 @Test
263 void testOriginIdentificationTerm() {
264 assertEquals(new OriginIdentificationTerm(" "), OriginIdentificationTerm.GSFC);
265 assertEquals(new OriginIdentificationTerm("Z"), OriginIdentificationTerm.WLP);
266 assertEquals(new OriginIdentificationTerm("E"), OriginIdentificationTerm.ETR);
267 assertEquals(new OriginIdentificationTerm("L"), OriginIdentificationTerm.JPL);
268 assertEquals(new OriginIdentificationTerm("W"), OriginIdentificationTerm.WTR);
269 assertEquals(new OriginIdentificationTerm("J"), OriginIdentificationTerm.JSC);
270 assertEquals(new OriginIdentificationTerm("P"), OriginIdentificationTerm.PMR);
271 assertEquals(new OriginIdentificationTerm("A"), OriginIdentificationTerm.CSTC);
272 assertEquals(new OriginIdentificationTerm("K"), OriginIdentificationTerm.KMR);
273 assertEquals(new OriginIdentificationTerm("C"), OriginIdentificationTerm.CNES);
274
275
276 assertThrows(OrekitIllegalArgumentException.class, () -> new OriginIdentificationTerm("GSFC"));
277 }
278
279
280
281
282
283 @Test
284 void testPositionVectorComponentTerm() {
285
286
287 assertEquals(new PositionVectorComponentTerm(1800799.012), new PositionVectorComponentTerm(" 000001800799"));
288
289
290 assertEquals(new PositionVectorComponentTerm(-2068482.799), new PositionVectorComponentTerm("-000002068483"));
291
292
293 final int posComponentInt = 2954112;
294 final long posComponentLong = 2954112L;
295 final String posComponentString = " 000002954112";
296 assertEquals(new PositionVectorComponentTerm(posComponentInt), new PositionVectorComponentTerm(posComponentString));
297
298
299 assertEquals(new PositionVectorComponentTerm(posComponentLong), new PositionVectorComponentTerm(posComponentInt));
300
301
302 assertEquals(new PositionVectorComponentTerm(-2954112), new PositionVectorComponentTerm("-000002954112"));
303
304
305 assertEquals(posComponentInt, new PositionVectorComponentTerm(posComponentLong).toInt());
306
307
308 assertEquals(1234, DoubleValuedIIRVTerm.computeValueFromString("1234", 0));
309
310
311 assertThrows(OrekitIllegalArgumentException.class, () -> new PositionVectorComponentTerm(" 00000799"));
312
313
314 assertThrows(OrekitIllegalArgumentException.class, () -> new PositionVectorComponentTerm(" 00000000000000799"));
315
316
317 assertThrows(OrekitIllegalArgumentException.class, () -> new PositionVectorComponentTerm(" 0000079a"));
318
319
320 assertThrows(OrekitIllegalArgumentException.class, () -> new PositionVectorComponentTerm("0000001800799"));
321
322
323 assertThrows(OrekitIllegalArgumentException.class, () -> new PositionVectorComponentTerm(99999999999991L));
324 assertThrows(OrekitIllegalArgumentException.class, () -> new PositionVectorComponentTerm(-99999999999991L));
325
326
327 PositionVectorComponentTerm positiveZero = new PositionVectorComponentTerm(" 000000000000");
328 PositionVectorComponentTerm negativeZero = new PositionVectorComponentTerm("-000000000000");
329 assertEquals(positiveZero.toInt(), negativeZero.toInt());
330 assertEquals(positiveZero.value(), negativeZero.value());
331 assertEquals(positiveZero.toEncodedString(), negativeZero.toEncodedString());
332 }
333
334
335
336
337 @Test
338 void testRoutingIndicatorTerm() {
339 assertEquals(new RoutingIndicatorTerm("GSFC"), RoutingIndicatorTerm.GSFC);
340 assertEquals(new RoutingIndicatorTerm(" WLP"), RoutingIndicatorTerm.WLP);
341 assertEquals(new RoutingIndicatorTerm(" ETR"), RoutingIndicatorTerm.ETR);
342 assertEquals(new RoutingIndicatorTerm(" JPL"), RoutingIndicatorTerm.JPL);
343 assertEquals(new RoutingIndicatorTerm(" WTR"), RoutingIndicatorTerm.WTR);
344 assertEquals(new RoutingIndicatorTerm(" JSC"), RoutingIndicatorTerm.JSC);
345 assertEquals(new RoutingIndicatorTerm(" PMR"), RoutingIndicatorTerm.PMR);
346 assertEquals(new RoutingIndicatorTerm("CSTC"), RoutingIndicatorTerm.CSTC);
347 assertEquals(new RoutingIndicatorTerm(" KMR"), RoutingIndicatorTerm.KMR);
348 assertEquals(new RoutingIndicatorTerm("CNES"), RoutingIndicatorTerm.CNES);
349 assertEquals(new RoutingIndicatorTerm("MANY"), RoutingIndicatorTerm.MANY);
350
351
352 assertThrows(OrekitIllegalArgumentException.class, () -> new RoutingIndicatorTerm(" "));
353
354
355 assertThrows(OrekitIllegalArgumentException.class, () -> new RoutingIndicatorTerm("KMR"));
356 }
357
358
359
360
361 @Test
362 void testSequenceNumberTerm() {
363 assertEquals(new SequenceNumberTerm("000"), new SequenceNumberTerm(0));
364 assertEquals(new SequenceNumberTerm("123"), new SequenceNumberTerm(123));
365
366
367 assertThrows(OrekitIllegalArgumentException.class, () -> new SequenceNumberTerm(-1));
368 assertThrows(OrekitIllegalArgumentException.class, () -> new SequenceNumberTerm(1000));
369 }
370
371
372
373
374 @Test
375 void testSolarReflectivityCoefficientTerm() {
376
377
378 assertEquals(new SolarReflectivityCoefficientTerm(" 1000000"), new SolarReflectivityCoefficientTerm(1));
379
380
381 assertEquals(SolarReflectivityCoefficientTerm.UNUSED, new SolarReflectivityCoefficientTerm(0));
382
383
384 assertEquals(new SolarReflectivityCoefficientTerm("-1000001"), new SolarReflectivityCoefficientTerm(-1.000001));
385
386
387 assertEquals(new SolarReflectivityCoefficientTerm("-1000001"), new SolarReflectivityCoefficientTerm(-1.0000006));
388
389
390 assertThrows(OrekitIllegalArgumentException.class, () -> new SolarReflectivityCoefficientTerm(10));
391 }
392
393
394
395
396 @Test
397 void testSpareConstantTerm() {
398 assertEquals(new SpareConstantTerm().value(), " ");
399 assertEquals(new SpareConstantTerm().value(), SpareConstantTerm.SPARE_TERM_STRING);
400 }
401
402
403
404
405 @Test
406 void testSupportIdCodeTerm() {
407 assertEquals(new SupportIdCodeTerm("3254"), new SupportIdCodeTerm(3254));
408
409
410 assertThrows(OrekitIllegalArgumentException.class, () -> new SupportIdCodeTerm(-1));
411 assertThrows(OrekitIllegalArgumentException.class, () -> new SupportIdCodeTerm(10000));
412 }
413
414
415
416
417 @Test
418 void testTransferTypeConstantTerm() {
419 assertEquals(new TransferTypeConstantTerm().value(), "1");
420 assertEquals(new TransferTypeConstantTerm().value(), TransferTypeConstantTerm.TRANSFER_TYPE_TERM_STRING);
421 }
422
423
424
425
426 @Test
427 void testVectorTypeTerm() {
428 assertEquals(VectorTypeTerm.FREE_FLIGHT, new VectorTypeTerm("1"));
429 assertEquals(VectorTypeTerm.FORCED, new VectorTypeTerm("2"));
430 assertEquals(VectorTypeTerm.SPARE3, new VectorTypeTerm("3"));
431 assertEquals(VectorTypeTerm.MANEUVER_IGNITION, new VectorTypeTerm("4"));
432 assertEquals(VectorTypeTerm.MANEUVER_CUTOFF, new VectorTypeTerm("5"));
433 assertEquals(VectorTypeTerm.REENTRY, new VectorTypeTerm("6"));
434 assertEquals(VectorTypeTerm.POWERED_FLIGHT, new VectorTypeTerm("7"));
435 assertEquals(VectorTypeTerm.STATIONARY, new VectorTypeTerm("8"));
436 assertEquals(VectorTypeTerm.SPARE9, new VectorTypeTerm("9"));
437
438
439 assertEquals(new VectorTypeTerm(8), new VectorTypeTerm("8"));
440 }
441
442
443
444
445 @Test
446 void testVehicleIdCodeTerm() {
447 assertEquals(VehicleIdCodeTerm.DEFAULT, new VehicleIdCodeTerm(1));
448 assertEquals(new VehicleIdCodeTerm(2), new VehicleIdCodeTerm("02"));
449
450
451 assertThrows(OrekitIllegalArgumentException.class, () -> new VehicleIdCodeTerm(0));
452
453
454 assertThrows(OrekitIllegalArgumentException.class, () -> new VehicleIdCodeTerm("1"));
455 }
456
457
458
459
460
461 @Test
462 void testVelocityVectorComponentTerm() {
463
464
465 assertEquals(new VelocityVectorComponentTerm(1800.799), new VelocityVectorComponentTerm(" 000001800799"));
466
467
468 assertEquals(new VelocityVectorComponentTerm(-1800.799), new VelocityVectorComponentTerm("-000001800799"));
469
470
471 assertEquals(new VelocityVectorComponentTerm(1800), new VelocityVectorComponentTerm(" 000001800000"));
472
473
474 assertEquals(new VelocityVectorComponentTerm(1800L), new VelocityVectorComponentTerm(1800));
475
476
477 assertEquals(new VelocityVectorComponentTerm(-1800), new VelocityVectorComponentTerm("-000001800000"));
478
479
480 assertEquals(new VelocityVectorComponentTerm(1800.99999), new VelocityVectorComponentTerm(" 000001801000"));
481
482
483 assertEquals(new VelocityVectorComponentTerm(1800.7999), new VelocityVectorComponentTerm(" 000001800800"));
484
485
486 assertEquals(new VelocityVectorComponentTerm(1800.00001), new VelocityVectorComponentTerm(" 000001800000"));
487
488
489 assertEquals(new VelocityVectorComponentTerm(1800.7991), new VelocityVectorComponentTerm(" 000001800799"));
490
491
492 assertEquals(new VelocityVectorComponentTerm(1800.7925), new VelocityVectorComponentTerm(" 000001800793"));
493
494
495 assertEquals(new VelocityVectorComponentTerm(-1800.7999), new VelocityVectorComponentTerm("-000001800800"));
496
497
498 assertEquals(new VelocityVectorComponentTerm(1800.799).hashCode(), new VelocityVectorComponentTerm(" 000001800799").hashCode());
499
500
501 VelocityVectorComponentTerm posZeroOne = new VelocityVectorComponentTerm(" 000000000000");
502 VelocityVectorComponentTerm posZeroTwo = new VelocityVectorComponentTerm(1e-16);
503 VelocityVectorComponentTerm negZeroOne = new VelocityVectorComponentTerm("-000000000000");
504 VelocityVectorComponentTerm negZeroTwo = new VelocityVectorComponentTerm(-1e-16);
505 assertEquals(posZeroOne.toEncodedString(), posZeroTwo.toEncodedString());
506 assertEquals(posZeroOne.toEncodedString(), negZeroOne.toEncodedString());
507 assertEquals(posZeroOne.toEncodedString(), negZeroTwo.toEncodedString());
508
509
510 assertThrows(OrekitIllegalArgumentException.class, () -> new VelocityVectorComponentTerm(" 00000799"));
511
512
513 assertThrows(OrekitIllegalArgumentException.class, () -> new VelocityVectorComponentTerm(" 00000000000000799"));
514
515
516 assertThrows(OrekitIllegalArgumentException.class, () -> new VelocityVectorComponentTerm(" 0000079a"));
517
518
519 assertThrows(OrekitIllegalArgumentException.class, () -> new VelocityVectorComponentTerm("0000001800799"));
520
521
522 assertThrows(OrekitIllegalArgumentException.class, () -> new VelocityVectorComponentTerm(9999999999.999));
523 assertThrows(OrekitIllegalArgumentException.class, () -> new VelocityVectorComponentTerm(-9999999999.999));
524
525
526 }
527
528
529
530
531 @Test
532 void testLinePadding() {
533 final String testString = "X";
534
535 assertEquals("--X", IIRVTermUtils.addPadding(testString, '-', 3, true));
536 assertEquals("X--", IIRVTermUtils.addPadding(testString, '-', 3, false));
537 assertEquals("---", IIRVTermUtils.addPadding("", '-', 3, false));
538
539
540 assertThrows(OrekitException.class, () -> IIRVTermUtils.addPadding(testString, '-', -1, true));
541
542 }
543 }