From 2e350611a91a2be155a6e7009c3d9a259cbc3ed9 Mon Sep 17 00:00:00 2001 From: Nathanael Jourdane Date: Wed, 18 May 2016 15:52:20 +0200 Subject: [PATCH] Check Services parsing on unit test getEPNServicesTest(). --- src/test/java/eu/omp/irap/vespa/epntapclient/EpnTapConnectionTest.java | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/test/java/eu/omp/irap/vespa/epntapclient/EpnTapConnectionTest.java b/src/test/java/eu/omp/irap/vespa/epntapclient/EpnTapConnectionTest.java index 4d6ad82..acaf4ce 100644 --- a/src/test/java/eu/omp/irap/vespa/epntapclient/EpnTapConnectionTest.java +++ b/src/test/java/eu/omp/irap/vespa/epntapclient/EpnTapConnectionTest.java @@ -28,6 +28,7 @@ import java.util.logging.Logger; import org.junit.Test; import eu.omp.irap.vespa.epntapclient.granule.Granule; +import eu.omp.irap.vespa.epntapclient.service.Service; import eu.omp.irap.vespa.epntapclient.service.ServiceCtrl; import eu.omp.irap.vespa.epntapclient.voresource.VOResourceException; import eu.omp.irap.vespa.epntapclient.voresource.model.Resource; @@ -204,13 +205,25 @@ public class EpnTapConnectionTest { @Test public void getEPNServicesTest() throws CantGetVOTableException { LOGGER.info("getEPNServicesTest"); - EpnTapConnection facade = new EpnTapConnection(); + EpnTapConnection facade = new EpnTapConnection(); VOTABLE voTable = facade.getEPNServices(); VOTableData data = ServiceCtrl.getVoTableData(voTable); + List services = ServiceCtrl.getServices(data); + boolean foundAMDAIvoid = false; + + for (Service service : services) { + if (AMDA_IVOID.equals(service.getIvoid())) { + foundAMDAIvoid = true; + assertEquals(AMDA_SHORT_NAME, service.getShortName()); + } + } + assertTrue("AMDA service is not found.", foundAMDAIvoid); + int nbServices = data.getNbRows(); assertTrue(nbServices + " ∉ [13;20].", nbServices >= 13 && nbServices <= 20); - assertTrue("Column name short_name not found.", data.isContainingColumnName("short_name")); + assertTrue("Column name short_name not found.", + data.isContainingColumnName("short_name")); assertTrue("AMDA ivoid not found.", data.isColumnContainingValue("ivoid", AMDA_IVOID)); Map amda = data.getRowMapByValue("ivoid", AMDA_IVOID); -- libgit2 0.21.2