Commit 2e350611a91a2be155a6e7009c3d9a259cbc3ed9
1 parent
5b96905e
Exists in
master
Check Services parsing on unit test getEPNServicesTest().
Showing
1 changed file
with
15 additions
and
2 deletions
Show diff stats
src/test/java/eu/omp/irap/vespa/epntapclient/EpnTapConnectionTest.java
@@ -28,6 +28,7 @@ import java.util.logging.Logger; | @@ -28,6 +28,7 @@ import java.util.logging.Logger; | ||
28 | import org.junit.Test; | 28 | import org.junit.Test; |
29 | 29 | ||
30 | import eu.omp.irap.vespa.epntapclient.granule.Granule; | 30 | import eu.omp.irap.vespa.epntapclient.granule.Granule; |
31 | +import eu.omp.irap.vespa.epntapclient.service.Service; | ||
31 | import eu.omp.irap.vespa.epntapclient.service.ServiceCtrl; | 32 | import eu.omp.irap.vespa.epntapclient.service.ServiceCtrl; |
32 | import eu.omp.irap.vespa.epntapclient.voresource.VOResourceException; | 33 | import eu.omp.irap.vespa.epntapclient.voresource.VOResourceException; |
33 | import eu.omp.irap.vespa.epntapclient.voresource.model.Resource; | 34 | import eu.omp.irap.vespa.epntapclient.voresource.model.Resource; |
@@ -204,13 +205,25 @@ public class EpnTapConnectionTest { | @@ -204,13 +205,25 @@ public class EpnTapConnectionTest { | ||
204 | @Test | 205 | @Test |
205 | public void getEPNServicesTest() throws CantGetVOTableException { | 206 | public void getEPNServicesTest() throws CantGetVOTableException { |
206 | LOGGER.info("getEPNServicesTest"); | 207 | LOGGER.info("getEPNServicesTest"); |
207 | - EpnTapConnection facade = new EpnTapConnection(); | ||
208 | 208 | ||
209 | + EpnTapConnection facade = new EpnTapConnection(); | ||
209 | VOTABLE voTable = facade.getEPNServices(); | 210 | VOTABLE voTable = facade.getEPNServices(); |
210 | VOTableData data = ServiceCtrl.getVoTableData(voTable); | 211 | VOTableData data = ServiceCtrl.getVoTableData(voTable); |
212 | + List<Service> services = ServiceCtrl.getServices(data); | ||
213 | + boolean foundAMDAIvoid = false; | ||
214 | + | ||
215 | + for (Service service : services) { | ||
216 | + if (AMDA_IVOID.equals(service.getIvoid())) { | ||
217 | + foundAMDAIvoid = true; | ||
218 | + assertEquals(AMDA_SHORT_NAME, service.getShortName()); | ||
219 | + } | ||
220 | + } | ||
221 | + assertTrue("AMDA service is not found.", foundAMDAIvoid); | ||
222 | + | ||
211 | int nbServices = data.getNbRows(); | 223 | int nbServices = data.getNbRows(); |
212 | assertTrue(nbServices + " ∉ [13;20].", nbServices >= 13 && nbServices <= 20); | 224 | assertTrue(nbServices + " ∉ [13;20].", nbServices >= 13 && nbServices <= 20); |
213 | - assertTrue("Column name short_name not found.", data.isContainingColumnName("short_name")); | 225 | + assertTrue("Column name short_name not found.", |
226 | + data.isContainingColumnName("short_name")); | ||
214 | assertTrue("AMDA ivoid not found.", data.isColumnContainingValue("ivoid", AMDA_IVOID)); | 227 | assertTrue("AMDA ivoid not found.", data.isColumnContainingValue("ivoid", AMDA_IVOID)); |
215 | Map<String, Object> amda = data.getRowMapByValue("ivoid", AMDA_IVOID); | 228 | Map<String, Object> amda = data.getRowMapByValue("ivoid", AMDA_IVOID); |
216 | 229 |