diff --git a/src/test/java/eu/omp/irap/vespa/epntapclient/granule/GranuleCtrlTest.java b/src/test/java/eu/omp/irap/vespa/epntapclient/granule/GranuleCtrlTest.java index 93c1386..628edfb 100644 --- a/src/test/java/eu/omp/irap/vespa/epntapclient/granule/GranuleCtrlTest.java +++ b/src/test/java/eu/omp/irap/vespa/epntapclient/granule/GranuleCtrlTest.java @@ -25,14 +25,14 @@ import java.util.List; import org.junit.Test; import eu.omp.irap.vespa.votable.votable.VOTableException.CanNotParseDataException; -import eu.omp.irap.vespa.votable.votabledata.VoTableDataTest; +import eu.omp.irap.vespa.votable.votabledata.VOTableDataTest; /** * @author N. Jourdane */ public class GranuleCtrlTest { - /** The granule controller, initialized with {@link VoTableDataTest#createVoTableData()}. */ + /** The granule controller, initialized with {@link VOTableDataTest#createVoTableData()}. */ GranuleCtrl granuleCtrl; @@ -40,7 +40,7 @@ public class GranuleCtrlTest { * Constructor of GranuleCtrlTest. */ public GranuleCtrlTest() { - granuleCtrl = new GranuleCtrl(VoTableDataTest.createVoTableData()); + granuleCtrl = new GranuleCtrl(VOTableDataTest.createVoTableData()); } /** diff --git a/src/test/java/eu/omp/irap/vespa/epntapclient/granule/GranuleTest.java b/src/test/java/eu/omp/irap/vespa/epntapclient/granule/GranuleTest.java index 6f9e1cd..3ae6b85 100644 --- a/src/test/java/eu/omp/irap/vespa/epntapclient/granule/GranuleTest.java +++ b/src/test/java/eu/omp/irap/vespa/epntapclient/granule/GranuleTest.java @@ -27,7 +27,7 @@ import java.util.logging.Logger; import org.junit.Test; -import eu.omp.irap.vespa.votable.votabledata.VoTableDataTest; +import eu.omp.irap.vespa.votable.votabledata.VOTableDataTest; /** * @author N. Jourdane @@ -40,7 +40,7 @@ public class GranuleTest { /** * Create a granule for tests purposes. It is planetary data for Uranus, got from an actual ADQL - * query, exactly the same content that {@link VoTableDataTest#createDataArray1()} + * query, exactly the same content that {@link VOTableDataTest#createDataArray1()} * * @return The granule. */ @@ -101,7 +101,7 @@ public class GranuleTest { /** * Create a granule for tests purposes. It is planetary data for Neptune, got from an actual - * query, exactly the same content that {@link VoTableDataTest#createDataArray2()} + * query, exactly the same content that {@link VOTableDataTest#createDataArray2()} * * @return The granule. */ diff --git a/src/test/java/eu/omp/irap/vespa/epntapclient/granule/VOTableDataTest.java b/src/test/java/eu/omp/irap/vespa/epntapclient/granule/VOTableDataTest.java new file mode 100644 index 0000000..febedbe --- /dev/null +++ b/src/test/java/eu/omp/irap/vespa/epntapclient/granule/VOTableDataTest.java @@ -0,0 +1,97 @@ +/* + * This file is a part of EpnTAPClient. + * This program aims to provide EPN-TAP support for software clients, like CASSIS spectrum analyzer. + * See 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 License as published + * by the Free Software Foundation, either version 3 of the License, or (at your option) any later + * version. This program is distributed in the hope that it will be useful, but WITHOUT ANY + * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU General Public License for more details. You should have received a copy of + * the GNU General Public License along with this program. If not, see + * . + */ + +package eu.omp.irap.vespa.epntapclient.granule; + +import java.util.ArrayList; +import java.util.List; + +import eu.omp.irap.vespa.votable.votabledata.VOTableData; + +/** + * @author N. Jourdane + */ +public class VOTableDataTest { + + /** + * Creates the column names corresponding to the data arrays returned by + * {@link #createDataArray1()} and {@link #createDataArray2()} . + * + * @return An array of string containing the column names. + */ + public static String[] createColumnNames() { + String[] columnNames = { "granule_uid", "granule_gid", "obs_id", "dataproduct_type", + "target_name", "target_class", "time_min", "time_max", "time_sampling_step_min", + "time_sampling_step_max", "time_exp_min", "time_exp_max", "spectral_range_min", + "spectral_range_max", "spectral_resolution_min", "spectral_resolution_max", "c1min", + "c1max", "c2min", "c2max", "c3min", "c3max", "s_region", "c1_resol_min", + "c1_resol_max", "c2_resol_min", "c2_resol_max", "c3_resol_min", "c3_resol_max", + "spatial_frame_type", "incidence_min", "incidence_max", "emergence_min", + "emergence_max", "phase_min", "phase_max", "instrument_host_name", + "instrument_name", "measurement_type", "processing_level", "creation_date", + "modification_date", "release_date", "service_title" }; + return columnNames; + } + + /** + * Create a data set for tests purposes. It is planetary data for Uranus, got from an actual + * ADQL query. + * + * @return An arrays of object containing the data values, with the same order as the columns + * returned by {@link #createColumnNames()}. + */ + public static Object[] createDataArray1() { + Object[] data1 = { "Uranus", "Planet", "7", "ca", "Uranus", "planet", Double.NaN, + Double.NaN, Double.NaN, Double.NaN, Double.NaN, Double.NaN, Double.NaN, Double.NaN, + Double.NaN, Double.NaN, Double.NaN, Double.NaN, Double.NaN, Double.NaN, Double.NaN, + Double.NaN, "", Double.NaN, Double.NaN, Double.NaN, Double.NaN, Double.NaN, + Double.NaN, "celestial", Double.NaN, Double.NaN, Double.NaN, Double.NaN, Double.NaN, + Double.NaN, "", "", "\"phys.mass\" \"phys.size.radius\"", 5, "2015-08-20", + "2015-08-20", "2015-08-20", "Planets" }; + return data1; + } + + /** + * Create a data set for tests purposes. It is planetary data for Neptune, got from an actual + * ADQL query. + * + * @return An arrays of object containing the data values, with the same order as the columns + * returned by {@link #createColumnNames()}. + */ + public static Object[] createDataArray2() { + Object[] data2 = { "Neptune", "Planet", "8", "ca", "Neptune", "planet", Double.NaN, + Double.NaN, Double.NaN, Double.NaN, Double.NaN, Double.NaN, Double.NaN, Double.NaN, + Double.NaN, Double.NaN, Double.NaN, Double.NaN, Double.NaN, Double.NaN, Double.NaN, + Double.NaN, "", Double.NaN, Double.NaN, Double.NaN, Double.NaN, Double.NaN, + Double.NaN, "celestial", Double.NaN, Double.NaN, Double.NaN, Double.NaN, Double.NaN, + Double.NaN, "", "", "\"phys.mass\" \"phys.size.radius\"", 5, "2015-08-20", + "2015-08-20", "2015-08-20", "Planets" }; + return data2; + } + + /** + * Create a VOTable data containing 2 datasets returned by {@link #createDataArray1()} and + * {@link #createDataArray2()}. + * + * @return the VOTable data. + */ + public static VOTableData createVoTableData() { + List data = new ArrayList<>(); + data.add(createDataArray1()); + data.add(createDataArray2()); + return new VOTableData("Data set test", createColumnNames(), data); + } +} -- libgit2 0.21.2