From ed23bdf93e59e6f6150bc8c3150175f81e2ba23e Mon Sep 17 00:00:00 2001 From: MBorne Date: Thu, 8 Aug 2024 17:37:46 +0200 Subject: [PATCH 1/8] refactor(test): validator-plugin-dgpr - update model using a JSON model for tests (refs #351) --- .../fr/ign/validator/DgprApplicationTest.java | 14 +- .../config/covadis_di_2018/files.json | 235 ++++++++++++++++++ .../config/covadis_di_2018/files.xml | 191 -------------- .../types/N_prefixTri_CARTE_INOND_S_ddd.json | 124 +++++++++ .../types/N_prefixTri_CARTE_INOND_S_ddd.xml | 99 -------- .../types/N_prefixTri_CARTE_RISQ_S_ddd.json | 67 +++++ .../types/N_prefixTri_CARTE_RISQ_S_ddd.xml | 51 ---- .../types/N_prefixTri_CHAMP_VIT_P_ddd.json | 115 +++++++++ .../types/N_prefixTri_CHAMP_VIT_P_ddd.xml | 92 ------- .../types/N_prefixTri_COMMUNE_S_ddd.json | 124 +++++++++ .../types/N_prefixTri_COMMUNE_S_ddd.xml | 91 ------- .../types/N_prefixTri_COTE_VIT_DEB_P_ddd.json | 123 +++++++++ .../types/N_prefixTri_COTE_VIT_DEB_P_ddd.xml | 95 ------- .../types/N_prefixTri_ECOUL_S_ddd.json | 91 +++++++ .../types/N_prefixTri_ECOUL_S_ddd.xml | 73 ------ .../types/N_prefixTri_ENJEU_CRISE_L_ddd.json | 106 ++++++++ .../types/N_prefixTri_ENJEU_CRISE_L_ddd.xml | 88 ------- .../types/N_prefixTri_ENJEU_CRISE_P_ddd.json | 106 ++++++++ .../types/N_prefixTri_ENJEU_CRISE_P_ddd.xml | 88 ------- .../types/N_prefixTri_ENJEU_DCE_S_ddd.json | 59 +++++ .../types/N_prefixTri_ENJEU_DCE_S_ddd.xml | 50 ---- .../types/N_prefixTri_ENJEU_ECO_S_ddd.json | 96 +++++++ .../types/N_prefixTri_ENJEU_ECO_S_ddd.xml | 78 ------ .../types/N_prefixTri_ENJEU_IED_P_ddd.json | 62 +++++ .../types/N_prefixTri_ENJEU_IPPC_P_ddd.json | 63 +++++ .../types/N_prefixTri_ENJEU_IPPC_P_ddd.xml | 51 ---- .../types/N_prefixTri_ENJEU_PATRIM_P_ddd.json | 75 ++++++ .../types/N_prefixTri_ENJEU_PATRIM_P_ddd.xml | 60 ----- .../types/N_prefixTri_ENJEU_PATRIM_S_ddd.json | 75 ++++++ .../types/N_prefixTri_ENJEU_PATRIM_S_ddd.xml | 60 ----- .../types/N_prefixTri_ENJEU_RAPPORT_ddd.json | 124 +++++++++ .../types/N_prefixTri_ENJEU_RAPPORT_ddd.xml | 83 ------- .../types/N_prefixTri_ENJEU_STEU_P_ddd.json | 52 ++++ .../types/N_prefixTri_ENJEU_STEU_P_ddd.xml | 43 ---- ...prefixTri_INONDABLE_suffixInond_S_ddd.json | 125 ++++++++++ ..._prefixTri_INONDABLE_suffixInond_S_ddd.xml | 100 -------- .../types/N_prefixTri_ISO_COTE_L_ddd.json | 148 +++++++++++ .../types/N_prefixTri_ISO_COTE_L_ddd.xml | 105 -------- .../types/N_prefixTri_ISO_DEB_S_ddd.json | 96 +++++++ .../types/N_prefixTri_ISO_DEB_S_ddd.xml | 77 ------ .../N_prefixTri_ISO_HT_suffixIsoHt_S_ddd.json | 174 +++++++++++++ .../N_prefixTri_ISO_HT_suffixIsoHt_S_ddd.xml | 138 ---------- .../types/N_prefixTri_OUV_PROTEC_L_ddd.json | 144 +++++++++++ .../types/N_prefixTri_OUV_PROTEC_L_ddd.xml | 101 -------- .../types/N_prefixTri_QUARTIER_S_ddd.json | 84 +++++++ .../types/N_prefixTri_QUARTIER_S_ddd.xml | 62 ----- .../N_prefixTri_REL_HYDRO_INOND_ddd.json | 47 ++++ .../types/N_prefixTri_REL_HYDRO_INOND_ddd.xml | 36 --- .../types/N_prefixTri_SOUST_INOND_S_ddd.json | 83 +++++++ .../types/N_prefixTri_SOUST_INOND_S_ddd.xml | 77 ------ .../types/N_prefixTri_SURALEA_S_ddd.json | 86 +++++++ .../types/N_prefixTri_SURALEA_S_ddd.xml | 66 ----- .../types/N_prefixTri_TRI_S_ddd.json | 83 +++++++ .../types/N_prefixTri_TRI_S_ddd.xml | 61 ----- .../types/N_prefixTri_ZONE_PROTEG_S_ddd.json | 104 ++++++++ 55 files changed, 2876 insertions(+), 2125 deletions(-) create mode 100644 validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/files.json delete mode 100644 validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/files.xml create mode 100644 validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_CARTE_INOND_S_ddd.json delete mode 100644 validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_CARTE_INOND_S_ddd.xml create mode 100644 validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_CARTE_RISQ_S_ddd.json delete mode 100644 validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_CARTE_RISQ_S_ddd.xml create mode 100644 validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_CHAMP_VIT_P_ddd.json delete mode 100644 validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_CHAMP_VIT_P_ddd.xml create mode 100644 validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_COMMUNE_S_ddd.json delete mode 100644 validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_COMMUNE_S_ddd.xml create mode 100644 validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_COTE_VIT_DEB_P_ddd.json delete mode 100644 validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_COTE_VIT_DEB_P_ddd.xml create mode 100644 validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ECOUL_S_ddd.json delete mode 100644 validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ECOUL_S_ddd.xml create mode 100644 validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ENJEU_CRISE_L_ddd.json delete mode 100644 validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ENJEU_CRISE_L_ddd.xml create mode 100644 validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ENJEU_CRISE_P_ddd.json delete mode 100644 validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ENJEU_CRISE_P_ddd.xml create mode 100644 validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ENJEU_DCE_S_ddd.json delete mode 100644 validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ENJEU_DCE_S_ddd.xml create mode 100644 validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ENJEU_ECO_S_ddd.json delete mode 100644 validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ENJEU_ECO_S_ddd.xml create mode 100644 validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ENJEU_IED_P_ddd.json create mode 100644 validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ENJEU_IPPC_P_ddd.json delete mode 100644 validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ENJEU_IPPC_P_ddd.xml create mode 100644 validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ENJEU_PATRIM_P_ddd.json delete mode 100644 validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ENJEU_PATRIM_P_ddd.xml create mode 100644 validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ENJEU_PATRIM_S_ddd.json delete mode 100644 validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ENJEU_PATRIM_S_ddd.xml create mode 100644 validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ENJEU_RAPPORT_ddd.json delete mode 100644 validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ENJEU_RAPPORT_ddd.xml create mode 100644 validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ENJEU_STEU_P_ddd.json delete mode 100644 validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ENJEU_STEU_P_ddd.xml create mode 100644 validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_INONDABLE_suffixInond_S_ddd.json delete mode 100644 validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_INONDABLE_suffixInond_S_ddd.xml create mode 100644 validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ISO_COTE_L_ddd.json delete mode 100644 validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ISO_COTE_L_ddd.xml create mode 100644 validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ISO_DEB_S_ddd.json delete mode 100644 validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ISO_DEB_S_ddd.xml create mode 100644 validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ISO_HT_suffixIsoHt_S_ddd.json delete mode 100644 validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ISO_HT_suffixIsoHt_S_ddd.xml create mode 100644 validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_OUV_PROTEC_L_ddd.json delete mode 100644 validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_OUV_PROTEC_L_ddd.xml create mode 100644 validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_QUARTIER_S_ddd.json delete mode 100644 validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_QUARTIER_S_ddd.xml create mode 100644 validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_REL_HYDRO_INOND_ddd.json delete mode 100644 validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_REL_HYDRO_INOND_ddd.xml create mode 100644 validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_SOUST_INOND_S_ddd.json delete mode 100644 validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_SOUST_INOND_S_ddd.xml create mode 100644 validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_SURALEA_S_ddd.json delete mode 100644 validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_SURALEA_S_ddd.xml create mode 100644 validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_TRI_S_ddd.json delete mode 100644 validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_TRI_S_ddd.xml create mode 100644 validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ZONE_PROTEG_S_ddd.json diff --git a/validator-plugin-dgpr/src/test/java/fr/ign/validator/DgprApplicationTest.java b/validator-plugin-dgpr/src/test/java/fr/ign/validator/DgprApplicationTest.java index c035ea51..a952cbc0 100644 --- a/validator-plugin-dgpr/src/test/java/fr/ign/validator/DgprApplicationTest.java +++ b/validator-plugin-dgpr/src/test/java/fr/ign/validator/DgprApplicationTest.java @@ -18,8 +18,8 @@ import fr.ign.validator.dgpr.error.DgprErrorCodes; import fr.ign.validator.error.CoreErrorCodes; import fr.ign.validator.error.ValidatorError; +import fr.ign.validator.io.JsonModelReader; import fr.ign.validator.io.ModelReader; -import fr.ign.validator.io.XmlModelReader; import fr.ign.validator.model.DocumentModel; import fr.ign.validator.plugin.PluginManager; import fr.ign.validator.report.InMemoryReportBuilder; @@ -57,9 +57,9 @@ private Context createContext(File documentPath) throws Exception { private DocumentModel getDocumentModel(String documentModelName) throws Exception { File documentModelPath = new File( - getClass().getResource("/config/" + documentModelName + "/files.xml").getPath() + getClass().getResource("/config/" + documentModelName + "/files.json").getPath() ); - ModelReader loader = new XmlModelReader(); + ModelReader loader = new JsonModelReader(); DocumentModel documentModel = loader.loadDocumentModel(documentModelPath); documentModel.setName(documentModelName); return documentModel; @@ -224,18 +224,14 @@ public void testDocumentNotOk() throws Exception { /* * Validation unicite et relation */ - Assert.assertEquals(2, report.getErrorsByCode(CoreErrorCodes.ATTRIBUTE_NOT_UNIQUE).size()); + Assert.assertEquals(1, report.getErrorsByCode(CoreErrorCodes.ATTRIBUTE_NOT_UNIQUE).size()); ValidatorError error50 = report.getErrorsByCode(CoreErrorCodes.ATTRIBUTE_NOT_UNIQUE).get(0); - ValidatorError error51 = report.getErrorsByCode(CoreErrorCodes.ATTRIBUTE_NOT_UNIQUE).get(1); Assert.assertEquals( "La valeur 'ZE_2' est présente 2 fois pour le champ 'ID_ZONE' de la table 'N_prefixTri_ECOUL_S_ddd'.", error50 .getMessage() ); - Assert.assertEquals( - "La valeur 'SIEXT' est présente 2 fois pour le champ 'ID_SI_EXT' de la table 'N_prefixTri_ENJEU_CRISE_L_ddd'.", - error51.getMessage() - ); + Assert.assertEquals(5, report.getErrorsByCode(CoreErrorCodes.ATTRIBUTE_REFERENCE_NOT_FOUND).size()); { diff --git a/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/files.json b/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/files.json new file mode 100644 index 00000000..747aedaa --- /dev/null +++ b/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/files.json @@ -0,0 +1,235 @@ +{ + "id": "48cbe0573f476664353c7bd681f5f2e6", + "name": "covadis_di_2018", + "title": "covadis_di_2018", + "constraints": { + "folderName": "covadis_di_2018" + }, + "files": [ + { + "id": "0e7c86cd915a7415cefc53ea9a407c6f", + "name": "N_prefixTri_CARTE_INOND_S_ddd", + "path": "N_.*_CARTE_INOND_S_([0-9]{3}|02[aA]|02[bB])", + "type": "table", + "mandatory": "ERROR", + "tableModel": "./types/N_prefixTri_CARTE_INOND_S_ddd.json" + }, + { + "id": "7c97fa921538c84cc7fbd91438c6bba1", + "name": "N_prefixTri_CARTE_RISQ_S_ddd", + "path": "N_.*_CARTE_RISQ_S_([0-9]{3}|02[aA]|02[bB])", + "type": "table", + "mandatory": "ERROR", + "tableModel": "./types/N_prefixTri_CARTE_RISQ_S_ddd.json" + }, + { + "id": "6e52a672e8fdcdd94bb05c5348b50a0d", + "name": "N_prefixTri_CHAMP_VIT_P_ddd", + "path": "N_.*_CHAMP_VIT_P_([0-9]{3}|02[aA]|02[bB])", + "type": "table", + "mandatory": "OPTIONAL", + "tableModel": "./types/N_prefixTri_CHAMP_VIT_P_ddd.json" + }, + { + "id": "3a4280fa81164b503e34c18ad27ea983", + "name": "N_prefixTri_COMMUNE_S_ddd", + "path": "N_.*_COMMUNE_S_([0-9]{3}|02[aA]|02[bB])", + "type": "table", + "mandatory": "ERROR", + "tableModel": "./types/N_prefixTri_COMMUNE_S_ddd.json" + }, + { + "id": "5f6a3a2ddcf817c2ad6fa011a19086ef", + "name": "N_prefixTri_COTE_VIT_DEB_P_ddd", + "path": "N_.*_COTE_VIT_DEB_P_([0-9]{3}|02[aA]|02[bB])", + "type": "table", + "mandatory": "OPTIONAL", + "tableModel": "./types/N_prefixTri_COTE_VIT_DEB_P_ddd.json" + }, + { + "id": "cdebef0459bb55ea438eaabd81507042", + "name": "N_prefixTri_ECOUL_S_ddd", + "path": "N_.*_ECOUL_S_([0-9]{3}|02[aA]|02[bB])", + "type": "table", + "mandatory": "OPTIONAL", + "tableModel": "./types/N_prefixTri_ECOUL_S_ddd.json" + }, + { + "id": "021c6604a641341149e735fc5a8effe9", + "name": "N_prefixTri_ENJEU_CRISE_L_ddd", + "path": "N_.*_ENJEU_CRISE_L_([0-9]{3}|02[aA]|02[bB])", + "type": "table", + "mandatory": "OPTIONAL", + "tableModel": "./types/N_prefixTri_ENJEU_CRISE_L_ddd.json" + }, + { + "id": "d9eed1c0ac1e5fe34707b8f27a009e1b", + "name": "N_prefixTri_ENJEU_CRISE_P_ddd", + "path": "N_.*_ENJEU_CRISE_P_([0-9]{3}|02[aA]|02[bB])", + "type": "table", + "mandatory": "OPTIONAL", + "tableModel": "./types/N_prefixTri_ENJEU_CRISE_P_ddd.json" + }, + { + "id": "bd0ec953d2abdef1f6b1162317ff455e", + "name": "N_prefixTri_ENJEU_DCE_S_ddd", + "path": "N_.*_ENJEU_DCE_S_([0-9]{3}|02[aA]|02[bB])", + "type": "table", + "mandatory": "OPTIONAL", + "tableModel": "./types/N_prefixTri_ENJEU_DCE_S_ddd.json" + }, + { + "id": "a7e563e428d621dcff52a9be7f632dfb", + "name": "N_prefixTri_ENJEU_ECO_S_ddd", + "path": "N_.*_ENJEU_ECO_S_([0-9]{3}|02[aA]|02[bB])", + "type": "table", + "mandatory": "OPTIONAL", + "tableModel": "./types/N_prefixTri_ENJEU_ECO_S_ddd.json" + }, + { + "id": "73aff52a9bbf6ae952e8558551c3d6a9", + "name": "N_prefixTri_ENJEU_IED_P_ddd", + "path": "N_.*_ENJEU_IED_P_([0-9]{3}|02[aA]|02[bB])", + "type": "table", + "mandatory": "OPTIONAL", + "tableModel": "./types/N_prefixTri_ENJEU_IED_P_ddd.json" + }, + { + "id": "b6994affac1341487569541b0f17a5d0", + "name": "N_prefixTri_ENJEU_IPPC_P_ddd", + "path": "N_.*_ENJEU_IPPC_P_([0-9]{3}|02[aA]|02[bB])", + "type": "table", + "mandatory": "OPTIONAL", + "tableModel": "./types/N_prefixTri_ENJEU_IPPC_P_ddd.json" + }, + { + "id": "6c6d5bad08e5f02b5751a0e3d2b04e82", + "name": "N_prefixTri_ENJEU_PATRIM_P_ddd", + "path": "N_.*_ENJEU_PATRIM_P_([0-9]{3}|02[aA]|02[bB])", + "type": "table", + "mandatory": "OPTIONAL", + "tableModel": "./types/N_prefixTri_ENJEU_PATRIM_P_ddd.json" + }, + { + "id": "2020f026513bae8cc51a0b968cb84c17", + "name": "N_prefixTri_ENJEU_PATRIM_S_ddd", + "path": "N_.*_ENJEU_PATRIM_S_([0-9]{3}|02[aA]|02[bB])", + "type": "table", + "mandatory": "OPTIONAL", + "tableModel": "./types/N_prefixTri_ENJEU_PATRIM_S_ddd.json" + }, + { + "id": "857dd96adbd090301e82c842120c99a5", + "name": "N_prefixTri_ENJEU_RAPPORT_ddd", + "path": "N_.*_ENJEU_RAPPORT_([0-9]{3}|02[aA]|02[bB])", + "type": "table", + "mandatory": "ERROR", + "tableModel": "./types/N_prefixTri_ENJEU_RAPPORT_ddd.json" + }, + { + "id": "2234886dac757579eef0a63242009ba2", + "name": "N_prefixTri_ENJEU_STEU_P_ddd", + "path": "N_.*_ENJEU_STEU_P_([0-9]{3}|02[aA]|02[bB])", + "type": "table", + "mandatory": "OPTIONAL", + "tableModel": "./types/N_prefixTri_ENJEU_STEU_P_ddd.json" + }, + { + "id": "1e2cafc2097fb78aa2d537a37710e651", + "name": "N_prefixTri_INONDABLE_suffixInond_S_ddd", + "path": "N_.*_INONDABLE.{0,20}_S_([0-9]{3}|02[aA]|02[bB])", + "type": "table", + "mandatory": "ERROR", + "tableModel": "./types/N_prefixTri_INONDABLE_suffixInond_S_ddd.json" + }, + { + "id": "697103129ce2c43441108a1a24c3fe2c", + "name": "N_prefixTri_ISO_COTE_L_ddd", + "path": "N_.*_ISO_COTE_L_([0-9]{3}|02[aA]|02[bB])", + "type": "table", + "mandatory": "OPTIONAL", + "tableModel": "./types/N_prefixTri_ISO_COTE_L_ddd.json" + }, + { + "id": "3a2919cd29f71c7bd128338d81e673e9", + "name": "N_prefixTri_ISO_DEB_S_ddd", + "path": "N_.*_ISO_DEB_S_([0-9]{3}|02[aA]|02[bB])", + "type": "table", + "mandatory": "OPTIONAL", + "tableModel": "./types/N_prefixTri_ISO_DEB_S_ddd.json" + }, + { + "id": "2e6ba626adad1741fa1c93a1bce976e8", + "name": "N_prefixTri_ISO_HT_suffixIsoHt_S_ddd", + "path": "N_.*_ISO_HT.{0,20}_S_([0-9]{3}|02[aA]|02[bB])", + "type": "table", + "mandatory": "WARN", + "tableModel": "./types/N_prefixTri_ISO_HT_suffixIsoHt_S_ddd.json" + }, + { + "id": "cea63601540c8f2efe96a0cdce2a87fc", + "name": "N_prefixTri_OUV_PROTEC_L_ddd", + "path": "N_.*_OUV_PROTEC_L_([0-9]{3}|02[aA]|02[bB])", + "type": "table", + "mandatory": "OPTIONAL", + "tableModel": "./types/N_prefixTri_OUV_PROTEC_L_ddd.json" + }, + { + "id": "4c35064b6f886e6be9cbb5a2bcfc790e", + "name": "N_prefixTri_QUARTIER_S_ddd", + "path": "N_.*_QUARTIER_S_([0-9]{3}|02[aA]|02[bB])", + "type": "table", + "mandatory": "OPTIONAL", + "tableModel": "./types/N_prefixTri_QUARTIER_S_ddd.json" + }, + { + "id": "272aca26b80f291e7619b676b67d2090", + "name": "N_prefixTri_REL_HYDRO_INOND_ddd", + "path": "N_.*_REL_HYDRO_INOND_([0-9]{3}|02[aA]|02[bB])", + "type": "table", + "mandatory": "OPTIONAL", + "tableModel": "./types/N_prefixTri_REL_HYDRO_INOND_ddd.json" + }, + { + "id": "d8bb8e3af88bc50545c31e93245c412f", + "name": "N_prefixTri_SOUST_INOND_S_ddd", + "path": "N_.*_SOUST_INOND_S_([0-9]{3}|02[aA]|02[bB])", + "type": "table", + "mandatory": "OPTIONAL", + "tableModel": "./types/N_prefixTri_SOUST_INOND_S_ddd.json" + }, + { + "id": "08651fdaeca64491459a6b84c2bc7ed3", + "name": "N_prefixTri_SURALEA_S_ddd", + "path": "N_.*_SURALEA_S_([0-9]{3}|02[aA]|02[bB])", + "type": "table", + "mandatory": "OPTIONAL", + "tableModel": "./types/N_prefixTri_SURALEA_S_ddd.json" + }, + { + "id": "78025b58452cdde41cb38b9c862f40e2", + "name": "N_prefixTri_TRI_S_ddd", + "path": "N_.*_TRI_S_([0-9]{3}|02[aA]|02[bB])", + "type": "table", + "mandatory": "ERROR", + "tableModel": "./types/N_prefixTri_TRI_S_ddd.json" + }, + { + "id": "ea8bfabc1da69aed45cb8766cde19c62", + "name": "N_prefixTri_ZONE_PROTEG_S_ddd", + "path": "N_.*_ZONE_PROTEG_S_([0-9]{3}|02[aA]|02[bB])", + "type": "table", + "mandatory": "OPTIONAL", + "tableModel": "./types/N_prefixTri_ZONE_PROTEG_S_ddd.json" + }, + { + "id": "f107d77b75049a44284d3a0f6d6e411f", + "name": "prefixTri_SIG_DI", + "description": "repertoire", + "path": ".*_SIG_DI", + "type": "directory", + "mandatory": "OPTIONAL" + } + ], + "codes": [] +} \ No newline at end of file diff --git a/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/files.xml b/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/files.xml deleted file mode 100644 index a4f5633c..00000000 --- a/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/files.xml +++ /dev/null @@ -1,191 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - true - diff --git a/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_CARTE_INOND_S_ddd.json b/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_CARTE_INOND_S_ddd.json new file mode 100644 index 00000000..f12de37c --- /dev/null +++ b/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_CARTE_INOND_S_ddd.json @@ -0,0 +1,124 @@ +{ + "id": "a2b8bfebc23b2e9ff86666a5317f3026", + "name": "N_prefixTri_CARTE_INOND_S_ddd", + "columns": [ + { + "id": "0517a3d56312a29ac420ce7cb770c193", + "name": "TYP_INOND1", + "type": "String", + "constraints": { + "required": true, + "unique": false, + "enum": [ + "01", + "04", + "02", + "03" + ] + } + }, + { + "id": "191da4fe8e998f772102b8a1ef140cbf", + "name": "TYP_INOND2", + "type": "String", + "constraints": { + "required": true, + "unique": false, + "enum": [ + "01", + "04", + "02", + "03" + ] + } + }, + { + "id": "396e89a06c6b62295a04d4407909f276", + "name": "SCENARIO", + "type": "String", + "constraints": { + "required": true, + "unique": false, + "enum": [ + "04Fai_100", + "04Faicc_ct", + "01Forcc_ct", + "01Forcc_100", + "03Mcc_ct", + "04Fai", + "01For", + "02Moy", + "03Mcc" + ] + } + }, + { + "id": "74ba6cfe17c69c3d22bc099fedfed640", + "name": "DATFINVAL", + "type": "Date", + "constraints": { + "required": true, + "unique": false + } + }, + { + "id": "8ac0994afe17fb3288825ef4a5c7c43a", + "name": "ID_TRI", + "type": "String", + "constraints": { + "required": false, + "unique": false, + "reference": "N_prefixTri_TRI_S_ddd.ID_TRI" + } + }, + { + "id": "944c6cd7cc419a26472ebbfcd265d1d5", + "name": "URLRAPPORT", + "type": "String", + "constraints": { + "required": false, + "unique": false, + "maxLength": 254 + } + }, + { + "id": "b2031b1c0921bdbf948823fdd5e8de95", + "name": "EST_SYNTH", + "type": "Boolean", + "constraints": { + "required": false, + "unique": false + } + }, + { + "id": "b6b35d5d577158289011a78459eea12e", + "name": "DATAPPRO", + "type": "Date", + "constraints": { + "required": true, + "unique": false + } + }, + { + "id": "d0a3f10cba77397ef3ded392bf6c8fe2", + "name": "WKT", + "type": "MultiPolygon", + "constraints": { + "required": false, + "unique": false + } + }, + { + "id": "e687dab359fc6c2e1b31c500048ed830", + "name": "ID_CARTE", + "description": "- COVADIS B1.2. - Identifiant de type 'CSI_[numero automatique]'", + "type": "String", + "constraints": { + "required": false, + "unique": true, + "pattern": "CSI_[0-9]+$", + "maxLength": 30 + } + } + ] +} \ No newline at end of file diff --git a/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_CARTE_INOND_S_ddd.xml b/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_CARTE_INOND_S_ddd.xml deleted file mode 100644 index 3f3558d3..00000000 --- a/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_CARTE_INOND_S_ddd.xml +++ /dev/null @@ -1,99 +0,0 @@ - - - - - - - - - - true - - - - - - false - - - - - - - - - - 254 - false - - - - - - true - - - - - - - - - - - - - - 30 - false - true - - - - - - true - - - - - - - - - - - - false - - - - - - - true - - - - - - false - - - - - - true - - - - - - - - - - - - - diff --git a/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_CARTE_RISQ_S_ddd.json b/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_CARTE_RISQ_S_ddd.json new file mode 100644 index 00000000..cd9563dc --- /dev/null +++ b/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_CARTE_RISQ_S_ddd.json @@ -0,0 +1,67 @@ +{ + "id": "08184a2768da79cf74ec4f3ed15ce68d", + "name": "N_prefixTri_CARTE_RISQ_S_ddd", + "columns": [ + { + "id": "1bd2a37619e39921a37032f9a35d3f61", + "name": "DATFINVAL", + "type": "Date", + "constraints": { + "required": true, + "unique": false + } + }, + { + "id": "33d6bf13c85b065a47debdbedb28e922", + "name": "DATAPPRO", + "type": "Date", + "constraints": { + "required": true, + "unique": false + } + }, + { + "id": "36f7b243777e8a3f311cf4ed01965c50", + "name": "ID_TRI", + "description": "Valeur vide interdite", + "type": "String", + "constraints": { + "required": false, + "unique": false, + "reference": "N_prefixTri_TRI_S_ddd.ID_TRI" + } + }, + { + "id": "af04c65418d8e5fd18045c2a6414cf65", + "name": "ID_CARTE", + "description": "COVADIS B1.2. - Identifiant de type CRI_[numero]", + "type": "String", + "constraints": { + "required": false, + "unique": true, + "pattern": "CRI_[0-9]+$", + "maxLength": 30 + } + }, + { + "id": "b952bcc9638681312dcffe31e4cb3e92", + "name": "URLRAPPORT", + "description": "Valeur vide interdite", + "type": "String", + "constraints": { + "required": false, + "unique": false, + "maxLength": 254 + } + }, + { + "id": "dc29321dd26d263e3521ff18a7c5949f", + "name": "WKT", + "type": "MultiPolygon", + "constraints": { + "required": false, + "unique": false + } + } + ] +} \ No newline at end of file diff --git a/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_CARTE_RISQ_S_ddd.xml b/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_CARTE_RISQ_S_ddd.xml deleted file mode 100644 index 49d8b95b..00000000 --- a/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_CARTE_RISQ_S_ddd.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - - - - - - 30 - false - true - - - - - - true - - - - - - true - - - - - - - 254 - false - - - - - - - false - - - - - - - false - - - diff --git a/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_CHAMP_VIT_P_ddd.json b/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_CHAMP_VIT_P_ddd.json new file mode 100644 index 00000000..a78ab9f5 --- /dev/null +++ b/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_CHAMP_VIT_P_ddd.json @@ -0,0 +1,115 @@ +{ + "id": "bb1493f0bf53c582aef834154d88727d", + "name": "N_prefixTri_CHAMP_VIT_P_ddd", + "columns": [ + { + "id": "0595184d876a2c4f76c8950dcb3b4cfc", + "name": "EST_REF", + "type": "Boolean", + "constraints": { + "required": true, + "unique": false + } + }, + { + "id": "060b9e89d489b4ebd48dbdead4ce393d", + "name": "ID_S_INOND", + "description": "Valeur vide interdite", + "type": "String", + "constraints": { + "required": false, + "unique": false, + "reference": "N_prefixTri_INONDABLE_suffixInond_S_ddd.ID_S_INOND" + } + }, + { + "id": "063678fff044da6c7fd1892403120902", + "name": "WKT", + "type": "MultiPoint", + "constraints": { + "required": false, + "unique": false + } + }, + { + "id": "3b3112847d110529f4d1a848110c698c", + "name": "ID_TRI", + "description": "Valeur vide interdite", + "type": "String", + "constraints": { + "required": false, + "unique": false, + "reference": "N_prefixTri_TRI_S_ddd.ID_TRI" + } + }, + { + "id": "486430181786f13772080748578688d3", + "name": "ID_POINT", + "description": "COVADIS B1.2. - Identifiant de type 'PCV_[numero automatique] - Valeur vide interdite", + "type": "String", + "constraints": { + "required": false, + "unique": true, + "pattern": "PCV_[0-9]+$" + } + }, + { + "id": "69aac251173386216c8cd29d99f0fdea", + "name": "DATENTREE", + "type": "Date", + "constraints": { + "required": true, + "unique": false + } + }, + { + "id": "8cf638a06843200e39f3203e6630372e", + "name": "DATSORTIE", + "type": "Date", + "constraints": { + "required": true, + "unique": false + } + }, + { + "id": "aaae4e8a82483fdec1ef2da6b93b3b2e", + "name": "VITESS_MAX", + "type": "Double", + "constraints": { + "required": true, + "unique": false, + "enum": [ + "0.5", + "1", + "2", + "" + ] + } + }, + { + "id": "aae5b2dbf7f5c7098e47be5e621cda17", + "name": "VITESS_MIN", + "description": "Valeur vide interdite - Vitesse Min toujours inférieure à Vitesse Max", + "type": "Double", + "constraints": { + "required": false, + "unique": false, + "enum": [ + "0.2", + "0.5", + "1", + "2" + ] + } + }, + { + "id": "e63c06adc1894b375553522cbafdadd6", + "name": "AZIMUTH", + "type": "String", + "constraints": { + "required": true, + "unique": false + } + } + ] +} \ No newline at end of file diff --git a/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_CHAMP_VIT_P_ddd.xml b/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_CHAMP_VIT_P_ddd.xml deleted file mode 100644 index 462dc265..00000000 --- a/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_CHAMP_VIT_P_ddd.xml +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - - - - - true - - - - - - - - - - - false - - - - - - - - - - - - - - false - - - - - - - true - - - - - - - - - - - - true - - - - - - - - false - true - - - - - - true - - - - - - - false - - - - - - - true - - - - - - false - - - diff --git a/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_COMMUNE_S_ddd.json b/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_COMMUNE_S_ddd.json new file mode 100644 index 00000000..3666acf1 --- /dev/null +++ b/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_COMMUNE_S_ddd.json @@ -0,0 +1,124 @@ +{ + "id": "05c3929fac32a948e13f52c92df22496", + "name": "N_prefixTri_COMMUNE_S_ddd", + "columns": [ + { + "id": "4eb6f3c060c5d7922c614bfa4b4b8adc", + "name": "ANNEE_COG", + "type": "Date", + "constraints": { + "required": true, + "unique": false + } + }, + { + "id": "7d3dad307ba7779c6f81b90910b041b3", + "name": "CODE_INSEE", + "description": "Valeur vide interdite", + "type": "String", + "constraints": { + "required": false, + "unique": false, + "pattern": "^[0-9][0-9AB][0-9]{3}$", + "maxLength": 5 + } + }, + { + "id": "a7bdf4ddaf3bed849093bdabd23aa16c", + "name": "NOM_SI_EXT", + "description": "Valeur vide interdite", + "type": "String", + "constraints": { + "required": false, + "unique": false, + "maxLength": 50 + } + }, + { + "id": "af5e52f07376e901252eb4b207dcf7aa", + "name": "HAB_SAISON", + "type": "Integer", + "constraints": { + "required": true, + "unique": false + } + }, + { + "id": "d564f02da3f15c63560068d6b1f080af", + "name": "NOM_COM", + "type": "String", + "constraints": { + "required": true, + "unique": false, + "maxLength": 80 + } + }, + { + "id": "d7ca959ba3ee559bbd60dfc355ff2010", + "name": "VER_SI_EXT", + "type": "String", + "constraints": { + "required": true, + "unique": false, + "maxLength": 10 + } + }, + { + "id": "d872e16c5ef763a0f2fb7b31a87c1e0d", + "name": "ID_SI_EXT", + "description": "Valeur vide interdite", + "type": "String", + "constraints": { + "required": false, + "unique": false, + "maxLength": 50 + } + }, + { + "id": "df7a04c44bc696573bd61a1d00fdd7ad", + "name": "TX_HAB_SAI", + "type": "Integer", + "constraints": { + "required": true, + "unique": false + } + }, + { + "id": "e30c3cf18146e37358d443a964e27084", + "name": "HAB_PERM", + "description": "Valeur vide interdite", + "type": "Integer", + "constraints": { + "required": false, + "unique": false + } + }, + { + "id": "e4dc0f06020bf7bfe46dfcf38816748b", + "name": "WKT", + "type": "MultiPolygon", + "constraints": { + "required": false, + "unique": false + } + }, + { + "id": "e515cc976523bb8a1bfca0da60b826b0", + "name": "DATENTREE", + "type": "Date", + "constraints": { + "required": true, + "unique": false + } + }, + { + "id": "f51a0a36b2e22a1d7235c5ffdcb7deb8", + "name": "DATSORTIE", + "type": "Date", + "constraints": { + "required": true, + "unique": false + } + } + ] +} \ No newline at end of file diff --git a/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_COMMUNE_S_ddd.xml b/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_COMMUNE_S_ddd.xml deleted file mode 100644 index 18c4673e..00000000 --- a/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_COMMUNE_S_ddd.xml +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - - - - true - - - - - - true - - - - - - 80 - true - - - - - - 10 - true - - - - - - - 50 - false - true - - - - - - - 50 - false - - - - - - true - - - - - - - false - - - - - - true - = 0 AND TX_HAB_SAI <= 100]]> - - - - - - true - - - - - - - - 5 - false - - - - - - false - - - diff --git a/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_COTE_VIT_DEB_P_ddd.json b/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_COTE_VIT_DEB_P_ddd.json new file mode 100644 index 00000000..f42c3610 --- /dev/null +++ b/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_COTE_VIT_DEB_P_ddd.json @@ -0,0 +1,123 @@ +{ + "id": "bb1152ec96d65076c8b5a5ee898d733a", + "name": "N_prefixTri_COTE_VIT_DEB_P_ddd", + "columns": [ + { + "id": "1bdd78078d8cdd8a17ae93201485bad9", + "name": "WKT", + "type": "MultiPoint", + "constraints": { + "required": false, + "unique": false + } + }, + { + "id": "27fe9a1ee396afef7288769d9d51bf28", + "name": "DEBLIN", + "description": "Ne peut pas être négative", + "type": "Double", + "constraints": { + "required": true, + "unique": false + } + }, + { + "id": "395cef1868375857a789c22b50ad8c2e", + "name": "VITESSE", + "type": "Double", + "constraints": { + "required": true, + "unique": false + } + }, + { + "id": "3aee91bef9d4c944abc08bbcb558631a", + "name": "ID_POINT", + "description": "COVADIS B1.2. - Identifiant de type 'PRE_[numero automatique]'", + "type": "String", + "constraints": { + "required": false, + "unique": true, + "pattern": "PRE_[0-9]+$", + "maxLength": 30 + } + }, + { + "id": "426ccb7e5aa3988d7d6fc9d17fbf45fe", + "name": "COTE", + "type": "Double", + "constraints": { + "required": true, + "unique": false + } + }, + { + "id": "6731a68d63a325149a347bf084a70d15", + "name": "DATENTREE", + "type": "Date", + "constraints": { + "required": true, + "unique": false + } + }, + { + "id": "6bdc0b626787ee403a9f7ba40ca71d8e", + "name": "DATOBSERV", + "type": "Date", + "constraints": { + "required": true, + "unique": false + } + }, + { + "id": "6d63fa1f54db2211d79475b0c958af59", + "name": "AZIMUTH", + "description": "Si la vitesse ou le débit linéique est renseigné, alors l’azimuth doit aussi être renseigné.", + "type": "Double", + "constraints": { + "required": true, + "unique": false + } + }, + { + "id": "726269209e1297abe231c8254cc3d4b4", + "name": "EST_REF", + "type": "Boolean", + "constraints": { + "required": false, + "unique": false + } + }, + { + "id": "c13502ddfabad95d738d479bbad56b2c", + "name": "ID_S_INOND", + "description": "Valeur vide interdite", + "type": "String", + "constraints": { + "required": false, + "unique": false, + "reference": "N_prefixTri_INONDABLE_suffixInond_S_ddd.ID_S_INOND" + } + }, + { + "id": "c858b084e52c1da9b4fc97ff7c6e1b4d", + "name": "ID_TRI", + "description": "Valeur nulle interdite", + "type": "String", + "constraints": { + "required": false, + "unique": false, + "reference": "N_prefixTri_TRI_S_ddd.ID_TRI" + } + }, + { + "id": "dbcceb67972de405eca615efa5e33ab6", + "name": "DATSORTIE", + "type": "Date", + "constraints": { + "required": true, + "unique": false + } + } + ] +} \ No newline at end of file diff --git a/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_COTE_VIT_DEB_P_ddd.xml b/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_COTE_VIT_DEB_P_ddd.xml deleted file mode 100644 index ca3e0083..00000000 --- a/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_COTE_VIT_DEB_P_ddd.xml +++ /dev/null @@ -1,95 +0,0 @@ - - - - - - - - - - true - - - - - - false - - - - - - - - - - - false - - - - - - - true - - - - - - - false - - - - - - - false - - - - - - - true - - - - - - - - true - = 0 OR DEBLIN IS NULL]]> - - - - - - true - - - - - - - - 30 - false - true - - - - - - true - - - - - - true - - - diff --git a/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ECOUL_S_ddd.json b/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ECOUL_S_ddd.json new file mode 100644 index 00000000..90f90647 --- /dev/null +++ b/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ECOUL_S_ddd.json @@ -0,0 +1,91 @@ +{ + "id": "6f63a412ee3ae88c4cb5cb69f7fcd945", + "name": "N_prefixTri_ECOUL_S_ddd", + "columns": [ + { + "id": "197a691c7c83639c58cd3b395223bf0d", + "name": "VITESSE", + "description": "Valeur vide interdite", + "type": "String", + "constraints": { + "required": false, + "unique": false, + "enum": [ + "Fai", + "For", + "Mod" + ] + } + }, + { + "id": "3d456e6fab11b88a7b2396c3006867ed", + "name": "ID_ZONE", + "description": "COVADIS B1.2. - Identifiant de type ZE_[numero]", + "type": "String", + "constraints": { + "required": false, + "unique": true, + "pattern": "ZE_[0-9]+$", + "maxLength": 30 + } + }, + { + "id": "6a898baec11141ebf3a3b242abf08db4", + "name": "ID_TRI", + "description": "Valeur nulle interdite", + "type": "String", + "constraints": { + "required": false, + "unique": false, + "reference": "N_prefixTri_TRI_S_ddd.ID_TRI" + } + }, + { + "id": "799bede8fa0e54566191e3c08be51bff", + "name": "EST_REF", + "type": "Boolean", + "constraints": { + "required": true, + "unique": false + } + }, + { + "id": "7f8b1b7d9c143d40449bd045130ecab0", + "name": "ID_S_INOND", + "description": "Valeur vide interdite", + "type": "String", + "constraints": { + "required": false, + "unique": false, + "reference": "N_prefixTri_INONDABLE_suffixInond_S_ddd.ID_S_INOND" + } + }, + { + "id": "8d6b2f3bb6345a490430cd27c3d1df9d", + "name": "WKT", + "type": "MultiPolygon", + "constraints": { + "required": false, + "unique": false + } + }, + { + "id": "a0366ce1e087059c7b206d7c96e7505e", + "name": "DATSORTIE", + "type": "Date", + "constraints": { + "required": true, + "unique": false + } + }, + { + "id": "d9508edbba6c4968e7f8d7e86059e1ae", + "name": "DATENTREE", + "type": "Date", + "constraints": { + "required": true, + "unique": false + } + } + ] +} \ No newline at end of file diff --git a/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ECOUL_S_ddd.xml b/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ECOUL_S_ddd.xml deleted file mode 100644 index 4df5b04d..00000000 --- a/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ECOUL_S_ddd.xml +++ /dev/null @@ -1,73 +0,0 @@ - - - - - - - - - - - false - - - - - - - true - - - - - - true - - - - - - - - - - true - - - - - - - false - - - - - - - - - - - false - - - - - - - false - - - - - - - - - 30 - false - true - - - diff --git a/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ENJEU_CRISE_L_ddd.json b/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ENJEU_CRISE_L_ddd.json new file mode 100644 index 00000000..0e10c6c5 --- /dev/null +++ b/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ENJEU_CRISE_L_ddd.json @@ -0,0 +1,106 @@ +{ + "id": "e20359af951c292467fcb915e7c31c4b", + "name": "N_prefixTri_ENJEU_CRISE_L_ddd", + "columns": [ + { + "id": "03e42c12fd371b23e9508a316caedb62", + "name": "CODCOVADIS", + "description": "Cf. nomenclature COVADIS standard PPRN (annexe D.1)", + "type": "String", + "constraints": { + "required": true, + "unique": false, + "pattern": "^[0-9]{0,4}[a-z]*$", + "maxLength": 5 + } + }, + { + "id": "565c1e034edf1c989cdbd774e0d5c488", + "name": "VER_SI_EXT", + "type": "String", + "constraints": { + "required": true, + "unique": false, + "maxLength": 10 + } + }, + { + "id": "5d4bd771e534657f0c0c6f94f840d6a0", + "name": "WKT", + "type": "MultiLineString", + "constraints": { + "required": false, + "unique": false + } + }, + { + "id": "606e9cf800bf5f422b3a99b6bfbc9945", + "name": "CATEGORIE", + "description": "Valeur vide interdite", + "type": "String", + "constraints": { + "required": false, + "unique": false, + "enum": [ + "11", + "99", + "98", + "01", + "15", + "07", + "02", + "10", + "09", + "06", + "04", + "03", + "05", + "12", + "13", + "14", + "08" + ] + } + }, + { + "id": "dd60970d7f938e8e6a440bba585965fc", + "name": "NOM_SI_EXT", + "description": "Valeur vide interdite", + "type": "String", + "constraints": { + "required": false, + "unique": false, + "maxLength": 50 + } + }, + { + "id": "e3f1aadb0e12394626083060871095c6", + "name": "DATIMPORT", + "type": "Date", + "constraints": { + "required": true, + "unique": false + } + }, + { + "id": "eac0a6cc86c6aacda1891fcacd8ea609", + "name": "ID_SI_EXT", + "description": "Valeur vide interdite", + "type": "String", + "constraints": { + "required": false, + "unique": false, + "maxLength": 50 + } + }, + { + "id": "ecf1086d908e948ca3a906d40996a3be", + "name": "EST_REF", + "type": "Boolean", + "constraints": { + "required": true, + "unique": false + } + } + ] +} \ No newline at end of file diff --git a/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ENJEU_CRISE_L_ddd.xml b/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ENJEU_CRISE_L_ddd.xml deleted file mode 100644 index f34c9bbf..00000000 --- a/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ENJEU_CRISE_L_ddd.xml +++ /dev/null @@ -1,88 +0,0 @@ - - - - - - - - - - - - 5 - true - - - - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - true - - - - - - - - - - 10 - true - - - - - - - 50 - false - - - - - - false - - - - - - - 50 - false - true - - - - - - true - - - diff --git a/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ENJEU_CRISE_P_ddd.json b/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ENJEU_CRISE_P_ddd.json new file mode 100644 index 00000000..d874c919 --- /dev/null +++ b/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ENJEU_CRISE_P_ddd.json @@ -0,0 +1,106 @@ +{ + "id": "666aa8cb65a4234837fc8e52c961cd92", + "name": "N_prefixTri_ENJEU_CRISE_P_ddd", + "columns": [ + { + "id": "09d6f19aef1618359beefcfde99ac66d", + "name": "ID_SI_EXT", + "description": "Valeur vide interdite", + "type": "String", + "constraints": { + "required": false, + "unique": false, + "maxLength": 50 + } + }, + { + "id": "0d5e412a5ace71187b5083cae021732d", + "name": "EST_REF", + "type": "Boolean", + "constraints": { + "required": true, + "unique": false + } + }, + { + "id": "436f5a815ab404f5e706360f0c4c8a17", + "name": "CATEGORIE", + "description": "Valeur vide interdite", + "type": "String", + "constraints": { + "required": false, + "unique": false, + "enum": [ + "11", + "99", + "98", + "01", + "15", + "07", + "02", + "10", + "09", + "06", + "04", + "03", + "05", + "12", + "13", + "14", + "08" + ] + } + }, + { + "id": "45fcef0aea44aae925cc366e6056230c", + "name": "VER_SI_EXT", + "type": "String", + "constraints": { + "required": true, + "unique": false, + "maxLength": 10 + } + }, + { + "id": "8b67c06a69bf7d99717ef2efd0c9028e", + "name": "DATIMPORT", + "type": "Date", + "constraints": { + "required": true, + "unique": false + } + }, + { + "id": "b882ad0634446796282395e374c85d38", + "name": "NOM_SI_EXT", + "description": "Valeur vide interdite", + "type": "String", + "constraints": { + "required": false, + "unique": false, + "maxLength": 50 + } + }, + { + "id": "d4faa5daf55e9d5c7d71768b3a788799", + "name": "WKT", + "type": "MultiPoint", + "constraints": { + "required": false, + "unique": false + } + }, + { + "id": "ed92e0fdf9591bbd385352c8103d83c4", + "name": "CODCOVADIS", + "description": "Cf. nomenclature COVADIS standard PPRN (annexe D.1)", + "type": "String", + "constraints": { + "required": true, + "unique": false, + "pattern": "^[0-9]{0,4}[a-z]*$", + "maxLength": 5 + } + } + ] +} \ No newline at end of file diff --git a/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ENJEU_CRISE_P_ddd.xml b/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ENJEU_CRISE_P_ddd.xml deleted file mode 100644 index 80a326e5..00000000 --- a/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ENJEU_CRISE_P_ddd.xml +++ /dev/null @@ -1,88 +0,0 @@ - - - - - - - - - - - - 5 - true - - - - - - 10 - true - - - - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - 50 - false - - - - - - true - - - - - - - - - - false - - - - - - true - - - - - - - 50 - false - true - - - diff --git a/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ENJEU_DCE_S_ddd.json b/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ENJEU_DCE_S_ddd.json new file mode 100644 index 00000000..fe25cf43 --- /dev/null +++ b/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ENJEU_DCE_S_ddd.json @@ -0,0 +1,59 @@ +{ + "id": "2b6f49c3b2c66e4139db0191e253c776", + "name": "N_prefixTri_ENJEU_DCE_S_ddd", + "columns": [ + { + "id": "01d169c91ee9f131d8f914fe4abe036b", + "name": "WKT", + "type": "MultiPolygon", + "constraints": { + "required": false, + "unique": false + } + }, + { + "id": "311026ab95009c0938cd0555748521a7", + "name": "DATIMPORT", + "type": "Date", + "constraints": { + "required": true, + "unique": false + } + }, + { + "id": "4245f94f228ff8291431aae640f5c018", + "name": "PA_TYPE", + "type": "String", + "constraints": { + "required": true, + "unique": false, + "enum": [ + "", + "BA", + "A7", + "HA", + "BI" + ] + } + }, + { + "id": "4992a4011ad2feba7172fd41c8cfdcd4", + "name": "EU_CD_PA", + "type": "String", + "constraints": { + "required": true, + "unique": false, + "maxLength": 30 + } + }, + { + "id": "fea8807b56ca82cc038540a955afc63e", + "name": "EST_REF", + "type": "Boolean", + "constraints": { + "required": true, + "unique": false + } + } + ] +} \ No newline at end of file diff --git a/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ENJEU_DCE_S_ddd.xml b/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ENJEU_DCE_S_ddd.xml deleted file mode 100644 index 5909b843..00000000 --- a/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ENJEU_DCE_S_ddd.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - - - true - - - - - - - - - - true - - - - - - true - - - - - - - - - - - - - 30 - true - true - - - - - - false - - - diff --git a/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ENJEU_ECO_S_ddd.json b/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ENJEU_ECO_S_ddd.json new file mode 100644 index 00000000..933f829f --- /dev/null +++ b/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ENJEU_ECO_S_ddd.json @@ -0,0 +1,96 @@ +{ + "id": "59b94cece0c04bb40df2d058ef69fbe6", + "name": "N_prefixTri_ENJEU_ECO_S_ddd", + "columns": [ + { + "id": "2c05d1d52bd94fcb0db8e5b5da7815bd", + "name": "CODCOVADIS", + "description": "Cf. nomenclature COVADIS standard PPRN (annexe D.1)", + "type": "String", + "constraints": { + "required": true, + "unique": false, + "pattern": "^[0-9]{4}[a-z]*$", + "maxLength": 5 + } + }, + { + "id": "5682b7d7d7e36c7c4c495b654ac3f80c", + "name": "VER_SI_EXT", + "type": "String", + "constraints": { + "required": true, + "unique": false, + "maxLength": 10 + } + }, + { + "id": "87bbdfca741e8cc29be1a8fae097a8f2", + "name": "WKT", + "type": "MultiPolygon", + "constraints": { + "required": false, + "unique": false + } + }, + { + "id": "94d0e2f1f1b86ecfa47d4a85ef406b6d", + "name": "ID_SI_EXT", + "description": "Valeur vide interdite", + "type": "String", + "constraints": { + "required": false, + "unique": false, + "maxLength": 50 + } + }, + { + "id": "9fbba2e4a1d2dea69d52fca82fff1c8b", + "name": "DATIMPORT", + "type": "Date", + "constraints": { + "required": true, + "unique": false + } + }, + { + "id": "cea9aac3b73716f5accb6b797699ff22", + "name": "EST_REF", + "type": "Boolean", + "constraints": { + "required": true, + "unique": false + } + }, + { + "id": "d7fe9b179c7b7d2c5f8d74c6378a4017", + "name": "TYPE_ACTIV", + "type": "String", + "constraints": { + "required": true, + "unique": false, + "enum": [ + "03", + "04", + "99", + "07", + "02", + "01", + "06", + "05" + ] + } + }, + { + "id": "faa81b0de6a68a199eec3da5272ce808", + "name": "NOM_SI_EXT", + "description": "Valeur vide interdite", + "type": "String", + "constraints": { + "required": false, + "unique": false, + "maxLength": 50 + } + } + ] +} \ No newline at end of file diff --git a/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ENJEU_ECO_S_ddd.xml b/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ENJEU_ECO_S_ddd.xml deleted file mode 100644 index d840f452..00000000 --- a/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ENJEU_ECO_S_ddd.xml +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - - - - - - 50 - false - true - - - - - - - 50 - false - - - - - - false - - - - - - true - - - - - - true - - - - - - - - - - - - - - - - 10 - true - - - - - - - - 5 - true - - - - - - true - - - - - - - diff --git a/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ENJEU_IED_P_ddd.json b/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ENJEU_IED_P_ddd.json new file mode 100644 index 00000000..dcfefed4 --- /dev/null +++ b/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ENJEU_IED_P_ddd.json @@ -0,0 +1,62 @@ +{ + "id": "de0eb8e1068a4a04d0fb341b3ecf12bd", + "name": "N_prefixTri_ENJEU_IED_P_ddd", + "columns": [ + { + "id": "5edc5823bebb154b45c368c99a8bcbaa", + "name": "EST_REF", + "type": "Boolean", + "constraints": { + "required": true, + "unique": false + } + }, + { + "id": "69dcea6a749429a71e1a2262999703f7", + "name": "DATIMPORT", + "type": "Date", + "constraints": { + "required": true, + "unique": false + } + }, + { + "id": "72667ab07497b527fdc32ebc1f9f251e", + "name": "WKT", + "type": "MultiPoint", + "constraints": { + "required": false, + "unique": false + } + }, + { + "id": "8692dbf58821b17f85bca42c773137b8", + "name": "NOM", + "type": "String", + "constraints": { + "required": true, + "unique": false, + "maxLength": 100 + } + }, + { + "id": "aeacf3ecc0407459b737ea24cfaa8714", + "name": "CODE_IED", + "type": "String", + "constraints": { + "required": true, + "unique": false + } + }, + { + "id": "d6b3de2e5d35d6999e9d4d3574a096a1", + "name": "CODE_ACTIV", + "type": "String", + "constraints": { + "required": true, + "unique": false, + "maxLength": 6 + } + } + ] +} \ No newline at end of file diff --git a/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ENJEU_IPPC_P_ddd.json b/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ENJEU_IPPC_P_ddd.json new file mode 100644 index 00000000..40053794 --- /dev/null +++ b/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ENJEU_IPPC_P_ddd.json @@ -0,0 +1,63 @@ +{ + "id": "5f5edc2568a4beb2cb4200c80e2d9fff", + "name": "N_prefixTri_ENJEU_IPPC_P_ddd", + "columns": [ + { + "id": "0ca7740f00084c75cffd1396468ad361", + "name": "NOM", + "type": "String", + "constraints": { + "required": true, + "unique": false, + "maxLength": 10 + } + }, + { + "id": "46c230381b08c1a54fc01f2b08fdf64d", + "name": "CODE_IPPC", + "type": "String", + "constraints": { + "required": true, + "unique": false, + "maxLength": 30 + } + }, + { + "id": "7110007b8eaca23002fd009fd4dab994", + "name": "DATIMPORT", + "type": "Date", + "constraints": { + "required": true, + "unique": false + } + }, + { + "id": "818c9b7f3b11d615d7ce9e4d8fd279ac", + "name": "WKT", + "type": "MultiPoint", + "constraints": { + "required": false, + "unique": false + } + }, + { + "id": "95708b2239eb010d9f7a10faab1830a5", + "name": "EST_REF", + "type": "Boolean", + "constraints": { + "required": true, + "unique": false + } + }, + { + "id": "df568ab29d380849c5ea03997831c02a", + "name": "CODE_ACTIV", + "type": "String", + "constraints": { + "required": true, + "unique": false, + "maxLength": 6 + } + } + ] +} \ No newline at end of file diff --git a/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ENJEU_IPPC_P_ddd.xml b/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ENJEU_IPPC_P_ddd.xml deleted file mode 100644 index d599cbb4..00000000 --- a/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ENJEU_IPPC_P_ddd.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - - - - false - - - - - - true - - - - - - - - - - 6 - true - - - - - - true - - - - - - 100 - true - - - - - - 30 - true - true - - - diff --git a/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ENJEU_PATRIM_P_ddd.json b/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ENJEU_PATRIM_P_ddd.json new file mode 100644 index 00000000..b0a3399d --- /dev/null +++ b/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ENJEU_PATRIM_P_ddd.json @@ -0,0 +1,75 @@ +{ + "id": "753e61c837050dc32bdac88721341556", + "name": "N_prefixTri_ENJEU_PATRIM_P_ddd", + "columns": [ + { + "id": "289af181078f7f2dc2d4efeeb009a8fd", + "name": "TYPE_ENJEU", + "type": "String", + "constraints": { + "required": true, + "unique": false, + "maxLength": 80 + } + }, + { + "id": "39cd57f4e6caaba0ea413af82a2ec122", + "name": "DATIMPORT", + "type": "Date", + "constraints": { + "required": true, + "unique": false + } + }, + { + "id": "9e0762ef88044c9dd4c379cbdb7d7895", + "name": "ID_SI_EXT", + "description": "Valeur vide interdite", + "type": "String", + "constraints": { + "required": false, + "unique": false, + "maxLength": 50 + } + }, + { + "id": "b7801c80a3fec01e09e0e5d781547ebe", + "name": "WKT", + "type": "MultiPoint", + "constraints": { + "required": false, + "unique": false + } + }, + { + "id": "dbbec236804372b00793325ded419625", + "name": "VER_SI_EXT", + "type": "String", + "constraints": { + "required": true, + "unique": false, + "maxLength": 10 + } + }, + { + "id": "e364b47bd88853a58e15979c459cd6c1", + "name": "EST_REF", + "type": "Boolean", + "constraints": { + "required": true, + "unique": false + } + }, + { + "id": "f2e292201ac4be3ad1af47980578e820", + "name": "NOM_SI_EXT", + "description": "Valeur vide interdite", + "type": "String", + "constraints": { + "required": false, + "unique": false, + "maxLength": 50 + } + } + ] +} \ No newline at end of file diff --git a/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ENJEU_PATRIM_P_ddd.xml b/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ENJEU_PATRIM_P_ddd.xml deleted file mode 100644 index b3f4887d..00000000 --- a/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ENJEU_PATRIM_P_ddd.xml +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - - - 10 - true - - - - - - false - - - - - - 80 - true - - - - - - true - - - - - - - 50 - false - - - - - - - 50 - false - true - - - - - - true - - - - - - - diff --git a/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ENJEU_PATRIM_S_ddd.json b/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ENJEU_PATRIM_S_ddd.json new file mode 100644 index 00000000..4abcd07b --- /dev/null +++ b/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ENJEU_PATRIM_S_ddd.json @@ -0,0 +1,75 @@ +{ + "id": "9e4bee114f56a1b2fdae72102d8048be", + "name": "N_prefixTri_ENJEU_PATRIM_S_ddd", + "columns": [ + { + "id": "301a1c5718b6de1095b5ed7e495ca7f4", + "name": "WKT", + "type": "MultiPolygon", + "constraints": { + "required": false, + "unique": false + } + }, + { + "id": "3fc5cb37d8599fd6e99c307735969110", + "name": "VER_SI_EXT", + "type": "String", + "constraints": { + "required": true, + "unique": false, + "maxLength": 10 + } + }, + { + "id": "741c41b1cfd973eda592123f079a1384", + "name": "DATIMPORT", + "type": "Date", + "constraints": { + "required": true, + "unique": false + } + }, + { + "id": "85439537d734f7f04c5d24841e892c9e", + "name": "ID_SI_EXT", + "description": "Valeur vide interdite", + "type": "String", + "constraints": { + "required": false, + "unique": false, + "maxLength": 50 + } + }, + { + "id": "9721200a121cb27d5527816492f26d33", + "name": "EST_REF", + "type": "Boolean", + "constraints": { + "required": true, + "unique": false + } + }, + { + "id": "9b017e380c6b65771cd93c0617df1b03", + "name": "NOM_SI_EXT", + "description": "Valeur vide interdite", + "type": "String", + "constraints": { + "required": false, + "unique": false, + "maxLength": 50 + } + }, + { + "id": "ab4dfd81d48c28f3f5804009f59d6c75", + "name": "TYPE_ENJEU", + "type": "String", + "constraints": { + "required": true, + "unique": false, + "maxLength": 80 + } + } + ] +} \ No newline at end of file diff --git a/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ENJEU_PATRIM_S_ddd.xml b/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ENJEU_PATRIM_S_ddd.xml deleted file mode 100644 index 6d096a27..00000000 --- a/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ENJEU_PATRIM_S_ddd.xml +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - - - 80 - true - - - - - - - 50 - false - true - - - - - - true - - - - - - false - - - - - - - 50 - false - - - - - - 10 - true - - - - - - true - - - - - - - diff --git a/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ENJEU_RAPPORT_ddd.json b/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ENJEU_RAPPORT_ddd.json new file mode 100644 index 00000000..f29a1a2a --- /dev/null +++ b/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ENJEU_RAPPORT_ddd.json @@ -0,0 +1,124 @@ +{ + "id": "dea41a913caf04312f9f6f9ff904b938", + "name": "N_prefixTri_ENJEU_RAPPORT_ddd", + "columns": [ + { + "id": "09d6541d72b4c9bd232543afd72a5ede", + "name": "TYP_INOND2", + "type": "String", + "constraints": { + "required": true, + "unique": false, + "enum": [ + "01", + "04", + "02", + "03" + ] + } + }, + { + "id": "2062def188ee18d6318c628346616e7b", + "name": "DATENTREE", + "type": "Date", + "constraints": { + "required": true, + "unique": false + } + }, + { + "id": "2e25dea4154dac636706d4ea2061ec36", + "name": "DATSORTIE", + "type": "Date", + "constraints": { + "required": true, + "unique": false + } + }, + { + "id": "3db34d321220a6ce7e22f33dec23eec6", + "name": "ID", + "type": "String", + "constraints": { + "required": false, + "unique": false, + "maxLength": 50 + } + }, + { + "id": "5032b6e1efae76ad34677d881e7d354a", + "name": "SCENARIO", + "description": "Valeur vide interdite", + "type": "String", + "constraints": { + "required": false, + "unique": false, + "enum": [ + "04Fai_100", + "04Faicc_ct", + "01Forcc_ct", + "01Forcc_100", + "03Mcc_ct", + "04Fai", + "01For", + "02Moy", + "03Mcc" + ] + } + }, + { + "id": "83a0ec620dfcaec60e5df7085a3ba5cb", + "name": "EMPLOI_MAX", + "type": "Integer", + "constraints": { + "required": true, + "unique": false + } + }, + { + "id": "872e08fe5d06c965e7e225f64a3abd3c", + "name": "HAB_PERM", + "description": "Valeur vide interdite", + "type": "Integer", + "constraints": { + "required": false, + "unique": false + } + }, + { + "id": "889cf5c7ca23e82eb2674e0ec07eca02", + "name": "EST_REF", + "type": "Boolean", + "constraints": { + "required": true, + "unique": false + } + }, + { + "id": "8c469b2910622c9545a45d46537e78dd", + "name": "EMPLOI_MIN", + "description": "Valeur vide interdite", + "type": "Integer", + "constraints": { + "required": false, + "unique": false + } + }, + { + "id": "bf9aafab0edde36b357b1cce6d3ccc56", + "name": "TYP_INOND", + "description": "Valeur vide interdite", + "type": "String", + "constraints": { + "required": false, + "unique": false, + "enum": [ + "01", + "04", + "02", + "03" + ] + } + } + ] +} \ No newline at end of file diff --git a/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ENJEU_RAPPORT_ddd.xml b/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ENJEU_RAPPORT_ddd.xml deleted file mode 100644 index 1cb6d558..00000000 --- a/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ENJEU_RAPPORT_ddd.xml +++ /dev/null @@ -1,83 +0,0 @@ - - - - - - - - - - true - - - - - - - false - - - - - - - false - - - - - - true - - - - - - - false - - - - - - - - - - - - true - - - - - - - false - - - - - - - - - - - - true - - - - - - - - - - 50 - false - false - - - diff --git a/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ENJEU_STEU_P_ddd.json b/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ENJEU_STEU_P_ddd.json new file mode 100644 index 00000000..c81d8f1c --- /dev/null +++ b/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ENJEU_STEU_P_ddd.json @@ -0,0 +1,52 @@ +{ + "id": "6a9129c92808cc4d1cd6a2cd920e991d", + "name": "N_prefixTri_ENJEU_STEU_P_ddd", + "columns": [ + { + "id": "24544b05fc0288369125a5e69bced5f4", + "name": "CAPACITE_N", + "type": "Integer", + "constraints": { + "required": true, + "unique": false + } + }, + { + "id": "3892d8675fc2df43c638c2a386ed61ad", + "name": "CODE_STEU", + "type": "String", + "constraints": { + "required": true, + "unique": false, + "maxLength": 30 + } + }, + { + "id": "55a8e21f313689cc3019bfcf73eea27f", + "name": "DATIMPORT", + "type": "Date", + "constraints": { + "required": true, + "unique": false + } + }, + { + "id": "967891e1a85e966cda64a7b79cf7d10c", + "name": "EST_REF", + "type": "Boolean", + "constraints": { + "required": true, + "unique": false + } + }, + { + "id": "d3d6ba309455788cce4ccef7f4cb8836", + "name": "WKT", + "type": "MultiPoint", + "constraints": { + "required": false, + "unique": false + } + } + ] +} \ No newline at end of file diff --git a/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ENJEU_STEU_P_ddd.xml b/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ENJEU_STEU_P_ddd.xml deleted file mode 100644 index 56000da9..00000000 --- a/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ENJEU_STEU_P_ddd.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - true - - - - - - false - - - - - - true - - - - - - 30 - true - true - - - - - - true - - - - - - - diff --git a/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_INONDABLE_suffixInond_S_ddd.json b/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_INONDABLE_suffixInond_S_ddd.json new file mode 100644 index 00000000..6b439308 --- /dev/null +++ b/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_INONDABLE_suffixInond_S_ddd.json @@ -0,0 +1,125 @@ +{ + "id": "1a9c7d96761590a44882360ceeb2be42", + "name": "N_prefixTri_INONDABLE_suffixInond_S_ddd", + "columns": [ + { + "id": "36fc952cfcfc21bb8e504dfdbe72a8d9", + "name": "COURS_DEAU", + "type": "String", + "constraints": { + "required": true, + "unique": false, + "maxLength": 127 + } + }, + { + "id": "4d159b42648bdff9dbcc2bcfa5f27edc", + "name": "WKT", + "type": "MultiPolygon", + "constraints": { + "required": false, + "unique": false + } + }, + { + "id": "50fd9ade445819d4d28c122c4e326296", + "name": "DATSORTIE", + "type": "Date", + "constraints": { + "required": true, + "unique": false + } + }, + { + "id": "5a7f27cd15036b49ed295b762eb8bb27", + "name": "SCENARIO", + "type": "String", + "constraints": { + "required": false, + "unique": false, + "enum": [ + "04Fai_100", + "04Faicc_ct", + "01Forcc_ct", + "01Forcc_100", + "03Mcc_ct", + "04Fai", + "01For", + "02Moy", + "03Mcc" + ] + } + }, + { + "id": "6275fb734cb8bc1d1ed4f9e430481014", + "name": "TYP_INOND2", + "type": "String", + "constraints": { + "required": true, + "unique": false, + "enum": [ + "01", + "04", + "02", + "03" + ] + } + }, + { + "id": "7de1979381388196d7bcc8329898255a", + "name": "EST_REF", + "type": "Boolean", + "constraints": { + "required": true, + "unique": false + } + }, + { + "id": "85ea88d4b9374ce9330e1d4ccbe68814", + "name": "DATENTREE", + "type": "Date", + "constraints": { + "required": true, + "unique": false + } + }, + { + "id": "88eab770fd22ab89ffc9f19b0c3d37e7", + "name": "ID_TRI", + "description": "Valeur vide interdite", + "type": "String", + "constraints": { + "required": false, + "unique": false, + "reference": "N_prefixTri_TRI_S_ddd.ID_TRI" + } + }, + { + "id": "d6d207d07e5daef7fa996af118ed7c82", + "name": "TYP_INOND", + "type": "String", + "constraints": { + "required": false, + "unique": false, + "enum": [ + "01", + "04", + "02", + "03" + ] + } + }, + { + "id": "ea2ae1b87bbe2b1f1fc71a2d22a4d4cc", + "name": "ID_S_INOND", + "description": "COVADIS B1.2. - Identifiant de type SIN_[numero]", + "type": "String", + "constraints": { + "required": false, + "unique": true, + "pattern": "SIN_[0-9]+$", + "maxLength": 30 + } + } + ] +} \ No newline at end of file diff --git a/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_INONDABLE_suffixInond_S_ddd.xml b/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_INONDABLE_suffixInond_S_ddd.xml deleted file mode 100644 index 7ef86f2d..00000000 --- a/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_INONDABLE_suffixInond_S_ddd.xml +++ /dev/null @@ -1,100 +0,0 @@ - - - - - - - - - - false - - - - - - false - - - - - - - - - - - - - - - - true - - - - - - - - - - - false - - - - - - - false - - - - - - - - - - - - 127 - true - - - - - - true - - - - - - - - - - - - true - - - - - - true - - - - - - - - 30 - false - true - - - diff --git a/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ISO_COTE_L_ddd.json b/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ISO_COTE_L_ddd.json new file mode 100644 index 00000000..28abfcd0 --- /dev/null +++ b/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ISO_COTE_L_ddd.json @@ -0,0 +1,148 @@ +{ + "id": "3d4e469c6eddc1dc8f8f2fff62bd0875", + "name": "N_prefixTri_ISO_COTE_L_ddd", + "columns": [ + { + "id": "4b058a7da64637355eee06ad1fdd8df5", + "name": "TYP_INOND2", + "type": "String", + "constraints": { + "required": true, + "unique": false, + "enum": [ + "01", + "04", + "02", + "03" + ] + } + }, + { + "id": "4f23f60de39305a09834a4c5b5cf5ea8", + "name": "DATSORTIE", + "type": "Date", + "constraints": { + "required": true, + "unique": false + } + }, + { + "id": "5266517a49def5d75034516143178ee7", + "name": "DATENTREE", + "type": "Date", + "constraints": { + "required": true, + "unique": false + } + }, + { + "id": "624b29b074cce14480e4cf11fc62d344", + "name": "EST_REF", + "type": "Boolean", + "constraints": { + "required": true, + "unique": false + } + }, + { + "id": "7b7fb438055638b2605987f3a23686e5", + "name": "COTE", + "description": "Valeur vide interdite", + "type": "Double", + "constraints": { + "required": false, + "unique": false + } + }, + { + "id": "8ccb4c23b5d92de3fd50ddb5ffd63871", + "name": "TYP_INOND", + "description": "Valeur vide interdite", + "type": "String", + "constraints": { + "required": false, + "unique": false, + "enum": [ + "01", + "04", + "02", + "03" + ] + } + }, + { + "id": "ad81018d87b74c0d940cc98fd25918c6", + "name": "SCENARIO", + "description": "Valeur vide interdite", + "type": "String", + "constraints": { + "required": false, + "unique": false, + "enum": [ + "04Fai_100", + "04Faicc_ct", + "01Forcc_ct", + "01Forcc_100", + "03Mcc_ct", + "04Fai", + "01For", + "02Moy", + "03Mcc" + ] + } + }, + { + "id": "c7a99d4503a997919d5ab7a0bd7193e9", + "name": "ID_TRI", + "description": "Valeur nulle interdite", + "type": "String", + "constraints": { + "required": false, + "unique": false, + "reference": "N_prefixTri_TRI_S_ddd.ID_TRI" + } + }, + { + "id": "d2e8cfe0b7150e5bcda821220c89df76", + "name": "ID_LIGNE", + "description": "COVADIS B1.2. - Identifiant de type 'LIC_[numero]'", + "type": "String", + "constraints": { + "required": false, + "unique": true, + "pattern": "LIC_[0-9]+$", + "maxLength": 30 + } + }, + { + "id": "e432d04296de787a5a998b15dd1bb7be", + "name": "COURS_DEAU", + "type": "String", + "constraints": { + "required": true, + "unique": false, + "maxLength": 127 + } + }, + { + "id": "e755f4e8bf3a6cba024bd6c29bd8b099", + "name": "ID_S_INOND", + "description": "Valeur vide interdite", + "type": "String", + "constraints": { + "required": false, + "unique": false, + "reference": "N_prefixTri_INONDABLE_suffixInond_S_ddd.ID_S_INOND" + } + }, + { + "id": "e9907cc8340d8e5f6ea8098934abb8ea", + "name": "WKT", + "type": "MultiLineString", + "constraints": { + "required": false, + "unique": false + } + } + ] +} \ No newline at end of file diff --git a/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ISO_COTE_L_ddd.xml b/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ISO_COTE_L_ddd.xml deleted file mode 100644 index 408c918a..00000000 --- a/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ISO_COTE_L_ddd.xml +++ /dev/null @@ -1,105 +0,0 @@ - - - - - - - - - - true - - - - - - - - - - - - 30 - false - true - - - - - - 127 - true - - - - - - - false - - - - - - - false - - - - - - - - - - - - true - - - - - - false - - - - - - - false - - - - - - - - false - - - - - - - - false - - - - - - - - - - - - - - - - true - - - diff --git a/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ISO_DEB_S_ddd.json b/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ISO_DEB_S_ddd.json new file mode 100644 index 00000000..1e3f8d74 --- /dev/null +++ b/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ISO_DEB_S_ddd.json @@ -0,0 +1,96 @@ +{ + "id": "a31b326475cf78a5e2dd5e7ae4991bb5", + "name": "N_prefixTri_ISO_DEB_S_ddd", + "columns": [ + { + "id": "03444c47ba08c8f475843b1163f2f68f", + "name": "ID_ZONE", + "description": "COVADIS B1.2. - Identifiant de type ZCD_'[numero]'", + "type": "String", + "constraints": { + "required": false, + "unique": true, + "pattern": "ZCD_[0-9]+$", + "maxLength": 30 + } + }, + { + "id": "15da1d618efc1fe5d54c7ad187da71e7", + "name": "ID_S_INOND", + "description": "Valeur vide interdite", + "type": "String", + "constraints": { + "required": false, + "unique": false, + "reference": "N_prefixTri_INONDABLE_suffixInond_S_ddd.ID_S_INOND" + } + }, + { + "id": "722358cd6f36568f7af54e7e8bbd686d", + "name": "EST_REF", + "type": "Boolean", + "constraints": { + "required": true, + "unique": false + } + }, + { + "id": "7ec5ac927939180dd96b0241ff5fb66d", + "name": "WKT", + "type": "MultiPolygon", + "constraints": { + "required": false, + "unique": false + } + }, + { + "id": "bc878ea685a2435dd2cd23c03ea1e566", + "name": "DATENTREE", + "type": "Date", + "constraints": { + "required": true, + "unique": false + } + }, + { + "id": "cf08e78cbe0b481d5ed0b5e3378a4776", + "name": "DATSORTIE", + "type": "Date", + "constraints": { + "required": true, + "unique": false + } + }, + { + "id": "e170ba1da615534fd0dabebb1db948e9", + "name": "ID_TRI", + "description": "Valeur vide interdite", + "type": "String", + "constraints": { + "required": false, + "unique": false, + "reference": "N_prefixTri_TRI_S_ddd.ID_TRI" + } + }, + { + "id": "e500f80cdf2448e1750ae219c8ce1d03", + "name": "DEBLIN_MIN", + "description": "Valeur vide interdite- Exprimé en m²/s - Ne peut pas être négative", + "type": "Double", + "constraints": { + "required": false, + "unique": false + } + }, + { + "id": "ffd6ccba3faf1f17fe481fa3aa8f98ef", + "name": "DEBLIN_MAX", + "description": "Exprimé en m²/s - DEBLIN_MAX >= DEBLIN_MIN", + "type": "Double", + "constraints": { + "required": true, + "unique": false + } + } + ] +} \ No newline at end of file diff --git a/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ISO_DEB_S_ddd.xml b/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ISO_DEB_S_ddd.xml deleted file mode 100644 index 8be55d06..00000000 --- a/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ISO_DEB_S_ddd.xml +++ /dev/null @@ -1,77 +0,0 @@ - - - - - - - - - - - - 30 - false - true - - - - - - true - - - - - - - false - = 0]]> - - - - - = DEBLIN_MIN]]> - - true - = DEBLIN_MIN]]> - - - - - - - false - - - - - - - true - - - - - - - - - - - false - - - - - - - true - - - - - - false - - - diff --git a/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ISO_HT_suffixIsoHt_S_ddd.json b/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ISO_HT_suffixIsoHt_S_ddd.json new file mode 100644 index 00000000..cbb116ea --- /dev/null +++ b/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ISO_HT_suffixIsoHt_S_ddd.json @@ -0,0 +1,174 @@ +{ + "id": "872b653303e627041c50b2bca0e83757", + "name": "N_prefixTri_ISO_HT_suffixIsoHt_S_ddd", + "columns": [ + { + "id": "44b7394c61ca6fa7b001c43722acbde6", + "name": "DATENTREE", + "type": "Date", + "constraints": { + "required": true, + "unique": false + } + }, + { + "id": "53a8b31af9c5d596ea674a71bc903c32", + "name": "SCENARIO", + "type": "String", + "constraints": { + "required": false, + "unique": false, + "enum": [ + "04Fai_100", + "04Faicc_ct", + "01Forcc_ct", + "01Forcc_100", + "03Mcc_ct", + "04Fai", + "01For", + "02Moy", + "03Mcc" + ] + } + }, + { + "id": "5ae13050f35f80d17187117ffa355778", + "name": "HT_MAX", + "description": "Si cette valeur n’est pas renseignée, la plage de hauteur correspond à la plage des hauteurs maximales (supérieure à une hauteur donnée). Par exemple, la plage des « hauteurs supérieures ou égales à 4 m» sera modélisée dans la base par le remplissage du seuil inférieur de la plage de hauteur (avec dans le cas de l’exemple la valeur « 4 ») et un seuil supérieur laissé vide c’est à dire 9999 pour Mapinfo et NULL pour Qgis.", + "type": "Double", + "constraints": { + "required": true, + "unique": false, + "enum": [ + "0.5", + "1", + "1.5", + "2", + "3", + "4", + "" + ] + } + }, + { + "id": "701862ec2ae6bed28b2a3e0a55e8fee9", + "name": "DATSORTIE", + "type": "Date", + "constraints": { + "required": true, + "unique": false + } + }, + { + "id": "8993748cd627de9058ae8e9a3201ed33", + "name": "ID_S_INOND", + "description": "Valeur vide interdite", + "type": "String", + "constraints": { + "required": false, + "unique": false, + "reference": "N_prefixTri_INONDABLE_suffixInond_S_ddd.ID_S_INOND" + } + }, + { + "id": "8e3b632ceb2ddf9ac4331ecb2c59ac54", + "name": "EST_REF", + "type": "Boolean", + "constraints": { + "required": true, + "unique": false + } + }, + { + "id": "bdfd92ccc82f84cd0c1fae039235e4d7", + "name": "TYP_INOND2", + "type": "String", + "constraints": { + "required": true, + "unique": false, + "enum": [ + "01", + "04", + "02", + "03" + ] + } + }, + { + "id": "c46c48ecb339be31cb04f157123b7337", + "name": "COURS_DEAU", + "type": "String", + "constraints": { + "required": true, + "unique": false, + "maxLength": 127 + } + }, + { + "id": "c5e8ca685b183606905fb53eecd9d96c", + "name": "TYP_INOND", + "type": "String", + "constraints": { + "required": false, + "unique": false, + "enum": [ + "01", + "04", + "02", + "03" + ] + } + }, + { + "id": "c848d56350993556f092dbf37006cdfb", + "name": "ID_TRI", + "description": "Valeur vide interdite", + "type": "String", + "constraints": { + "required": false, + "unique": false, + "reference": "N_prefixTri_TRI_S_ddd.ID_TRI" + } + }, + { + "id": "cb1ff310f3d6ac8d03458ac58db02df4", + "name": "ID_ZONE", + "description": "COVADIS B1.2. - Identifiant de type 'ZCH_[numero]'", + "type": "String", + "constraints": { + "required": false, + "unique": true, + "pattern": "ZCH_[0-9]+$", + "maxLength": 30 + } + }, + { + "id": "dd71706bd5f384b00c31a185b5d09d5c", + "name": "HT_MIN", + "description": "Valeur vide interdite", + "type": "Double", + "constraints": { + "required": false, + "unique": false, + "enum": [ + "0", + "0.5", + "1", + "1.5", + "2", + "3", + "4" + ] + } + }, + { + "id": "fa120eeea2e0a5018c87efee2f8767c2", + "name": "WKT", + "type": "MultiPolygon", + "constraints": { + "required": false, + "unique": false + } + } + ] +} \ No newline at end of file diff --git a/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ISO_HT_suffixIsoHt_S_ddd.xml b/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ISO_HT_suffixIsoHt_S_ddd.xml deleted file mode 100644 index 5cf0417f..00000000 --- a/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ISO_HT_suffixIsoHt_S_ddd.xml +++ /dev/null @@ -1,138 +0,0 @@ - - - - - - - - - - false - - - - - - - false - - - - - - - - - - - - - - - false - - - - - - - - false - - - - - - - true - - - - - - true - - - - - - 127 - true - - - - - - true - - - - - - - - - - true - - - - - - - - - - - - false - - - - - - - - - - - - - - - - - true - - - - - - - - - - - - - - false - - - - - - - - - - - - - - 30 - false - true - - - diff --git a/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_OUV_PROTEC_L_ddd.json b/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_OUV_PROTEC_L_ddd.json new file mode 100644 index 00000000..ecbdd39c --- /dev/null +++ b/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_OUV_PROTEC_L_ddd.json @@ -0,0 +1,144 @@ +{ + "id": "4dda5554688cd6f3f7579638a1570771", + "name": "N_prefixTri_OUV_PROTEC_L_ddd", + "columns": [ + { + "id": "07321d95136f774894bc1645ffeda3f5", + "name": "TYP_INOND", + "description": "Valeur vide interdite", + "type": "String", + "constraints": { + "required": false, + "unique": false, + "enum": [ + "01", + "04", + "02", + "03" + ] + } + }, + { + "id": "0ee636a129ab195a4780eb287df1dc24", + "name": "ID_OUVRAGE", + "description": "COVADIS B1.2. - Identifiant de type SIN_[numero]", + "type": "String", + "constraints": { + "required": false, + "unique": true, + "pattern": "OUV_[0-9]+$", + "maxLength": 30 + } + }, + { + "id": "23620fac1042a526ab6d8b5e37e11ff5", + "name": "DATENTREE", + "type": "Date", + "constraints": { + "required": true, + "unique": false + } + }, + { + "id": "4b8a765262702e2837c3dadf1ad55680", + "name": "TYP_INOND2", + "type": "String", + "constraints": { + "required": true, + "unique": false, + "enum": [ + "01", + "04", + "02", + "03" + ] + } + }, + { + "id": "568be2907666861ffbda32089970047d", + "name": "NOM", + "type": "String", + "constraints": { + "required": true, + "unique": false, + "maxLength": 254 + } + }, + { + "id": "8185331974620cb98553a0017b51ff00", + "name": "WKT", + "type": "MultiLineString", + "constraints": { + "required": false, + "unique": false + } + }, + { + "id": "976b6cfc6de53435c96d62cd66caa51b", + "name": "SCENA_RUPT", + "description": "Valeur vide interdite", + "type": "String", + "constraints": { + "required": false, + "unique": false, + "enum": [ + "01", + "05", + "02", + "04", + "03", + "99" + ] + } + }, + { + "id": "a5429c5444e56f4fd801c413edaf165b", + "name": "ID_SIOUH", + "type": "String", + "constraints": { + "required": true, + "unique": false, + "maxLength": 30 + } + }, + { + "id": "c0c65b4dcc355fb65c3a6bfbd9b9c234", + "name": "ID_ROE", + "type": "String", + "constraints": { + "required": true, + "unique": false, + "maxLength": 30 + } + }, + { + "id": "d7efad4de63e3f1f39cf89927057aeba", + "name": "DATSORTIE", + "type": "Date", + "constraints": { + "required": true, + "unique": false + } + }, + { + "id": "da03d5ec4ea4de451efc45d3af728c5d", + "name": "ID_TRI", + "description": "Valeur nulle interdite", + "type": "String", + "constraints": { + "required": false, + "unique": false, + "reference": "N_prefixTri_TRI_S_ddd.ID_TRI" + } + }, + { + "id": "fc5bed581a74af7ece46bdb3b812d1dd", + "name": "EST_REF", + "type": "Boolean", + "constraints": { + "required": true, + "unique": false + } + } + ] +} \ No newline at end of file diff --git a/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_OUV_PROTEC_L_ddd.xml b/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_OUV_PROTEC_L_ddd.xml deleted file mode 100644 index b4bee2cf..00000000 --- a/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_OUV_PROTEC_L_ddd.xml +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - - - - - true - - - - - - - - - - - false - - - - - - - - - - - - - 254 - true - - - - - - false - - - - - - true - - - - - - 30 - true - - - - - - - false - - - - - - - - - 30 - false - true - - - - - - true - - - - - - 30 - true - - - - - - - false - - - - - - - - - diff --git a/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_QUARTIER_S_ddd.json b/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_QUARTIER_S_ddd.json new file mode 100644 index 00000000..ed0dbd89 --- /dev/null +++ b/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_QUARTIER_S_ddd.json @@ -0,0 +1,84 @@ +{ + "id": "9c7af389c9367e37ff3c26ed6db9ffb7", + "name": "N_prefixTri_QUARTIER_S_ddd", + "columns": [ + { + "id": "0da1797ba9e6c0a971032efb5fb9a2b1", + "name": "VER_SI_EXT", + "type": "String", + "constraints": { + "required": true, + "unique": false, + "maxLength": 10 + } + }, + { + "id": "27d5b59c7a95509a10e08420484ead66", + "name": "CODE_INSEE", + "type": "String", + "constraints": { + "required": true, + "unique": false, + "maxLength": 5 + } + }, + { + "id": "3183995fbd732558df88b59ccd4b2303", + "name": "DATSORTIE", + "type": "Date", + "constraints": { + "required": true, + "unique": false + } + }, + { + "id": "333e0abb65064891f4df1a5cba964e8a", + "name": "HAB_PERM", + "type": "Integer", + "constraints": { + "required": true, + "unique": false + } + }, + { + "id": "38a252c0f751ab088a9ba57725aa34f1", + "name": "ID_SI_EXT", + "description": "Valeur vide interdite", + "type": "String", + "constraints": { + "required": false, + "unique": false, + "maxLength": 50 + } + }, + { + "id": "78e402159cae4ad8263cbb0713ca6fc0", + "name": "WKT", + "type": "MultiPolygon", + "constraints": { + "required": false, + "unique": false + } + }, + { + "id": "e45567e7ddedd1969ba80cdd45aacf02", + "name": "DATENTREE", + "type": "Date", + "constraints": { + "required": true, + "unique": false + } + }, + { + "id": "ff90f53f22fde65cebfa8839467a9837", + "name": "NOM_SI_EXT", + "description": "Valeur vide interdite", + "type": "String", + "constraints": { + "required": false, + "unique": false, + "maxLength": 50 + } + } + ] +} \ No newline at end of file diff --git a/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_QUARTIER_S_ddd.xml b/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_QUARTIER_S_ddd.xml deleted file mode 100644 index 2225873a..00000000 --- a/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_QUARTIER_S_ddd.xml +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - - - - - true - - - - - - false - - - - - - 5 - true - - - - - - 10 - true - - - - - - true - - - - - - - 50 - false - - - - - - - 50 - false - true - - - - - - true - - - diff --git a/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_REL_HYDRO_INOND_ddd.json b/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_REL_HYDRO_INOND_ddd.json new file mode 100644 index 00000000..e9e00e24 --- /dev/null +++ b/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_REL_HYDRO_INOND_ddd.json @@ -0,0 +1,47 @@ +{ + "id": "248d4f5b981afb499f831c4146b4ae8a", + "name": "N_prefixTri_REL_HYDRO_INOND_ddd", + "columns": [ + { + "id": "0420d09827f0e09e2ad2d018b1238581", + "name": "CODE_EH", + "type": "String", + "constraints": { + "required": true, + "unique": false, + "maxLength": 10 + } + }, + { + "id": "0df6a886ddc7082c8879a49533358f66", + "name": "ID_TRI", + "description": "Valeur vide interdite", + "type": "String", + "constraints": { + "required": false, + "unique": false, + "reference": "N_prefixTri_TRI_S_ddd.ID_TRI" + } + }, + { + "id": "23aca607382a6f31171885785934c31b", + "name": "VER_SI_EXT", + "type": "String", + "constraints": { + "required": true, + "unique": false + } + }, + { + "id": "b034760eaeae2df99b2412726cde7efe", + "name": "ID_S_INOND", + "description": "Valeur vide interdite", + "type": "String", + "constraints": { + "required": false, + "unique": false, + "reference": "N_prefixTri_INONDABLE_suffixInond_S_ddd.ID_S_INOND" + } + } + ] +} \ No newline at end of file diff --git a/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_REL_HYDRO_INOND_ddd.xml b/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_REL_HYDRO_INOND_ddd.xml deleted file mode 100644 index 4ffcd28d..00000000 --- a/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_REL_HYDRO_INOND_ddd.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - 10 - true - - - - - - true - - - - - - - false - - - - - - - - false - - - - diff --git a/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_SOUST_INOND_S_ddd.json b/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_SOUST_INOND_S_ddd.json new file mode 100644 index 00000000..a7eca1b1 --- /dev/null +++ b/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_SOUST_INOND_S_ddd.json @@ -0,0 +1,83 @@ +{ + "id": "19029ec8b2f9eaabc179938237f3b607", + "name": "N_prefixTri_SOUST_INOND_S_ddd", + "columns": [ + { + "id": "0ce6fcb39fd852465b2f12129384b335", + "name": "ID_ZONE", + "type": "String", + "constraints": { + "required": true, + "unique": false + } + }, + { + "id": "0f06d05836ae8b2f93e21011802d65aa", + "name": "EST_REF", + "type": "Boolean", + "constraints": { + "required": true, + "unique": false + } + }, + { + "id": "1c460be5b298f4471f335e9adffe390f", + "name": "SCENARIO", + "description": "Valeur vide interdite", + "type": "String", + "constraints": { + "required": false, + "unique": false, + "enum": [ + "04Fai_100", + "04Faicc_ct", + "01Forcc_ct", + "01Forcc_100", + "03Mcc_ct", + "04Fai", + "01For", + "02Moy", + "03Mcc" + ] + } + }, + { + "id": "2f8ce8a147b5aef38d68128062b75e03", + "name": "ID_TRI", + "description": "Valeur nulle interdite", + "type": "String", + "constraints": { + "required": false, + "unique": false, + "reference": "N_prefixTri_TRI_S_ddd.ID_TRI" + } + }, + { + "id": "c49b141f4d877efd9b1c5081a18fd208", + "name": "WKT", + "type": "MultiPolygon", + "constraints": { + "required": false, + "unique": false + } + }, + { + "id": "d92eceed5def551e92940244275515ce", + "name": "DATENTREE", + "type": "Date", + "constraints": { + "required": true, + "unique": false + } + }, + { + "id": "d951c9d7cd98ee82a02df1bd2534216c", + "name": "DATSORTIE", + "type": "Date", + "constraints": { + "required": true, + "unique": false + } + } + ] +} \ No newline at end of file diff --git a/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_SOUST_INOND_S_ddd.xml b/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_SOUST_INOND_S_ddd.xml deleted file mode 100644 index 23ca9fb0..00000000 --- a/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_SOUST_INOND_S_ddd.xml +++ /dev/null @@ -1,77 +0,0 @@ - - - - - - - - - - - - 30 - false - true - - - - - - false - - - - - - 30 - true - - - - - - - false - - - - - - - true - - - - - - - - - - true - - - - - - true - - - - - - - false - - - - - - - - - - - - - diff --git a/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_SURALEA_S_ddd.json b/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_SURALEA_S_ddd.json new file mode 100644 index 00000000..9becd7dc --- /dev/null +++ b/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_SURALEA_S_ddd.json @@ -0,0 +1,86 @@ +{ + "id": "643ed5073eca983b9fc71ec51339cfef", + "name": "N_prefixTri_SURALEA_S_ddd", + "columns": [ + { + "id": "5c1dfc12218a47860cc0cf5076c97275", + "name": "ID_TRI", + "description": "Valeur nulle interdite", + "type": "String", + "constraints": { + "required": false, + "unique": false, + "reference": "N_prefixTri_TRI_S_ddd.ID_TRI" + } + }, + { + "id": "5e6a84378464f9258f9458c09e88641f", + "name": "DATENTREE", + "type": "Date", + "constraints": { + "required": true, + "unique": false + } + }, + { + "id": "711729915b4cac0a4893d61ecb070872", + "name": "SCENARIO", + "description": "Valeur vide interdite", + "type": "String", + "constraints": { + "required": false, + "unique": false, + "enum": [ + "04Fai_100", + "04Faicc_ct", + "01Forcc_ct", + "01Forcc_100", + "03Mcc_ct", + "04Fai", + "01For", + "02Moy", + "03Mcc" + ] + } + }, + { + "id": "868e2172aec1752afe89f0742fc78125", + "name": "EST_REF", + "type": "Boolean", + "constraints": { + "required": true, + "unique": false + } + }, + { + "id": "9269d360bab683392aa088e437c3025f", + "name": "WKT", + "type": "MultiPolygon", + "constraints": { + "required": false, + "unique": false + } + }, + { + "id": "b79e071259123c8123e3e8ba871e2305", + "name": "DATSORTIE", + "type": "Date", + "constraints": { + "required": true, + "unique": false + } + }, + { + "id": "e470007c6e89061a7217968fe50ddef7", + "name": "ID_ZONE", + "description": "COVADIS B1.2. - Identifiant de type ZSA_[numero]", + "type": "String", + "constraints": { + "required": false, + "unique": true, + "pattern": "ZSA_[0-9]+$", + "maxLength": 30 + } + } + ] +} \ No newline at end of file diff --git a/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_SURALEA_S_ddd.xml b/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_SURALEA_S_ddd.xml deleted file mode 100644 index a96774af..00000000 --- a/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_SURALEA_S_ddd.xml +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - - - - - true - - - - - - - - - - true - - - - - - - - 30 - false - true - - - - - - - false - - - - - - - - false - - - - - - - - - - - - false - - - - - - true - - - diff --git a/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_TRI_S_ddd.json b/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_TRI_S_ddd.json new file mode 100644 index 00000000..78b81d74 --- /dev/null +++ b/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_TRI_S_ddd.json @@ -0,0 +1,83 @@ +{ + "id": "fc40ca2a89bfe0e66b6d7ca9084783d3", + "name": "N_prefixTri_TRI_S_ddd", + "columns": [ + { + "id": "50657730fcbf1639aff214658d973bdf", + "name": "TX_HAB_SAI", + "type": "Integer", + "constraints": { + "required": true, + "unique": false + } + }, + { + "id": "596f8bacd6106e5a78698c4d7cc8b422", + "name": "NOM", + "description": "Valeur vide interdite", + "type": "String", + "constraints": { + "required": false, + "unique": false, + "maxLength": 254 + } + }, + { + "id": "826f1a906f914a20e79e5b270d343e94", + "name": "HAB_SAISON", + "type": "Integer", + "constraints": { + "required": true, + "unique": false + } + }, + { + "id": "834f5775bfa7b3ab42101923f3f7f55f", + "name": "DATSORTIE", + "type": "Date", + "constraints": { + "required": true, + "unique": false + } + }, + { + "id": "c27a38213c5d8477e66fa27977d189fd", + "name": "DATENTREE", + "type": "Date", + "constraints": { + "required": true, + "unique": false + } + }, + { + "id": "e3494002d678835aac24600a877db3fa", + "name": "ID_TRI", + "description": "COVADIS B1.2. - Identifiant de type [Code EUUOM Bassin DCE]_TRI_[Nom court TRI]. Exemple : \"FRD_TRI_LYON\"", + "type": "String", + "constraints": { + "required": false, + "unique": true, + "pattern": "^FR[A-Z0-9]{1,4}_TRI_[A-Z_0-9]{1,33}$", + "maxLength": 50 + } + }, + { + "id": "f85fac7eb484c62c3721e4f9306da702", + "name": "WKT", + "type": "MultiPolygon", + "constraints": { + "required": false, + "unique": false + } + }, + { + "id": "f9732b41e6a21ec58c40c428a50da51d", + "name": "HAB_PERM", + "type": "Integer", + "constraints": { + "required": true, + "unique": false + } + } + ] +} \ No newline at end of file diff --git a/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_TRI_S_ddd.xml b/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_TRI_S_ddd.xml deleted file mode 100644 index 21859eb2..00000000 --- a/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_TRI_S_ddd.xml +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - - - - - true - - - - - - true - - - - - - true - - - - - - false - - - - - - true - - - - - - - 254 - false - - - - - - true - - - - - - - - 50 - false - true - - - diff --git a/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ZONE_PROTEG_S_ddd.json b/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ZONE_PROTEG_S_ddd.json new file mode 100644 index 00000000..81dbdf52 --- /dev/null +++ b/validator-plugin-dgpr/src/test/resources/config/covadis_di_2018/types/N_prefixTri_ZONE_PROTEG_S_ddd.json @@ -0,0 +1,104 @@ +{ + "id": "6752da9c4e4eca4a180d92d94c0385d9", + "name": "N_prefixTri_ZONE_PROTEG_S_ddd", + "columns": [ + { + "id": "09648eab37a50c5379580e40cad32951", + "name": "SCENARIO", + "description": "Valeur vide interdite", + "type": "String", + "constraints": { + "required": false, + "unique": false, + "enum": [ + "04Fai_100", + "04Faicc_ct", + "01Forcc_ct", + "01Forcc_100", + "03Mcc_ct", + "04Fai", + "01For", + "02Moy", + "03Mcc" + ] + } + }, + { + "id": "66968cdfe141ea7265660810f4085999", + "name": "WKT", + "type": "MultiPolygon", + "constraints": { + "required": false, + "unique": false + } + }, + { + "id": "6bedd4c9b27eacf3ce58a8bea62d0d99", + "name": "ZP", + "type": "Boolean", + "constraints": { + "required": true, + "unique": false + } + }, + { + "id": "77b0ca4c7bfdf9ddb3e145ca23aad91d", + "name": "ID_TRI", + "description": "Valeur nulle interdite", + "type": "String", + "constraints": { + "required": false, + "unique": false, + "reference": "N_prefixTri_TRI_S_ddd.ID_TRI" + } + }, + { + "id": "a3b7308550cec554f718ac40da776d87", + "name": "EST_REF", + "type": "Boolean", + "constraints": { + "required": true, + "unique": false + } + }, + { + "id": "a97bce40559b1bc31146a7691554bff3", + "name": "ID_ZONE", + "description": "COVADIS B1.2. - Identifiant de type ZP(P)_[numero]", + "type": "String", + "constraints": { + "required": false, + "unique": true, + "pattern": "ZPP?_[0-9]+$", + "maxLength": 30 + } + }, + { + "id": "b26a33c30a7d66ffb7bf7caf51c8fa9f", + "name": "DATENTREE", + "type": "Date", + "constraints": { + "required": true, + "unique": false + } + }, + { + "id": "d05e60c57b8d6a6021f1e38f3515eda1", + "name": "ZPP", + "type": "Boolean", + "constraints": { + "required": true, + "unique": false + } + }, + { + "id": "ef79bb40ea54d87d964f8fd93c431bc1", + "name": "DATSORTIE", + "type": "Date", + "constraints": { + "required": true, + "unique": false + } + } + ] +} \ No newline at end of file From e1458d760c5f78039597e94c2b4f2ee4d7353738 Mon Sep 17 00:00:00 2001 From: MBorne Date: Thu, 8 Aug 2024 17:38:34 +0200 Subject: [PATCH 2/8] refactor(test): validator-core - remove usage of XML models in tests (refs #351) --- .../validator/io/ModelReaderFactoryTest.java | 15 +- .../ign/validator/io/XmlModelReaderTest.java | 320 ------------------ .../normalize/TableNormalizerTest.java | 6 +- .../fr/ign/validator/tools/FileUtilsTest.java | 5 +- .../attribute/CharactersValidatorTest.java | 2 +- .../FilenameExistsValidatorTest.java | 10 +- .../DocumentFolderNameValidatorTest.java | 2 +- .../resources/config-xml/adresse/files.xml | 16 - .../config-xml/adresse/types/ADRESSE.xml | 24 -- .../config-xml/cnig_PLU_2014/files.xml | 228 ------------- .../cnig_PLU_2014/types/DOC_URBA.xml | 140 -------- .../cnig_PLU_2014/types/DOC_URBA_COM.xml | 24 -- .../cnig_PLU_2014/types/HABILLAGE_LIN.xml | 32 -- .../cnig_PLU_2014/types/HABILLAGE_PCT.xml | 31 -- .../cnig_PLU_2014/types/HABILLAGE_SURF.xml | 31 -- .../cnig_PLU_2014/types/HABILLAGE_TXT.xml | 68 ---- .../cnig_PLU_2014/types/INFO_LIN.xml | 70 ---- .../cnig_PLU_2014/types/INFO_PCT.xml | 69 ---- .../cnig_PLU_2014/types/INFO_SURF.xml | 101 ------ .../cnig_PLU_2014/types/PRESCRIPTION_LIN.xml | 91 ----- .../cnig_PLU_2014/types/PRESCRIPTION_PCT.xml | 88 ----- .../cnig_PLU_2014/types/PRESCRIPTION_SURF.xml | 109 ------ .../cnig_PLU_2014/types/ZONE_URBA.xml | 108 ------ .../resources/config-xml/geofla/files.xml | 24 -- .../config-xml/geofla/types/COMMUNE.xml | 121 ------- .../geofla/types/LIMITE_COMMUNE.xml | 24 -- .../config-xml/missing_feature_type/files.xml | 16 - .../config-xml/sample-document/files.xml | 25 -- .../sample-document/types/COMMUNE.xml | 30 -- .../sample-document/types/SIMPLE.xml | 37 -- .../expected_adresse_normalized.csv | 18 +- 31 files changed, 35 insertions(+), 1850 deletions(-) delete mode 100644 validator-core/src/test/java/fr/ign/validator/io/XmlModelReaderTest.java delete mode 100644 validator-core/src/test/resources/config-xml/adresse/files.xml delete mode 100644 validator-core/src/test/resources/config-xml/adresse/types/ADRESSE.xml delete mode 100644 validator-core/src/test/resources/config-xml/cnig_PLU_2014/files.xml delete mode 100644 validator-core/src/test/resources/config-xml/cnig_PLU_2014/types/DOC_URBA.xml delete mode 100644 validator-core/src/test/resources/config-xml/cnig_PLU_2014/types/DOC_URBA_COM.xml delete mode 100644 validator-core/src/test/resources/config-xml/cnig_PLU_2014/types/HABILLAGE_LIN.xml delete mode 100644 validator-core/src/test/resources/config-xml/cnig_PLU_2014/types/HABILLAGE_PCT.xml delete mode 100644 validator-core/src/test/resources/config-xml/cnig_PLU_2014/types/HABILLAGE_SURF.xml delete mode 100644 validator-core/src/test/resources/config-xml/cnig_PLU_2014/types/HABILLAGE_TXT.xml delete mode 100644 validator-core/src/test/resources/config-xml/cnig_PLU_2014/types/INFO_LIN.xml delete mode 100644 validator-core/src/test/resources/config-xml/cnig_PLU_2014/types/INFO_PCT.xml delete mode 100644 validator-core/src/test/resources/config-xml/cnig_PLU_2014/types/INFO_SURF.xml delete mode 100644 validator-core/src/test/resources/config-xml/cnig_PLU_2014/types/PRESCRIPTION_LIN.xml delete mode 100644 validator-core/src/test/resources/config-xml/cnig_PLU_2014/types/PRESCRIPTION_PCT.xml delete mode 100644 validator-core/src/test/resources/config-xml/cnig_PLU_2014/types/PRESCRIPTION_SURF.xml delete mode 100644 validator-core/src/test/resources/config-xml/cnig_PLU_2014/types/ZONE_URBA.xml delete mode 100644 validator-core/src/test/resources/config-xml/geofla/files.xml delete mode 100644 validator-core/src/test/resources/config-xml/geofla/types/COMMUNE.xml delete mode 100644 validator-core/src/test/resources/config-xml/geofla/types/LIMITE_COMMUNE.xml delete mode 100644 validator-core/src/test/resources/config-xml/missing_feature_type/files.xml delete mode 100644 validator-core/src/test/resources/config-xml/sample-document/files.xml delete mode 100644 validator-core/src/test/resources/config-xml/sample-document/types/COMMUNE.xml delete mode 100644 validator-core/src/test/resources/config-xml/sample-document/types/SIMPLE.xml diff --git a/validator-core/src/test/java/fr/ign/validator/io/ModelReaderFactoryTest.java b/validator-core/src/test/java/fr/ign/validator/io/ModelReaderFactoryTest.java index 88cb6a2d..43cb00c7 100644 --- a/validator-core/src/test/java/fr/ign/validator/io/ModelReaderFactoryTest.java +++ b/validator-core/src/test/java/fr/ign/validator/io/ModelReaderFactoryTest.java @@ -1,5 +1,7 @@ package fr.ign.validator.io; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import java.net.MalformedURLException; @@ -7,13 +9,22 @@ import org.junit.Test; +import fr.ign.validator.exception.InvalidModelException; + public class ModelReaderFactoryTest { @Test public void testXml() throws MalformedURLException { URL url = new URL("https://example.org/my-model.xml"); - ModelReader reader = ModelReaderFactory.createModelReader(url); - assertTrue(reader instanceof XmlModelReader); + RuntimeException thrown = null; + try { + ModelReaderFactory.createModelReader(url); + }catch(RuntimeException e){ + thrown = e; + } + assertNotNull(thrown); + assertTrue(thrown instanceof InvalidModelException); + assertEquals("Fail to load https://example.org/my-model.xml (XML model support has been removed, use JSON format)",thrown.getMessage()); } @Test diff --git a/validator-core/src/test/java/fr/ign/validator/io/XmlModelReaderTest.java b/validator-core/src/test/java/fr/ign/validator/io/XmlModelReaderTest.java deleted file mode 100644 index e50928a8..00000000 --- a/validator-core/src/test/java/fr/ign/validator/io/XmlModelReaderTest.java +++ /dev/null @@ -1,320 +0,0 @@ -package fr.ign.validator.io; - -import java.io.File; -import java.net.MalformedURLException; -import java.net.URL; -import java.util.List; - -import org.apache.commons.lang3.StringUtils; -import org.apache.logging.log4j.util.Strings; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; - -import com.fasterxml.jackson.core.JsonProcessingException; - -import fr.ign.validator.exception.ModelNotFoundException; -import fr.ign.validator.model.AttributeConstraints; -import fr.ign.validator.model.AttributeType; -import fr.ign.validator.model.DocumentModel; -import fr.ign.validator.model.FeatureType; -import fr.ign.validator.model.FileModel; -import fr.ign.validator.model.FileModel.MandatoryMode; -import fr.ign.validator.model.TableModel; -import fr.ign.validator.model.file.SingleTableModel; -import fr.ign.validator.tools.ResourceHelper; - -public class XmlModelReaderTest { - - private ModelReader modelLoader; - - @Before - public void setUp() throws Exception { - modelLoader = new XmlModelReader(); - } - - /** - * Ensure that ModelNotFoundException are thrown if DocumentModel file doesn't - * exists - */ - @Test - public void testLoadDocumentModelFileNotFound() { - File configDir = ResourceHelper.getResourceFile(getClass(), "/config-xml"); - File documentModelPath = new File(configDir, "/not-found/files.xml"); - boolean thrown = false; - try { - modelLoader.loadDocumentModel(documentModelPath); - } catch (ModelNotFoundException e) { - Assert.assertTrue(e.getMessage().contains("/not-found/files.xml")); - thrown = true; - } - Assert.assertTrue("ModelNotFoundException excepted", thrown); - } - - /** - * Ensure that ModelNotFoundException are thrown if DocumentModel URL doesn't - * exists - * - * @throws MalformedURLException - */ - @Test - public void testLoadDocumentModelUrlNotFound() throws MalformedURLException { - URL documentModelUrl = new URL("https://example.local/not-found/files.xml"); - boolean thrown = false; - try { - modelLoader.loadDocumentModel(documentModelUrl); - } catch (ModelNotFoundException e) { - Assert.assertEquals("Model 'https://example.local/not-found/files.xml' not found", e.getMessage()); - thrown = true; - } - Assert.assertTrue("ModelNotFoundException excepted", thrown); - } - - /** - * Ensure that ModelNotFoundException are thrown if a FeatureType is missing - * - * @throws MalformedURLException - */ - @Test - public void testLoadDocumentModelFeatureTypeNotFound() throws MalformedURLException { - File documentModelPath = ResourceHelper.getResourceFile( - getClass(), "/config-xml/missing_feature_type/files.xml" - ); - boolean thrown = false; - try { - modelLoader.loadDocumentModel(documentModelPath); - } catch (ModelNotFoundException e) { - Assert.assertTrue(e.getMessage().contains("/missing_feature_type/types/MY_TABLE.xml' not found")); - thrown = true; - } - Assert.assertTrue("ModelNotFoundException excepted", thrown); - } - - /** - * Read cnig_PLU_2014 and performs regress test - * - * @throws JsonProcessingException - */ - @Test - public void testLoadDocumentModelCnigPlu2014() { - File documentModelPath = ResourceHelper.getResourceFile(getClass(), "/config-xml/cnig_PLU_2014/files.xml"); - DocumentModel documentModel = modelLoader.loadDocumentModel(documentModelPath); - assertIsValid(documentModel); - - Assert.assertEquals("cnig_PLU_2014", documentModel.getName()); - Assert.assertEquals(31, documentModel.getFileModels().size()); - } - - /** - * Read adresse model and performs regress test - * - * @throws JsonProcessingException - */ - @Test - public void testLoadDocumentModelAdresse() { - File documentModelPath = ResourceHelper.getResourceFile(getClass(), "/config-xml/adresse/files.xml"); - DocumentModel documentModel = modelLoader.loadDocumentModel(documentModelPath); - assertIsValid(documentModel); - - Assert.assertEquals("adresse", documentModel.getName()); - Assert.assertEquals(1, documentModel.getFileModels().size()); - - FileModel fileModel = documentModel.getFileModels().get(0); - Assert.assertEquals("ADRESSE", fileModel.getName()); - - Assert.assertTrue(fileModel instanceof SingleTableModel); - FeatureType featureType = ((TableModel) fileModel).getFeatureType(); - Assert.assertNotNull(featureType); - Assert.assertEquals(2, featureType.getAttributeCount()); - - int index = 0; - { - AttributeType attribute = featureType.getAttribute(index++); - Assert.assertEquals("ID", attribute.getName()); - Assert.assertEquals("String", attribute.getTypeName()); - Assert.assertTrue(attribute.getConstraints().isUnique()); - } - { - AttributeType attribute = featureType.getAttribute(index++); - Assert.assertEquals("ADRESSE", attribute.getName()); - Assert.assertEquals("String", attribute.getTypeName()); - Assert.assertFalse(attribute.getConstraints().isUnique()); - } - } - - /** - * Load DocumentModel /config-xml/sample-document/files.xml and performs checks - */ - @Test - public void testLoadDocumentModelSampleDocument() { - File documentModelPath = ResourceHelper.getResourceFile(getClass(), "/config-xml/sample-document/files.xml"); - DocumentModel documentModel = modelLoader.loadDocumentModel(documentModelPath); - assertIsValid(documentModel); - - // name - Assert.assertEquals("ccccc_CC_dddddddd", documentModel.getName()); - // DocumentContraints - Assert.assertEquals( - "[0-9]{5}_CC_[0-9]{8}", - documentModel.getConstraints().getFolderName() - ); - Assert.assertNull( - documentModel.getConstraints().getMetadataSpecification() - ); - - // fileModels - Assert.assertEquals(3, documentModel.getFileModels().size()); - int index = 0; - { - FileModel fileModel = documentModel.getFileModels().get(index++); - Assert.assertEquals("SIMPLE", fileModel.getName()); - Assert.assertTrue(fileModel instanceof SingleTableModel); - FeatureType featureType = ((TableModel) fileModel).getFeatureType(); - Assert.assertNotNull(featureType); - Assert.assertEquals(MandatoryMode.WARN, fileModel.getMandatory()); - Assert.assertEquals("SIMPLE", featureType.getName()); - } - { - FileModel fileModel = documentModel.getFileModels().get(index++); - Assert.assertEquals("Donnees_geographiques", fileModel.getName()); - Assert.assertEquals(MandatoryMode.ERROR, fileModel.getMandatory()); - } - { - FileModel fileModel = documentModel.getFileModels().get(index++); - Assert.assertEquals("COMMUNE", fileModel.getName()); - Assert.assertEquals(MandatoryMode.WARN, fileModel.getMandatory()); - - Assert.assertTrue(fileModel instanceof SingleTableModel); - FeatureType featureType = ((TableModel) fileModel).getFeatureType(); - Assert.assertNotNull(featureType); - Assert.assertEquals("COMMUNE", featureType.getName()); - assertExceptedFeatureTypeCommune(featureType); - } - } - - /** - * Check FeatureType definition for - * /config-xml/sample-document/types/COMMUNE.xml - * - * @param featureType - */ - private void assertExceptedFeatureTypeCommune(FeatureType featureType) { - int index = 0; - { - AttributeType attributeType = featureType.getAttribute(index++); - Assert.assertEquals("INSEE", attributeType.getName()); - Assert.assertEquals("String", attributeType.getTypeName()); - AttributeConstraints contraints = attributeType.getConstraints(); - Assert.assertEquals(true, contraints.isRequired()); - Assert.assertEquals(true, contraints.isUnique()); - Assert.assertEquals("[0-9]{5}", contraints.getPattern()); - Assert.assertNull(contraints.getReference()); - Assert.assertNull(contraints.getEnumValues()); - } - { - AttributeType attributeType = featureType.getAttribute(index++); - Assert.assertEquals("CODE_DEPT", attributeType.getName()); - Assert.assertEquals("String", attributeType.getTypeName()); - AttributeConstraints constraints = attributeType.getConstraints(); - Assert.assertEquals(true, constraints.isRequired()); - Assert.assertNull(constraints.getPattern()); - Assert.assertEquals(false, constraints.isUnique()); - Assert.assertNull(constraints.getReference()); - Assert.assertNotNull(constraints.getEnumValues()); - Assert.assertEquals("01,02", Strings.join(constraints.getEnumValues(), ',')); - } - { - AttributeType attributeType = featureType.getAttribute(index++); - Assert.assertEquals("DETRUIT", attributeType.getName()); - Assert.assertEquals("Boolean", attributeType.getTypeName()); - AttributeConstraints constraints = attributeType.getConstraints(); - Assert.assertEquals(false, constraints.isRequired()); - Assert.assertNull(constraints.getPattern()); - Assert.assertEquals(false, constraints.isUnique()); - Assert.assertNull(constraints.getReference()); - Assert.assertNull(constraints.getEnumValues()); - } - } - - @Test - public void testLoadFeatureTypeWithCDATA() { - File srcFile = ResourceHelper.getResourceFile(getClass(), "/config-xml/sample-document/types/SIMPLE.xml"); - - FeatureType featureType = modelLoader.loadFeatureType(srcFile); - Assert.assertEquals("SIMPLE", featureType.getName()); - Assert.assertEquals("TABLE TEST", featureType.getDescription()); - Assert.assertEquals(3, featureType.getAttributeCount()); - Assert.assertTrue(featureType.isSpatial()); - - int index = 0; - { - AttributeType attribute = featureType.getAttribute(index++); - Assert.assertEquals("ID", attribute.getName()); - Assert.assertEquals("Integer", attribute.getTypeName()); - - AttributeConstraints constraints = attribute.getConstraints(); - Assert.assertTrue(constraints.isRequired()); - Assert.assertFalse(constraints.isUnique()); - Assert.assertNull(constraints.getPattern()); - Assert.assertNull(constraints.getEnumValues()); - } - - { - AttributeType attribute = featureType.getAttribute(index++); - Assert.assertEquals("NAME", attribute.getName()); - Assert.assertEquals("String", attribute.getTypeName()); - - AttributeConstraints constraints = attribute.getConstraints(); - Assert.assertTrue(constraints.isRequired()); - Assert.assertFalse(constraints.isUnique()); - Assert.assertNull(constraints.getPattern()); - Assert.assertNull(constraints.getEnumValues()); - } - - { - AttributeType attribute = featureType.getAttribute(index++); - Assert.assertEquals("GEOMETRY", attribute.getName()); - Assert.assertEquals("Geometry", attribute.getTypeName()); - - AttributeConstraints constraints = attribute.getConstraints(); - Assert.assertFalse(constraints.isRequired()); - Assert.assertFalse(constraints.isUnique()); - Assert.assertNull(constraints.getPattern()); - Assert.assertNull(constraints.getEnumValues()); - } - - } - - /** - * Performs basic consistency checks on DocumentModel - * - * @param documentModel - */ - private void assertIsValid(DocumentModel documentModel) { - List fileModels = documentModel.getFileModels(); - for (FileModel fileModel : fileModels) { - Assert.assertNotNull(fileModel.getName()); - Assert.assertNotNull(fileModel.getMandatory()); - if (fileModel instanceof SingleTableModel) { - FeatureType featureType = ((TableModel) fileModel).getFeatureType(); - Assert.assertNotNull(featureType); - assertIsValid(featureType); - } - } - } - - /** - * Performs basic consistency checks on FeatureType - * - * @param documentModel - */ - private void assertIsValid(FeatureType featureType) { - Assert.assertFalse(StringUtils.isEmpty(featureType.getName())); - - Assert.assertFalse( - "featureType must have at least one attribute", - featureType.getAttributeCount() == 0 - ); - } - -} diff --git a/validator-core/src/test/java/fr/ign/validator/normalize/TableNormalizerTest.java b/validator-core/src/test/java/fr/ign/validator/normalize/TableNormalizerTest.java index 65cecc85..2c60ce87 100644 --- a/validator-core/src/test/java/fr/ign/validator/normalize/TableNormalizerTest.java +++ b/validator-core/src/test/java/fr/ign/validator/normalize/TableNormalizerTest.java @@ -12,8 +12,8 @@ import fr.ign.validator.Context; import fr.ign.validator.data.Document; +import fr.ign.validator.io.JsonModelReader; import fr.ign.validator.io.ModelReader; -import fr.ign.validator.io.XmlModelReader; import fr.ign.validator.model.DocumentModel; import fr.ign.validator.model.FeatureType; import fr.ign.validator.model.FileModel; @@ -42,8 +42,8 @@ public void setUp() throws Exception { context.setProjection(Projection.CODE_CRS84); context.setReportBuilder(reportBuilder); - File documentModelPath = ResourceHelper.getResourceFile(getClass(), "/config-xml/adresse/files.xml"); - ModelReader modelLoader = new XmlModelReader(); + File documentModelPath = ResourceHelper.getResourceFile(getClass(), "/config-json/adresse/files.json"); + ModelReader modelLoader = new JsonModelReader(); DocumentModel documentModel = modelLoader.loadDocumentModel(documentModelPath); File documentPath = ResourceHelper.getResourceFile(getClass(), "/documents/adresse-multiple"); diff --git a/validator-core/src/test/java/fr/ign/validator/tools/FileUtilsTest.java b/validator-core/src/test/java/fr/ign/validator/tools/FileUtilsTest.java index 776578bc..6242adc0 100644 --- a/validator-core/src/test/java/fr/ign/validator/tools/FileUtilsTest.java +++ b/validator-core/src/test/java/fr/ign/validator/tools/FileUtilsTest.java @@ -11,12 +11,13 @@ public class FileUtilsTest { @Test public void testListFilesAndDirs() { - File directory = ResourceHelper.getResourceFile(getClass(), "/config-xml/geofla"); + File directory = ResourceHelper.getResourceFile(getClass(), "/documents/commune-sample"); String[] extensions = { "xml" }; Collection files = FileUtils.listFilesAndDirs(directory, extensions); - assertEquals(4, files.size()); + // 2 XML files and 1 sub-directory + assertEquals(3, files.size()); } } diff --git a/validator-core/src/test/java/fr/ign/validator/validation/attribute/CharactersValidatorTest.java b/validator-core/src/test/java/fr/ign/validator/validation/attribute/CharactersValidatorTest.java index 9dbf22d0..9835c0c9 100644 --- a/validator-core/src/test/java/fr/ign/validator/validation/attribute/CharactersValidatorTest.java +++ b/validator-core/src/test/java/fr/ign/validator/validation/attribute/CharactersValidatorTest.java @@ -28,7 +28,7 @@ public void setUp() throws Exception { context = new Context(); context.setStringFixer(StringFixer.createFullStringFixer(StandardCharsets.ISO_8859_1)); - File currentDirectory = ResourceHelper.getResourceFile(getClass(), "/config-xml/geofla"); + File currentDirectory = ResourceHelper.getResourceFile(getClass(), "/documents/adresse-multiple"); context.setCurrentDirectory(currentDirectory); report = new InMemoryReportBuilder(); diff --git a/validator-core/src/test/java/fr/ign/validator/validation/attribute/FilenameExistsValidatorTest.java b/validator-core/src/test/java/fr/ign/validator/validation/attribute/FilenameExistsValidatorTest.java index 18c689d1..7c784932 100644 --- a/validator-core/src/test/java/fr/ign/validator/validation/attribute/FilenameExistsValidatorTest.java +++ b/validator-core/src/test/java/fr/ign/validator/validation/attribute/FilenameExistsValidatorTest.java @@ -23,7 +23,7 @@ public void setUp() throws Exception { validator = new FilenameExistsValidator(); context = new Context(); - File currentDirectory = ResourceHelper.getResourceFile(getClass(), "/config-xml/geofla"); + File currentDirectory = ResourceHelper.getResourceFile(getClass(), "/documents/commune-sample"); context.setCurrentDirectory(currentDirectory); report = new InMemoryReportBuilder(); @@ -33,7 +33,7 @@ public void setUp() throws Exception { @Test public void testExisting() { PathType type = new PathType(); - Attribute attribute = new Attribute(type, new File("files.xml")); + Attribute attribute = new Attribute(type, new File("commune.csv")); validator.validate(context, attribute); Assert.assertEquals(0, report.countErrors()); } @@ -41,7 +41,7 @@ public void testExisting() { @Test public void testExistingWithFragment() { PathType type = new PathType(); - Attribute attribute = new Attribute(type, new File("files.xml#page=15")); + Attribute attribute = new Attribute(type, new File("commune.csv#page=15")); validator.validate(context, attribute); Assert.assertEquals(0, report.countErrors()); } @@ -49,7 +49,7 @@ public void testExistingWithFragment() { @Test public void testExistingInSubdirectory() { PathType type = new PathType(); - Attribute attribute = new Attribute(type, new File("COMMUNE.xml")); + Attribute attribute = new Attribute(type, new File("a_file.pdf")); validator.validate(context, attribute); Assert.assertEquals(0, report.countErrors()); } @@ -57,7 +57,7 @@ public void testExistingInSubdirectory() { @Test public void testExistingInSubdirectoryWithFragment() { PathType type = new PathType(); - Attribute attribute = new Attribute(type, new File("COMMUNE.xml#page=15")); + Attribute attribute = new Attribute(type, new File("a_file.pdf#page=15")); validator.validate(context, attribute); Assert.assertEquals(0, report.countErrors()); } diff --git a/validator-core/src/test/java/fr/ign/validator/validation/document/DocumentFolderNameValidatorTest.java b/validator-core/src/test/java/fr/ign/validator/validation/document/DocumentFolderNameValidatorTest.java index 761a75b7..d7027739 100644 --- a/validator-core/src/test/java/fr/ign/validator/validation/document/DocumentFolderNameValidatorTest.java +++ b/validator-core/src/test/java/fr/ign/validator/validation/document/DocumentFolderNameValidatorTest.java @@ -23,7 +23,7 @@ public void setUp() throws Exception { validator = new DocumentFolderNameValidator(); context = new Context(); - File currentDirectory = ResourceHelper.getResourceFile(getClass(), "/config-xml/geofla"); + File currentDirectory = ResourceHelper.getResourceFile(getClass(), "/documents/commune-sample"); context.setCurrentDirectory(currentDirectory); report = new InMemoryReportBuilder(); diff --git a/validator-core/src/test/resources/config-xml/adresse/files.xml b/validator-core/src/test/resources/config-xml/adresse/files.xml deleted file mode 100644 index 6c07922a..00000000 --- a/validator-core/src/test/resources/config-xml/adresse/files.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/validator-core/src/test/resources/config-xml/adresse/types/ADRESSE.xml b/validator-core/src/test/resources/config-xml/adresse/types/ADRESSE.xml deleted file mode 100644 index 868f5c9c..00000000 --- a/validator-core/src/test/resources/config-xml/adresse/types/ADRESSE.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - 20 - false - true - - - - - - - 254 - true - - - diff --git a/validator-core/src/test/resources/config-xml/cnig_PLU_2014/files.xml b/validator-core/src/test/resources/config-xml/cnig_PLU_2014/files.xml deleted file mode 100644 index 45805287..00000000 --- a/validator-core/src/test/resources/config-xml/cnig_PLU_2014/files.xml +++ /dev/null @@ -1,228 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/validator-core/src/test/resources/config-xml/cnig_PLU_2014/types/DOC_URBA.xml b/validator-core/src/test/resources/config-xml/cnig_PLU_2014/types/DOC_URBA.xml deleted file mode 100644 index f631f6c9..00000000 --- a/validator-core/src/test/resources/config-xml/cnig_PLU_2014/types/DOC_URBA.xml +++ /dev/null @@ -1,140 +0,0 @@ - - - - - - - - - - - - 4 - false - - - - - - - - - - - - - 254 - true - - - - - - - 2 - false - - - - - - - - - - - - - - - - 1 - true - - - - - - - - - - - 80 - true - - - - - - - 2 - true - - - - - - - - - - - 80 - true - - - - - - - 20 - false - - - - - - - 254 - true - - - - - - - 254 - true - - - - - - - true - - - - - - - true - - - - - - - 9 - true - - - - - - - true - - - diff --git a/validator-core/src/test/resources/config-xml/cnig_PLU_2014/types/DOC_URBA_COM.xml b/validator-core/src/test/resources/config-xml/cnig_PLU_2014/types/DOC_URBA_COM.xml deleted file mode 100644 index 38d35cbf..00000000 --- a/validator-core/src/test/resources/config-xml/cnig_PLU_2014/types/DOC_URBA_COM.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - 20 - true - - - - - - - 5 - false - - - diff --git a/validator-core/src/test/resources/config-xml/cnig_PLU_2014/types/HABILLAGE_LIN.xml b/validator-core/src/test/resources/config-xml/cnig_PLU_2014/types/HABILLAGE_LIN.xml deleted file mode 100644 index 15f1751a..00000000 --- a/validator-core/src/test/resources/config-xml/cnig_PLU_2014/types/HABILLAGE_LIN.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - 5 - false - - - - - - - 40 - true - - - - - - - -1 - false - - - diff --git a/validator-core/src/test/resources/config-xml/cnig_PLU_2014/types/HABILLAGE_PCT.xml b/validator-core/src/test/resources/config-xml/cnig_PLU_2014/types/HABILLAGE_PCT.xml deleted file mode 100644 index 83b00a8b..00000000 --- a/validator-core/src/test/resources/config-xml/cnig_PLU_2014/types/HABILLAGE_PCT.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - 5 - false - - - - - - - false - - - - - - - 40 - true - - - diff --git a/validator-core/src/test/resources/config-xml/cnig_PLU_2014/types/HABILLAGE_SURF.xml b/validator-core/src/test/resources/config-xml/cnig_PLU_2014/types/HABILLAGE_SURF.xml deleted file mode 100644 index b3466121..00000000 --- a/validator-core/src/test/resources/config-xml/cnig_PLU_2014/types/HABILLAGE_SURF.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - 40 - true - - - - - - - false - - - - - - - 5 - false - - - diff --git a/validator-core/src/test/resources/config-xml/cnig_PLU_2014/types/HABILLAGE_TXT.xml b/validator-core/src/test/resources/config-xml/cnig_PLU_2014/types/HABILLAGE_TXT.xml deleted file mode 100644 index 868d4796..00000000 --- a/validator-core/src/test/resources/config-xml/cnig_PLU_2014/types/HABILLAGE_TXT.xml +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - - - - - - 40 - false - - - - - - - 40 - true - - - - - - - 5 - false - - - - - - - false - - - - - - - true - - - - - - - false - - - - - - - 80 - false - - - - - - - 40 - false - - - diff --git a/validator-core/src/test/resources/config-xml/cnig_PLU_2014/types/INFO_LIN.xml b/validator-core/src/test/resources/config-xml/cnig_PLU_2014/types/INFO_LIN.xml deleted file mode 100644 index 9ba31603..00000000 --- a/validator-core/src/test/resources/config-xml/cnig_PLU_2014/types/INFO_LIN.xml +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - - - - - - - 5 - false - - - - - - - 10 - true - - - - - - - 254 - false - - - - - - - 254 - true - - - - - - - 2 - false - - - - - - - - - - - - - - false - - - - - - - 80 - true - - - diff --git a/validator-core/src/test/resources/config-xml/cnig_PLU_2014/types/INFO_PCT.xml b/validator-core/src/test/resources/config-xml/cnig_PLU_2014/types/INFO_PCT.xml deleted file mode 100644 index 50b6a028..00000000 --- a/validator-core/src/test/resources/config-xml/cnig_PLU_2014/types/INFO_PCT.xml +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - - - - - - - 80 - true - - - - - - - false - - - - - - - 254 - true - - - - - - - 2 - false - - - - - - - - - - - - - 254 - false - - - - - - - 10 - true - - - - - - - 5 - false - - - diff --git a/validator-core/src/test/resources/config-xml/cnig_PLU_2014/types/INFO_SURF.xml b/validator-core/src/test/resources/config-xml/cnig_PLU_2014/types/INFO_SURF.xml deleted file mode 100644 index 724a8bd8..00000000 --- a/validator-core/src/test/resources/config-xml/cnig_PLU_2014/types/INFO_SURF.xml +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - - - - - - - 5 - false - - - - - - - 2 - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 10 - true - - - - - - - false - - - - - - - 254 - false - - - - - - - 80 - true - - - - - - - 254 - true - - - diff --git a/validator-core/src/test/resources/config-xml/cnig_PLU_2014/types/PRESCRIPTION_LIN.xml b/validator-core/src/test/resources/config-xml/cnig_PLU_2014/types/PRESCRIPTION_LIN.xml deleted file mode 100644 index a53aadc7..00000000 --- a/validator-core/src/test/resources/config-xml/cnig_PLU_2014/types/PRESCRIPTION_LIN.xml +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - - - - - - true - - - - - - - false - - - - - - - 10 - true - - - - - - - 254 - false - - - - - - - 5 - false - - - - - - - 254 - true - - - - - - - 80 - true - - - - - - - 2 - false - - - - - - - - - - - - - - - - - - - - - true - - - diff --git a/validator-core/src/test/resources/config-xml/cnig_PLU_2014/types/PRESCRIPTION_PCT.xml b/validator-core/src/test/resources/config-xml/cnig_PLU_2014/types/PRESCRIPTION_PCT.xml deleted file mode 100644 index b0206859..00000000 --- a/validator-core/src/test/resources/config-xml/cnig_PLU_2014/types/PRESCRIPTION_PCT.xml +++ /dev/null @@ -1,88 +0,0 @@ - - - - - - - - - - - - false - - - - - - - 80 - true - - - - - - - 254 - false - - - - - - - 2 - false - - - - - - - - - - - - - - - - - - 5 - false - - - - - - - true - - - - - - - true - - - - - - - 254 - true - - - - - - - 10 - true - - - diff --git a/validator-core/src/test/resources/config-xml/cnig_PLU_2014/types/PRESCRIPTION_SURF.xml b/validator-core/src/test/resources/config-xml/cnig_PLU_2014/types/PRESCRIPTION_SURF.xml deleted file mode 100644 index c1e1c495..00000000 --- a/validator-core/src/test/resources/config-xml/cnig_PLU_2014/types/PRESCRIPTION_SURF.xml +++ /dev/null @@ -1,109 +0,0 @@ - - - - - - - - - - - - 254 - true - - - - - - - true - - - - - - - true - - - - - - - 80 - true - - - - - - - 2 - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 254 - false - - - - - - - 10 - true - - - - - - - false - - - - - - - 5 - false - - - diff --git a/validator-core/src/test/resources/config-xml/cnig_PLU_2014/types/ZONE_URBA.xml b/validator-core/src/test/resources/config-xml/cnig_PLU_2014/types/ZONE_URBA.xml deleted file mode 100644 index ce9ed74d..00000000 --- a/validator-core/src/test/resources/config-xml/cnig_PLU_2014/types/ZONE_URBA.xml +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - - - - - - - 2 - false - - - - - - - - - - - - - - - - - - - - 5 - false - - - - - - - 254 - true - - - - - - - 80 - true - - - - - - - 254 - true - - - - - - - 3 - false - - - - - - - - - - - - - - - - - true - - - - - - - true - - - - - - - 12 - false - - - - - - - false - - - diff --git a/validator-core/src/test/resources/config-xml/geofla/files.xml b/validator-core/src/test/resources/config-xml/geofla/files.xml deleted file mode 100644 index 5ca355a9..00000000 --- a/validator-core/src/test/resources/config-xml/geofla/files.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - 788 - - - - - 8766 - - - - - OPTIONAL - - - 8766 - - - - - OPTIONAL - - - diff --git a/validator-core/src/test/resources/config-xml/geofla/types/COMMUNE.xml b/validator-core/src/test/resources/config-xml/geofla/types/COMMUNE.xml deleted file mode 100644 index 09624924..00000000 --- a/validator-core/src/test/resources/config-xml/geofla/types/COMMUNE.xml +++ /dev/null @@ -1,121 +0,0 @@ - - - COMMUNE - - - GEOMETRY - Geometry - GEOMETRY - false - - - ID_GEOFLA - String - ID_GEOFLA - false - - - CODE_COM - String - CODE_COM - false - - - INSEE_COM - String - INSEE_COM - false - - - NOM_COM - String - NOM_COM - false - - - STATUT - String - STATUT - false - - - X_CHF_LIEU - String - X_CHF_LIEU - false - - - Y_CHF_LIEU - String - Y_CHF_LIEU - false - - - X_CENTROID - String - X_CENTROID - false - - - Y_CENTROID - String - Y_CENTROID - false - - - Z_MOYEN - String - Z_MOYEN - false - - - SUPERFICIE - String - SUPERFICIE - false - - - POPULATION - String - POPULATION - false - - - CODE_CANT - String - CODE_CANT - false - - - CODE_ARR - String - CODE_ARR - false - - - CODE_DEPT - String - CODE_DEPT - false - - - NOM_DEPT - String - NOM_DEPT - false - - - CODE_REG - String - CODE_REG - false - - - NOM_REG - String - NOM_REG - false - - - - diff --git a/validator-core/src/test/resources/config-xml/geofla/types/LIMITE_COMMUNE.xml b/validator-core/src/test/resources/config-xml/geofla/types/LIMITE_COMMUNE.xml deleted file mode 100644 index fd0345b6..00000000 --- a/validator-core/src/test/resources/config-xml/geofla/types/LIMITE_COMMUNE.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - LIMITE_COMMUNE - - - GEOMETRY - Geometry - GEOMETRY - false - - - ID_GEOFLA - String - ID_GEOFLA - false - - - NATURE - String - NATURE - false - - - \ No newline at end of file diff --git a/validator-core/src/test/resources/config-xml/missing_feature_type/files.xml b/validator-core/src/test/resources/config-xml/missing_feature_type/files.xml deleted file mode 100644 index 14a72dc9..00000000 --- a/validator-core/src/test/resources/config-xml/missing_feature_type/files.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/validator-core/src/test/resources/config-xml/sample-document/files.xml b/validator-core/src/test/resources/config-xml/sample-document/files.xml deleted file mode 100644 index 2c5ff628..00000000 --- a/validator-core/src/test/resources/config-xml/sample-document/files.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - ccccc_CC_dddddddd - [0-9]{5}_CC_[0-9]{8} - - - SIMPLE - table - (N_)?SIMPLE(_(02A|02B|[0-9]{3}))? - WARN - - - Donnees_geographiques - directory - Donnees_geographiques - ERROR - - - COMMUNE - table - Donnees_geographiques/(N_)?COMMUNE(_[0-9]{5})?(_(02A|02B|[0-9]{3}))? - WARN - - - diff --git a/validator-core/src/test/resources/config-xml/sample-document/types/COMMUNE.xml b/validator-core/src/test/resources/config-xml/sample-document/types/COMMUNE.xml deleted file mode 100644 index 90fd523a..00000000 --- a/validator-core/src/test/resources/config-xml/sample-document/types/COMMUNE.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - COMMUNE - La table des communes - - - INSEE - String - [0-9]{5} - false - true - - - CODE_DEPT - String - false - false - - 01 - 02 - - - - DETRUIT - Boolean - true - false - - - diff --git a/validator-core/src/test/resources/config-xml/sample-document/types/SIMPLE.xml b/validator-core/src/test/resources/config-xml/sample-document/types/SIMPLE.xml deleted file mode 100644 index 93b5ce43..00000000 --- a/validator-core/src/test/resources/config-xml/sample-document/types/SIMPLE.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - 64594 - - - - - 130278 - - - - false - - - 130279 - - - - false - - - 130280 - - - true - - - - 786 - - - - - - - - diff --git a/validator-core/src/test/resources/normalizer/expected_adresse_normalized.csv b/validator-core/src/test/resources/normalizer/expected_adresse_normalized.csv index 0f0e3e36..2fa253cb 100644 --- a/validator-core/src/test/resources/normalizer/expected_adresse_normalized.csv +++ b/validator-core/src/test/resources/normalizer/expected_adresse_normalized.csv @@ -1,9 +1,9 @@ -ID,ADRESSE -1,"adresse bidon, Paris" -5,"adresse du 15ième, Paris" -2,"adresse au soleil, Montpellier" -3,"adresse sympa, Montpellier" -4,"adresse sous la pluie, Brest" -7,"adresse d'un pub, Brest" -6, -7, +ID,ADRESSE,HOMEPAGE +1,"adresse bidon, Paris", +5,"adresse du 15ième, Paris", +2,"adresse au soleil, Montpellier", +3,"adresse sympa, Montpellier", +4,"adresse sous la pluie, Brest", +7,"adresse d'un pub, Brest", +6,, +7,, From b629fa1f13691d91f4ee5ca4df50869517645527 Mon Sep 17 00:00:00 2001 From: MBorne Date: Thu, 8 Aug 2024 17:39:30 +0200 Subject: [PATCH 3/8] refactor(model): validator-core - remove support for XML models (refs #351) --- .../command/DocumentValidatorCommand.java | 2 - .../ign/validator/io/AbstractModelReader.java | 2 +- .../java/fr/ign/validator/io/ModelReader.java | 2 +- .../ign/validator/io/ModelReaderFactory.java | 4 +- .../fr/ign/validator/io/XmlModelReader.java | 71 ----------------- .../io/xml/AttributeTypeAdapter.java | 79 ------------------- .../validator/io/xml/FileModelAdapter.java | 58 -------------- .../fr/ign/validator/model/AttributeType.java | 3 - .../validator/model/AttributeTypeFactory.java | 2 +- .../fr/ign/validator/model/DocumentModel.java | 13 --- .../fr/ign/validator/model/FeatureType.java | 15 ---- .../fr/ign/validator/model/FileModel.java | 8 -- 12 files changed, 6 insertions(+), 253 deletions(-) delete mode 100644 validator-core/src/main/java/fr/ign/validator/io/XmlModelReader.java delete mode 100644 validator-core/src/main/java/fr/ign/validator/io/xml/AttributeTypeAdapter.java delete mode 100644 validator-core/src/main/java/fr/ign/validator/io/xml/FileModelAdapter.java diff --git a/validator-core/src/main/java/fr/ign/validator/command/DocumentValidatorCommand.java b/validator-core/src/main/java/fr/ign/validator/command/DocumentValidatorCommand.java index bbcc7200..4b21b3e0 100644 --- a/validator-core/src/main/java/fr/ign/validator/command/DocumentValidatorCommand.java +++ b/validator-core/src/main/java/fr/ign/validator/command/DocumentValidatorCommand.java @@ -20,8 +20,6 @@ import org.apache.logging.log4j.MarkerManager; import org.locationtech.jts.geom.Geometry; -import com.ctc.wstx.util.StringUtil; - import fr.ign.validator.Context; import fr.ign.validator.Version; import fr.ign.validator.command.options.DocumentEmpriseOption; diff --git a/validator-core/src/main/java/fr/ign/validator/io/AbstractModelReader.java b/validator-core/src/main/java/fr/ign/validator/io/AbstractModelReader.java index 7bfdc1d0..42284334 100644 --- a/validator-core/src/main/java/fr/ign/validator/io/AbstractModelReader.java +++ b/validator-core/src/main/java/fr/ign/validator/io/AbstractModelReader.java @@ -21,7 +21,7 @@ import fr.ign.validator.tools.ModelHelper; /** - * Common implementation for JSON and XML ModelReader. + * Common implementation for JSON and XML ModelReader (removed). * * @author MBorne */ diff --git a/validator-core/src/main/java/fr/ign/validator/io/ModelReader.java b/validator-core/src/main/java/fr/ign/validator/io/ModelReader.java index 00a79ad8..1c27ebfe 100644 --- a/validator-core/src/main/java/fr/ign/validator/io/ModelReader.java +++ b/validator-core/src/main/java/fr/ign/validator/io/ModelReader.java @@ -21,7 +21,7 @@ public interface ModelReader { public String getFormat(); /** - * Read File as a DocumentModel (files.xml) + * Read File as a DocumentModel * * @param documentModelPath * @return diff --git a/validator-core/src/main/java/fr/ign/validator/io/ModelReaderFactory.java b/validator-core/src/main/java/fr/ign/validator/io/ModelReaderFactory.java index bfe3f233..60e722bb 100644 --- a/validator-core/src/main/java/fr/ign/validator/io/ModelReaderFactory.java +++ b/validator-core/src/main/java/fr/ign/validator/io/ModelReaderFactory.java @@ -2,6 +2,8 @@ import java.net.URL; +import fr.ign.validator.exception.InvalidModelException; + /** * Create ModelReader instances * @@ -26,7 +28,7 @@ private ModelReaderFactory() { */ public static ModelReader createModelReader(URL url) { if (url.toString().endsWith(".xml")) { - return new XmlModelReader(); + throw new InvalidModelException("Fail to load "+url+" (XML model support has been removed, use JSON format)"); } else { return new JsonModelReader(); } diff --git a/validator-core/src/main/java/fr/ign/validator/io/XmlModelReader.java b/validator-core/src/main/java/fr/ign/validator/io/XmlModelReader.java deleted file mode 100644 index d38c4476..00000000 --- a/validator-core/src/main/java/fr/ign/validator/io/XmlModelReader.java +++ /dev/null @@ -1,71 +0,0 @@ -package fr.ign.validator.io; - -import java.io.IOException; -import java.io.InputStream; -import java.net.URL; - -import javax.xml.bind.JAXBContext; -import javax.xml.bind.JAXBException; -import javax.xml.bind.Unmarshaller; - -import fr.ign.validator.exception.InvalidModelException; -import fr.ign.validator.exception.ModelNotFoundException; -import fr.ign.validator.model.DocumentModel; -import fr.ign.validator.model.FeatureType; - -/** - * Load models using deprecated XML format - * - * @author MBorne - */ -public class XmlModelReader extends AbstractModelReader { - - private JAXBContext context; - private Unmarshaller unmarshaller; - - public XmlModelReader() { - log.trace(MARKER, "Initializing XmlModelReader..."); - try { - this.context = JAXBContext.newInstance(FeatureType.class, DocumentModel.class); - this.unmarshaller = context.createUnmarshaller(); - } catch (JAXBException e) { - throw new RuntimeException("fail to load JAXB context", e); - } - } - - @Override - public String getFormat() { - return "xml"; - } - - @Override - public DocumentModel loadDocumentModel(URL documentModelUrl) throws ModelNotFoundException, InvalidModelException { - log.info(MARKER, "Loading DocumentModel from {} ...", documentModelUrl); - - /* - * loading documentModel - */ - InputStream is = getInputStream(documentModelUrl); - try { - DocumentModel documentModel = (DocumentModel) unmarshaller.unmarshal(is); - loadFeatureTypes(documentModel, documentModelUrl); - return documentModel; - } catch (JAXBException | IOException e) { - String message = String.format("Fail to load FeatureType from %1s", documentModelUrl); - throw new InvalidModelException(message, e); - } - } - - @Override - public FeatureType loadFeatureType(URL featureTypeUrl) throws ModelNotFoundException, InvalidModelException { - log.info(MARKER, "loadFeatureType({}) ...", featureTypeUrl); - InputStream is = getInputStream(featureTypeUrl); - try { - return (FeatureType) unmarshaller.unmarshal(is); - } catch (JAXBException e) { - String message = String.format("Fail to load FeatureType from %1s", featureTypeUrl); - throw new InvalidModelException(message, e); - } - } - -} diff --git a/validator-core/src/main/java/fr/ign/validator/io/xml/AttributeTypeAdapter.java b/validator-core/src/main/java/fr/ign/validator/io/xml/AttributeTypeAdapter.java deleted file mode 100644 index 67c246e6..00000000 --- a/validator-core/src/main/java/fr/ign/validator/io/xml/AttributeTypeAdapter.java +++ /dev/null @@ -1,79 +0,0 @@ -package fr.ign.validator.io.xml; - -import java.util.List; - -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlElementWrapper; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.adapters.XmlAdapter; - -import fr.ign.validator.model.AttributeConstraints; -import fr.ign.validator.model.AttributeType; - -@XmlType(propOrder = { - "name", "type", "definition", "regexp", "size", "nullable", "listOfValues", "identifiant", "reference" -}) -public class AttributeTypeAdapter extends XmlAdapter> { - - /** - * Legacy XML format - * - * @author MBorne - */ - public static class AdaptedAttributeType { - public String name; - public String type; - public String definition; - public String regexp; - public Integer size; - public boolean nullable; - public boolean identifier; - public String reference; - @XmlElementWrapper(name = "listOfValues") - @XmlElement(name = "value") - public List listOfValues; - } - - @Override - public AdaptedAttributeType marshal(AttributeType attributeType) throws Exception { - if (null == attributeType) { - return null; - } - - AdaptedAttributeType adaptedAttributeType = new AdaptedAttributeType(); - adaptedAttributeType.name = attributeType.getName(); - adaptedAttributeType.type = attributeType.getTypeName(); - adaptedAttributeType.definition = attributeType.getDescription(); - - AttributeConstraints constraints = attributeType.getConstraints(); - adaptedAttributeType.nullable = !constraints.isRequired(); - adaptedAttributeType.identifier = constraints.isUnique(); - adaptedAttributeType.regexp = constraints.getPattern(); - adaptedAttributeType.size = constraints.getMaxLength(); - adaptedAttributeType.listOfValues = constraints.getEnumValues(); - adaptedAttributeType.reference = constraints.getReference(); - return adaptedAttributeType; - } - - @Override - public AttributeType unmarshal(AttributeTypeAdapter.AdaptedAttributeType adaptedValueType) throws Exception { - if (null == adaptedValueType) { - return null; - } - - AttributeType attributeType = AttributeType.forName(adaptedValueType.type); - attributeType.setName(adaptedValueType.name); - attributeType.setDescription(adaptedValueType.definition); - - AttributeConstraints constraints = attributeType.getConstraints(); - constraints.setRequired(!adaptedValueType.nullable); - constraints.setUnique(adaptedValueType.identifier); - constraints.setPattern(adaptedValueType.regexp); - constraints.setMaxLength(adaptedValueType.size); - constraints.getEnumValues(adaptedValueType.listOfValues); - constraints.setReference(adaptedValueType.reference); - - return attributeType; - } - -} diff --git a/validator-core/src/main/java/fr/ign/validator/io/xml/FileModelAdapter.java b/validator-core/src/main/java/fr/ign/validator/io/xml/FileModelAdapter.java deleted file mode 100644 index 2ddb8edb..00000000 --- a/validator-core/src/main/java/fr/ign/validator/io/xml/FileModelAdapter.java +++ /dev/null @@ -1,58 +0,0 @@ -package fr.ign.validator.io.xml; - -import javax.xml.bind.annotation.adapters.XmlAdapter; - -import fr.ign.validator.model.FileModel; -import fr.ign.validator.model.FileModelFactory; -import fr.ign.validator.model.FileModel.MandatoryMode; - -/** - * FileModel serialization adapter - * - * Note that "regexp" is renamed to "path" - * - * @author MBorne - * - */ -public class FileModelAdapter extends XmlAdapter { - - public static class AdaptedFileModel { - public String name; - public String type; - public String path; - public MandatoryMode mandatory = MandatoryMode.WARN; - } - - @Override - public FileModel unmarshal(AdaptedFileModel adaptedFileModel) throws Exception { - if (null == adaptedFileModel) { - return null; - } - FileModel fileModel = FileModelFactory.createFileModelByType(adaptedFileModel.type); - if (null == fileModel) { - throw new Exception( - String.format( - "attribut type invalide dans balise : {}", adaptedFileModel.type - ) - ); - } - fileModel.setName(adaptedFileModel.name); - fileModel.setPath(adaptedFileModel.path); - fileModel.setMandatory(adaptedFileModel.mandatory); - return fileModel; - } - - @Override - public AdaptedFileModel marshal(FileModel fileModel) throws Exception { - if (null == fileModel) { - return null; - } - AdaptedFileModel adaptedFileModel = new AdaptedFileModel(); - adaptedFileModel.type = fileModel.getType(); - adaptedFileModel.name = fileModel.getName(); - adaptedFileModel.path = fileModel.getPath(); - adaptedFileModel.mandatory = fileModel.getMandatory(); - return adaptedFileModel; - } - -} diff --git a/validator-core/src/main/java/fr/ign/validator/model/AttributeType.java b/validator-core/src/main/java/fr/ign/validator/model/AttributeType.java index 0805a8d5..c8ba3b29 100644 --- a/validator-core/src/main/java/fr/ign/validator/model/AttributeType.java +++ b/validator-core/src/main/java/fr/ign/validator/model/AttributeType.java @@ -4,7 +4,6 @@ import java.util.List; import javax.xml.bind.annotation.XmlTransient; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; @@ -12,7 +11,6 @@ import com.fasterxml.jackson.annotation.JsonInclude.Include; import fr.ign.validator.data.Attribute; -import fr.ign.validator.io.xml.AttributeTypeAdapter; import fr.ign.validator.validation.Validator; import fr.ign.validator.validation.attribute.AttributeRequiredValidator; import fr.ign.validator.validation.attribute.CharactersValidator; @@ -24,7 +22,6 @@ * * @param the matching java type */ -@XmlJavaTypeAdapter(AttributeTypeAdapter.class) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type") @JsonInclude(value = Include.NON_NULL) public abstract class AttributeType implements Model, Cloneable { diff --git a/validator-core/src/main/java/fr/ign/validator/model/AttributeTypeFactory.java b/validator-core/src/main/java/fr/ign/validator/model/AttributeTypeFactory.java index fc0def50..44e96ae1 100644 --- a/validator-core/src/main/java/fr/ign/validator/model/AttributeTypeFactory.java +++ b/validator-core/src/main/java/fr/ign/validator/model/AttributeTypeFactory.java @@ -10,7 +10,7 @@ * Prototype based factory providing AttributeType creation by name (Boolean, * Double, etc.) * - * @see src/main/resources/META-INF/services/fr.ign.validator.model.AttributeType + * @see src/main/resources/META-INF/services/fr.ign.validator.model.AttributeType containing the list of this types. * * @author MBorne * diff --git a/validator-core/src/main/java/fr/ign/validator/model/DocumentModel.java b/validator-core/src/main/java/fr/ign/validator/model/DocumentModel.java index 31af6852..773e1621 100644 --- a/validator-core/src/main/java/fr/ign/validator/model/DocumentModel.java +++ b/validator-core/src/main/java/fr/ign/validator/model/DocumentModel.java @@ -4,12 +4,6 @@ import java.util.ArrayList; import java.util.List; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlElementWrapper; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlTransient; -import javax.xml.bind.annotation.XmlType; - import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Marker; @@ -33,10 +27,6 @@ * * @author MBorne */ -@XmlRootElement(name = "document") -@XmlType(propOrder = { - "name", "regexp", "fileModels", "staticTables" -}) public class DocumentModel implements Model { public static final Logger log = LogManager.getRootLogger(); public static final Marker MARKER = MarkerManager.getMarker("DocumentModel"); @@ -103,7 +93,6 @@ public void setName(String name) { this.name = name; } - @XmlTransient public DocumentConstraints getConstraints() { return constraints; } @@ -132,8 +121,6 @@ public void setRegexp(String regexp) { this.constraints.setFolderName(regexp); } - @XmlElementWrapper(name = "files") - @XmlElement(name = "file") @JsonProperty("files") public List getFileModels() { return fileModels; diff --git a/validator-core/src/main/java/fr/ign/validator/model/FeatureType.java b/validator-core/src/main/java/fr/ign/validator/model/FeatureType.java index 5ea34eda..69782074 100644 --- a/validator-core/src/main/java/fr/ign/validator/model/FeatureType.java +++ b/validator-core/src/main/java/fr/ign/validator/model/FeatureType.java @@ -3,12 +3,6 @@ import java.util.ArrayList; import java.util.List; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlElementWrapper; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlTransient; -import javax.xml.bind.annotation.XmlType; - import com.fasterxml.jackson.annotation.JsonProperty; import fr.ign.validator.model.type.GeometryType; @@ -18,10 +12,6 @@ * * @author MBorne */ -@XmlRootElement -@XmlType(propOrder = { - "name", "description", "attributes", "constraints" -}) public class FeatureType implements Model { /** * Parent (optional) @@ -72,13 +62,11 @@ public FeatureType getParent() { * * @param featureType */ - @XmlTransient public void setParent(FeatureType parent) { this.parent = parent; } @Override - @XmlElement(name = "typeName") public String getName() { return name; } @@ -120,7 +108,6 @@ public String getDescription() { return description; } - @XmlElement public void setDescription(String description) { this.description = description; } @@ -136,8 +123,6 @@ public List> getAttributes() { return attributes; } - @XmlElementWrapper(name = "attributes") - @XmlElement(name = "attribute") @JsonProperty("columns") public void setAttributes(List> attributes) { this.attributes = attributes; diff --git a/validator-core/src/main/java/fr/ign/validator/model/FileModel.java b/validator-core/src/main/java/fr/ign/validator/model/FileModel.java index fddcba4e..f323ad36 100644 --- a/validator-core/src/main/java/fr/ign/validator/model/FileModel.java +++ b/validator-core/src/main/java/fr/ign/validator/model/FileModel.java @@ -7,10 +7,6 @@ import java.util.regex.Pattern; import java.util.regex.PatternSyntaxException; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlEnum; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; - import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Marker; @@ -24,7 +20,6 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import fr.ign.validator.data.DocumentFile; -import fr.ign.validator.io.xml.FileModelAdapter; import fr.ign.validator.model.file.DirectoryModel; import fr.ign.validator.model.file.MetadataModel; import fr.ign.validator.model.file.MultiTableModel; @@ -38,7 +33,6 @@ * * @author MBorne */ -@XmlJavaTypeAdapter(FileModelAdapter.class) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") @JsonSubTypes({ @Type(value = DirectoryModel.class, name = DirectoryModel.TYPE), @@ -51,7 +45,6 @@ public abstract class FileModel implements Model { public static final Logger log = LogManager.getRootLogger(); public static final Marker MARKER = MarkerManager.getMarker("FileModel"); - @XmlEnum(String.class) public enum MandatoryMode { /** * Ignore if file is missing @@ -129,7 +122,6 @@ public String getPath() { return path; } - @XmlElement(name = "regexp") public void setPath(String path) { this.path = path; } From c82cb61ecd2e53ee1c7a30f3cbb1bb0f24ec7ae3 Mon Sep 17 00:00:00 2001 From: MBorne Date: Thu, 8 Aug 2024 17:48:28 +0200 Subject: [PATCH 4/8] chore(deps): remove no more required JAXB dependency (refs #351) --- pom.xml | 20 ------------------- .../fr/ign/validator/model/AttributeType.java | 3 --- .../fr/ign/validator/model/StaticTable.java | 3 --- .../model/file/EmbeddedTableModel.java | 4 ---- .../validator/model/file/MultiTableModel.java | 5 ----- .../model/file/SingleTableModel.java | 3 --- .../fr/ign/validator/model/package-info.java | 6 ------ 7 files changed, 44 deletions(-) delete mode 100644 validator-core/src/main/java/fr/ign/validator/model/package-info.java diff --git a/pom.xml b/pom.xml index 1644f3e1..1a8c8d30 100644 --- a/pom.xml +++ b/pom.xml @@ -37,10 +37,6 @@ 1.8.0 1.11.0 2.6 - - 2.3.0.1 - 2.3.9 - 2.3.1 9.1-901-1.jdbc4 3.46.0.1 @@ -225,22 +221,6 @@ ${jaxen.version} - - - javax.xml.bind - jaxb-api - ${jaxb-api.version} - - - com.sun.xml.bind - jaxb-core - ${jaxb-core.version} - - - com.sun.xml.bind - jaxb-impl - ${jaxb-impl.version} - - 1.3.2 - 1.1.1 jacoco @@ -241,22 +238,6 @@ ${postgresql.version} - - - javax.annotation - javax.annotation-api - ${javax.annotation.version} - - - javax.activation - activation - ${javax.activation.version} - -