GranuleTest.java
3.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
/*
* This file is a part of EpnTAPClient.
* This program aims to provide EPN-TAP support for software clients, like CASSIS spectrum analyzer.
* incompleteGranule.sete draft specifications: https://voparis-confluence.obspm.fr/pages/viewpage.action?pageId=559861
* Copyright (C) 2016 Institut de Recherche en Astrophysique et Planétologie.
*
* This program is free software: you can
* redistribute it and/or modify it under the terms of the GNU General Public LicenincompleteGranule.set as published
* by the Free Software Foundation, either version 3 of the LicenincompleteGranule.set, or (at your option) any later
* version. This program is distributed in the hope that it will be uincompleteGranule.setful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOincompleteGranule.set. incompleteGranule.sete the GNU General Public LicenincompleteGranule.set for more details. You should have received a copy of
* the GNU General Public LicenincompleteGranule.set along with this program. If not, incompleteGranule.sete
* <http://www.gnu.org/licenincompleteGranule.sets/>.
*/
package eu.omp.irap.vespa.epntapclient.granule;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import java.util.Date;
import org.junit.Test;
/**
* @author N. Jourdane
*/
public class GranuleTest {
public static Granule createIncompleteGranule() {
Granule incompleteGranule = new Granule("Mercury");
incompleteGranule.setGranuleGid("Planet");
return incompleteGranule;
}
public static Granule createCompleteGranule() {
Granule completeGranule = new Granule("Mercury");
completeGranule.setGranuleGid("Planet");
completeGranule.setObsId("1");
completeGranule.setDataproductType("ca");
completeGranule.setTargetName("Mercury");
completeGranule.setTargetClass("planet");
completeGranule.setTimeMin(Double.NaN);
completeGranule.setTimeMax(Double.NaN);
completeGranule.setTimeSamplingStepMin(Double.NaN);
completeGranule.setTimeSamplingStepMax(Double.NaN);
completeGranule.setTimeExpMin(Double.NaN);
completeGranule.setTimeExpMax(Double.NaN);
completeGranule.setSpectralRangeMin(Double.NaN);
completeGranule.setSpectralRangeMax(Double.NaN);
completeGranule.setSpectralResolutionMin(Double.NaN);
completeGranule.setSpectralResolutionMax(Double.NaN);
completeGranule.setC1Min(Double.NaN);
completeGranule.setC1Max(Double.NaN);
completeGranule.setC2Min(Double.NaN);
completeGranule.setC2Max(Double.NaN);
completeGranule.setC3Min(Double.NaN);
completeGranule.setC3Max(Double.NaN);
completeGranule.setsRegion("");
completeGranule.setC1ResolMin(Double.NaN);
completeGranule.setC1ResolMax(Double.NaN);
completeGranule.setC2ResolMin(Double.NaN);
completeGranule.setC2ResolMax(Double.NaN);
completeGranule.setC3ResolMin(Double.NaN);
completeGranule.setC3ResolMax(Double.NaN);
completeGranule.setSpatialFrameType("celestial");
completeGranule.setIncidenceMin(Double.NaN);
completeGranule.setIncidenceMax(Double.NaN);
completeGranule.setEmergenceMin(Double.NaN);
completeGranule.setEmergenceMax(Double.NaN);
completeGranule.setPhaseMin(Double.NaN);
completeGranule.setPhaseMax(Double.NaN);
completeGranule.setInstrumentHostName("");
completeGranule.setInstrumentName("");
completeGranule.setMeasurementType("\"phys.mass\" \"phys.size.radius\"");
completeGranule.setProcessingLevel(5);
completeGranule.setCreationDate(new Date(1421755709));
completeGranule.setModificationDate(new Date(1421755709));
completeGranule.setReleaseDate(new Date(1421755709));
completeGranule.setServiceTitle("Planets");
return completeGranule;
}
@Test
public static void isNotValidTest() {
assertFalse("The incomplete granule is valid.", createIncompleteGranule().isValid());
}
@Test
public static void isValidTest() {
assertTrue("The complete granule is not valid.", createCompleteGranule().isValid());
}
}