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 | 28 | import org.junit.Test; |
29 | 29 | |
30 | 30 | import eu.omp.irap.vespa.epntapclient.granule.Granule; |
31 | +import eu.omp.irap.vespa.epntapclient.service.Service; | |
31 | 32 | import eu.omp.irap.vespa.epntapclient.service.ServiceCtrl; |
32 | 33 | import eu.omp.irap.vespa.epntapclient.voresource.VOResourceException; |
33 | 34 | import eu.omp.irap.vespa.epntapclient.voresource.model.Resource; |
... | ... | @@ -204,13 +205,25 @@ public class EpnTapConnectionTest { |
204 | 205 | @Test |
205 | 206 | public void getEPNServicesTest() throws CantGetVOTableException { |
206 | 207 | LOGGER.info("getEPNServicesTest"); |
207 | - EpnTapConnection facade = new EpnTapConnection(); | |
208 | 208 | |
209 | + EpnTapConnection facade = new EpnTapConnection(); | |
209 | 210 | VOTABLE voTable = facade.getEPNServices(); |
210 | 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 | 223 | int nbServices = data.getNbRows(); |
212 | 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 | 227 | assertTrue("AMDA ivoid not found.", data.isColumnContainingValue("ivoid", AMDA_IVOID)); |
215 | 228 | Map<String, Object> amda = data.getRowMapByValue("ivoid", AMDA_IVOID); |
216 | 229 | ... | ... |