From 1264ea409626f04373adee6b7ae4f68c1794809c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nico=20P=C3=A9rez?= Date: Tue, 20 Aug 2024 15:36:44 +0200 Subject: [PATCH] tests(plsql): add new tests for some functions --- test/plsql/ud/test_gw_fct_config_mapzones.sql | 35 +++++ test/plsql/ud/test_gw_fct_getcatalog.sql | 12 +- .../ud/test_gw_fct_getcatfeaturevalues.sql | 27 ++++ test/plsql/ud/test_gw_fct_getconfig.sql | 37 +++++ test/plsql/ud/test_gw_fct_getdimensioning.sql | 28 ++++ .../ud/test_gw_fct_getfeaturerelation.sql | 27 ++++ test/plsql/ud/test_gw_fct_getinfofromid.sql | 24 ++-- test/plsql/ud/test_gw_fct_getlist.sql | 31 +++- test/plsql/ud/test_gw_fct_getprint.sql | 27 ++++ test/plsql/ud/test_gw_fct_getprocess.sql | 35 +++++ test/plsql/ud/test_gw_fct_getprofile.sql | 27 ++++ .../plsql/ud/test_gw_fct_getprofilevalues.sql | 27 ++++ test/plsql/ud/test_gw_fct_getreport.sql | 29 ++++ test/plsql/ud/test_gw_fct_getsearch.sql | 27 ++++ test/plsql/ud/test_gw_fct_getselectors.sql | 42 ++++++ test/plsql/ud/test_gw_fct_gettoolbox.sql | 27 ++++ .../test_gw_fct_graphanalytics_downstream.sql | 12 +- test/plsql/ud/test_gw_fct_setarcdivide.sql | 13 +- .../ud/test_gw_fct_setchangefeaturetype.sql | 28 ++++ test/plsql/ud/test_gw_fct_setcheckproject.sql | 74 ++++++++++ test/plsql/ud/test_gw_fct_setconfig.sql | 35 +++++ test/plsql/ud/test_gw_fct_setdimensioning.sql | 28 ++++ test/plsql/ud/test_gw_fct_setendfeature.sql | 28 ++++ .../plsql/ud/test_gw_fct_setfeaturedelete.sql | 27 ++++ test/plsql/ud/test_gw_fct_setfields.sql | 8 ++ test/plsql/ud/test_gw_fct_setprint.sql | 31 ++++ test/plsql/ud/test_gw_fct_setprofile.sql | 28 ++++ test/plsql/ud/test_gw_fct_setsearch.sql | 50 +++++++ test/plsql/ud/test_gw_fct_setsearchadd.sql | 28 ++++ test/plsql/ud/test_gw_fct_setselectors.sql | 84 +++++++++++ test/plsql/ud/test_gw_fct_upsertfields.sql | 35 +++++ .../plsql/ud/test_gw_fct_workspacemanager.sql | 27 ++++ test/plsql/ws/test_gw_fct_config_mapzones.sql | 27 ++++ test/plsql/ws/test_gw_fct_getcatalog.sql | 15 +- test/plsql/ws/test_gw_fct_getcheckdelete.sql | 27 ++++ test/plsql/ws/test_gw_fct_getconfig.sql | 42 ++++++ test/plsql/ws/test_gw_fct_getdimensioning.sql | 28 ++++ test/plsql/ws/test_gw_fct_getfeaturegeom.sql | 27 ++++ .../ws/test_gw_fct_getfeaturerelation.sql | 27 ++++ test/plsql/ws/test_gw_fct_getgraphconfig.sql | 27 ++++ test/plsql/ws/test_gw_fct_getinfofromid.sql | 12 +- test/plsql/ws/test_gw_fct_getlist.sql | 30 +++- test/plsql/ws/test_gw_fct_getprocess.sql | 27 ++++ test/plsql/ws/test_gw_fct_getsearch.sql | 27 ++++ test/plsql/ws/test_gw_fct_getselectors.sql | 41 ++++++ test/plsql/ws/test_gw_fct_gettypeahead.sql | 28 ++++ test/plsql/ws/test_gw_fct_getwidgetprices.sql | 27 ++++ test/plsql/ws/test_gw_fct_setarcdivide.sql | 13 +- .../ws/test_gw_fct_setchangefeaturetype.sql | 28 ++++ test/plsql/ws/test_gw_fct_setconfig.sql | 34 +++++ test/plsql/ws/test_gw_fct_setdelete.sql | 27 ++++ test/plsql/ws/test_gw_fct_setdimensioning.sql | 28 ++++ test/plsql/ws/test_gw_fct_setendfeature.sql | 28 ++++ .../plsql/ws/test_gw_fct_setfeaturedelete.sql | 27 ++++ .../plsql/ws/test_gw_fct_setlinktonetwork.sql | 11 +- test/plsql/ws/test_gw_fct_setsearch.sql | 65 +++++++++ test/plsql/ws/test_gw_fct_setselectors.sql | 136 ++++++++++++++++++ test/plsql/ws/test_gw_fct_upsertfields.sql | 37 +++++ .../plsql/ws/test_gw_fct_workspacemanager.sql | 27 ++++ 59 files changed, 1833 insertions(+), 38 deletions(-) create mode 100644 test/plsql/ud/test_gw_fct_config_mapzones.sql create mode 100644 test/plsql/ud/test_gw_fct_getcatfeaturevalues.sql create mode 100644 test/plsql/ud/test_gw_fct_getconfig.sql create mode 100644 test/plsql/ud/test_gw_fct_getdimensioning.sql create mode 100644 test/plsql/ud/test_gw_fct_getfeaturerelation.sql create mode 100644 test/plsql/ud/test_gw_fct_getprint.sql create mode 100644 test/plsql/ud/test_gw_fct_getprocess.sql create mode 100644 test/plsql/ud/test_gw_fct_getprofile.sql create mode 100644 test/plsql/ud/test_gw_fct_getprofilevalues.sql create mode 100644 test/plsql/ud/test_gw_fct_getreport.sql create mode 100644 test/plsql/ud/test_gw_fct_getsearch.sql create mode 100644 test/plsql/ud/test_gw_fct_getselectors.sql create mode 100644 test/plsql/ud/test_gw_fct_gettoolbox.sql create mode 100644 test/plsql/ud/test_gw_fct_setchangefeaturetype.sql create mode 100644 test/plsql/ud/test_gw_fct_setcheckproject.sql create mode 100644 test/plsql/ud/test_gw_fct_setconfig.sql create mode 100644 test/plsql/ud/test_gw_fct_setdimensioning.sql create mode 100644 test/plsql/ud/test_gw_fct_setendfeature.sql create mode 100644 test/plsql/ud/test_gw_fct_setfeaturedelete.sql create mode 100644 test/plsql/ud/test_gw_fct_setprint.sql create mode 100644 test/plsql/ud/test_gw_fct_setprofile.sql create mode 100644 test/plsql/ud/test_gw_fct_setsearch.sql create mode 100644 test/plsql/ud/test_gw_fct_setsearchadd.sql create mode 100644 test/plsql/ud/test_gw_fct_setselectors.sql create mode 100644 test/plsql/ud/test_gw_fct_upsertfields.sql create mode 100644 test/plsql/ud/test_gw_fct_workspacemanager.sql create mode 100644 test/plsql/ws/test_gw_fct_config_mapzones.sql create mode 100644 test/plsql/ws/test_gw_fct_getcheckdelete.sql create mode 100644 test/plsql/ws/test_gw_fct_getconfig.sql create mode 100644 test/plsql/ws/test_gw_fct_getdimensioning.sql create mode 100644 test/plsql/ws/test_gw_fct_getfeaturegeom.sql create mode 100644 test/plsql/ws/test_gw_fct_getfeaturerelation.sql create mode 100644 test/plsql/ws/test_gw_fct_getgraphconfig.sql create mode 100644 test/plsql/ws/test_gw_fct_getprocess.sql create mode 100644 test/plsql/ws/test_gw_fct_getsearch.sql create mode 100644 test/plsql/ws/test_gw_fct_getselectors.sql create mode 100644 test/plsql/ws/test_gw_fct_gettypeahead.sql create mode 100644 test/plsql/ws/test_gw_fct_getwidgetprices.sql create mode 100644 test/plsql/ws/test_gw_fct_setchangefeaturetype.sql create mode 100644 test/plsql/ws/test_gw_fct_setconfig.sql create mode 100644 test/plsql/ws/test_gw_fct_setdelete.sql create mode 100644 test/plsql/ws/test_gw_fct_setdimensioning.sql create mode 100644 test/plsql/ws/test_gw_fct_setendfeature.sql create mode 100644 test/plsql/ws/test_gw_fct_setfeaturedelete.sql create mode 100644 test/plsql/ws/test_gw_fct_setsearch.sql create mode 100644 test/plsql/ws/test_gw_fct_setselectors.sql create mode 100644 test/plsql/ws/test_gw_fct_upsertfields.sql create mode 100644 test/plsql/ws/test_gw_fct_workspacemanager.sql diff --git a/test/plsql/ud/test_gw_fct_config_mapzones.sql b/test/plsql/ud/test_gw_fct_config_mapzones.sql new file mode 100644 index 0000000000..6c6ecd4a9a --- /dev/null +++ b/test/plsql/ud/test_gw_fct_config_mapzones.sql @@ -0,0 +1,35 @@ +/* +This file is part of Giswater 3 +The program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +This version of Giswater is provided by Giswater Association +*/ +BEGIN; + +-- Suppress NOTICE messages +SET client_min_messages TO WARNING; + +SET search_path = "SCHEMA_NAME", public, pg_catalog; + +-- Plan for 2 test +SELECT plan(2); + +-- Extract and test the "status" field from the function's JSON response +SELECT is ( + (gw_fct_getprofile($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{}, "feature":{}, + "data":{"filterFields":{}, "pageInfo":{}}}$$)::JSON)->>'status', + 'Accepted', + 'Check if gw_fct_getprofile returns status "Accepted"' +); + +SELECT is ( + (gw_fct_config_mapzones($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{}, "feature":{}, + "data":{"filterFields":{}, "pageInfo":{}, "parameters": {"action": "UPDATE", "configZone": "drainzone", + "mapzoneId": "-1", "config": {"use":[{"nodeParent":""}], "ignore":[], "forceClosed":[]}}}}$$)::JSON)->>'status', + 'Accepted', + 'Check if gw_fct_getprofile with parameters returns status "Accepted"' +); + +-- Finish the test +SELECT finish(); + +ROLLBACK; \ No newline at end of file diff --git a/test/plsql/ud/test_gw_fct_getcatalog.sql b/test/plsql/ud/test_gw_fct_getcatalog.sql index 69794382df..00bb963f86 100644 --- a/test/plsql/ud/test_gw_fct_getcatalog.sql +++ b/test/plsql/ud/test_gw_fct_getcatalog.sql @@ -19,10 +19,18 @@ SELECT is ( "tabName":"data", "editable":"TRUE"}, "feature":{"feature_type":"CONDUIT"}, "data":{"filterFields":{}, "pageInfo":{}, "fields":{"matcat_id":"", "shape":"", "geom1":""}}}$$)::JSON)->>'status', 'Accepted', - 'Check if gw_fct_getcatalog returns status "Accepted"' + 'Check if gw_fct_getcatalog --> "feature_type":"CONDUIT" returns status "Accepted"' +); + +SELECT is ( + (gw_fct_getcatalog($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{"formName":"upsert_catalog_node", + "tabName":"data", "editable":"TRUE"}, "feature":{"feature_type":"CIRC_MANHOLE"}, "data":{"filterFields":{}, "pageInfo":{}, + "fields":{"matcat_id":"", "shape":"", "geom1":""}}}$$)::JSON)->>'status', + 'Accepted', + 'Check if gw_fct_getcatalog --> "feature_type":"CIRC_MANHOLE" returns status "Accepted"' ); -- Finish the test SELECT finish(); -ROLLBACK; +ROLLBACK; \ No newline at end of file diff --git a/test/plsql/ud/test_gw_fct_getcatfeaturevalues.sql b/test/plsql/ud/test_gw_fct_getcatfeaturevalues.sql new file mode 100644 index 0000000000..883814236f --- /dev/null +++ b/test/plsql/ud/test_gw_fct_getcatfeaturevalues.sql @@ -0,0 +1,27 @@ +/* +This file is part of Giswater 3 +The program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +This version of Giswater is provided by Giswater Association +*/ +BEGIN; + +-- Suppress NOTICE messages +SET client_min_messages TO WARNING; + +SET search_path = "SCHEMA_NAME", public, pg_catalog; + +-- Plan for 1 test +SELECT plan(1); + +-- Extract and test the "status" field from the function's JSON response +SELECT is ( + (gw_fct_getcatfeaturevalues($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{}, + "feature":{}, "data":{"filterFields":{}, "pageInfo":{}}}$$)::JSON)->>'status', + 'Accepted', + 'Check if gw_fct_getcatfeaturevalues returns status "Accepted"' +); + +-- Finish the test +SELECT finish(); + +ROLLBACK; diff --git a/test/plsql/ud/test_gw_fct_getconfig.sql b/test/plsql/ud/test_gw_fct_getconfig.sql new file mode 100644 index 0000000000..108ad4550a --- /dev/null +++ b/test/plsql/ud/test_gw_fct_getconfig.sql @@ -0,0 +1,37 @@ +/* +This file is part of Giswater 3 +The program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +This version of Giswater is provided by Giswater Association +*/ +BEGIN; + +-- Suppress NOTICE messages +SET client_min_messages TO WARNING; + +SET search_path = "SCHEMA_NAME", public, pg_catalog; + +-- Plan for 2 test +SELECT plan(2); + +-- Extract and test the "status" field from the function's JSON response +SELECT is ( + (gw_fct_getconfig($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{"formName":"epaoptions"}, + "feature":{}, "data":{"filterFields":{}, "pageInfo":{}}}$$)::JSON)->>'status', + 'Accepted', + 'Check if gw_fct_getconfig --> "formName":"epaoptions" returns status "Accepted"' +); + +SELECT is ( + (gw_fct_getconfig($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{"formName":"config"}, + "feature":{}, "data":{"filterFields":{}, "pageInfo":{}, "list_layers_name":"{Node, Connec, Gully, Arc, Link, Node polygon, + Gully polygon, Connec polygon, Dimensioning, Element, Municipality, Streetaxis, Plot}", "list_tables_name":"{v_edit_node, + v_edit_connec, v_edit_gully, v_edit_arc, v_edit_link, ve_pol_node, ve_pol_gully, ve_pol_connec, v_edit_dimensions, v_edit_element, + ext_municipality, v_ext_streetaxis, v_ext_plot}"}}$$)::JSON)->>'status', + 'Accepted', + 'Check if gw_fct_getconfig --> "formName":"config" returns status "Accepted"' +); + +-- Finish the test +SELECT finish(); + +ROLLBACK; \ No newline at end of file diff --git a/test/plsql/ud/test_gw_fct_getdimensioning.sql b/test/plsql/ud/test_gw_fct_getdimensioning.sql new file mode 100644 index 0000000000..e7bbb6c652 --- /dev/null +++ b/test/plsql/ud/test_gw_fct_getdimensioning.sql @@ -0,0 +1,28 @@ +/* +This file is part of Giswater 3 +The program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +This version of Giswater is provided by Giswater Association +*/ +BEGIN; + +-- Suppress NOTICE messages +SET client_min_messages TO WARNING; + +SET search_path = "SCHEMA_NAME", public, pg_catalog; + +-- Plan for 1 test +SELECT plan(1); + +-- Extract and test the "status" field from the function's JSON response +SELECT is ( + (gw_fct_getdimensioning($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{}, "feature":{}, + "data":{"filterFields":{}, "pageInfo":{}, "coordinates":{"x1":418858.6453457861, "y1":4576610.154527264, "x2":418864.97096759855, + "y2":4576605.676899829}}}$$)::JSON)->>'status', + 'Accepted', + 'Check if gw_fct_getdimensioning returns status "Accepted"' +); + +-- Finish the test +SELECT finish(); + +ROLLBACK; \ No newline at end of file diff --git a/test/plsql/ud/test_gw_fct_getfeaturerelation.sql b/test/plsql/ud/test_gw_fct_getfeaturerelation.sql new file mode 100644 index 0000000000..71f0d9f236 --- /dev/null +++ b/test/plsql/ud/test_gw_fct_getfeaturerelation.sql @@ -0,0 +1,27 @@ +/* +This file is part of Giswater 3 +The program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +This version of Giswater is provided by Giswater Association +*/ +BEGIN; + +-- Suppress NOTICE messages +SET client_min_messages TO WARNING; + +SET search_path = "SCHEMA_NAME", public, pg_catalog; + +-- Plan for 1 test +SELECT plan(1); + +-- Extract and test the "status" field from the function's JSON response +SELECT is ( + (gw_fct_getfeaturerelation($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{}, "feature":{"type":"ARC"}, + "data":{"filterFields":{}, "pageInfo":{}, "feature_id":"160"}}$$)::JSON)->>'status', + 'Accepted', + 'Check if gw_fct_getfeaturerelation returns status "Accepted"' +); + +-- Finish the test +SELECT finish(); + +ROLLBACK; \ No newline at end of file diff --git a/test/plsql/ud/test_gw_fct_getinfofromid.sql b/test/plsql/ud/test_gw_fct_getinfofromid.sql index ef2e25b832..0d39732a98 100644 --- a/test/plsql/ud/test_gw_fct_getinfofromid.sql +++ b/test/plsql/ud/test_gw_fct_getinfofromid.sql @@ -10,47 +10,51 @@ SET client_min_messages TO WARNING; SET search_path = "SCHEMA_NAME", public, pg_catalog; -SELECT plan(1); -SELECT ok(1=1, 'One equals one'); - -- TODO: Add test for gw_fct_getinfofromid --- -- Plan for 1 test --- SELECT plan(5); +-- -- Plan for 6 test +-- SELECT plan(6); -- -- Extract and test the "status" field from the function's JSON response -- SELECT is( -- (gw_fct_getinfofromid($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{}, -- "feature":{"tableName":"v_edit_node", "id":"89"}, "data":{"filterFields":{}, "pageInfo":{}, "addSchema":""}}$$)::JSON)->>'status', -- 'Accepted', --- 'Check if gw_fct_getinfofromid returns status "Accepted"' +-- 'Check if gw_fct_getinfofromid tableName --> v_edit_node returns status "Accepted"' -- ); -- SELECT is( -- (gw_fct_getinfofromid($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{}, -- "feature":{"tableName":"v_edit_connec", "id":"3149"}, "data":{"filterFields":{}, "pageInfo":{}, "addSchema":""}}$$)::JSON)->>'status', -- 'Accepted', --- 'Check if gw_fct_getinfofromid returns status "Accepted"' +-- 'Check if gw_fct_getinfofromid tableName --> v_edit_connec returns status "Accepted"' -- ); -- SELECT is( -- (gw_fct_getinfofromid($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{}, -- "feature":{"tableName":"v_edit_gully", "id":"30087"}, "data":{"filterFields":{}, "pageInfo":{}, "addSchema":""}}$$)::JSON)->>'status', -- 'Accepted', --- 'Check if gw_fct_getinfofromid returns status "Accepted"' +-- 'Check if gw_fct_getinfofromid tableName --> v_edit_gully returns status "Accepted"' -- ); -- SELECT is( -- (gw_fct_getinfofromid($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{}, -- "feature":{"tableName":"v_edit_arc", "id":"204"}, "data":{"filterFields":{}, "pageInfo":{}, "addSchema":""}}$$)::JSON)->>'status', -- 'Accepted', --- 'Check if gw_fct_getinfofromid returns status "Accepted"' +-- 'Check if gw_fct_getinfofromid tableName --> v_edit_arc returns status "Accepted"' -- ); -- SELECT is( -- (gw_fct_getinfofromid($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{}, -- "feature":{"tableName":"v_edit_link", "id":"550"}, "data":{"filterFields":{}, "pageInfo":{}, "addSchema":""}}$$)::JSON)->>'status', -- 'Accepted', --- 'Check if gw_fct_getinfofromid returns status "Accepted"' +-- 'Check if gw_fct_getinfofromid tableName --> v_edit_link returns status "Accepted"' +-- ); + +-- SELECT is( +-- (gw_fct_getinfofromid($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{}, +-- "feature":{"tableName":"v_edit_drainzone", "id": "0"}, "data":{"filterFields":{}, "pageInfo":{}}}$$)::JSON)->>'status', +-- 'Accepted', +-- 'Check if gw_fct_getinfofromid tableName --> v_edit_drainzone returns status "Accepted"' -- ); -- Finish the test diff --git a/test/plsql/ud/test_gw_fct_getlist.sql b/test/plsql/ud/test_gw_fct_getlist.sql index a4d0018d89..5607fb1e5c 100644 --- a/test/plsql/ud/test_gw_fct_getlist.sql +++ b/test/plsql/ud/test_gw_fct_getlist.sql @@ -10,8 +10,8 @@ SET client_min_messages TO WARNING; SET search_path = "SCHEMA_NAME", public, pg_catalog; --- Plan for 5 test -SELECT plan(5); +-- Plan for 7 test +SELECT plan(7); -- Extract and test the "status" field from the function's JSON response SELECT is ( @@ -19,7 +19,7 @@ SELECT is ( "widgetname":"tab_epa_tbl_inp_junction", "formtype":"form_feature"}, "feature":{"tableName":"tbl_inp_dscenario_junction", "idName":"node_id", "id":"74"}, "data":{"filterFields":{"node_id":{"value":"74","filterSign":"="}}, "pageInfo":{}}}$$)::JSON)->>'status', 'Accepted', - 'Check if gw_fct_getlist returns status "Accepted"' + 'Check if gw_fct_getlist --> "tableName":"tbl_inp_dscenario_junction" returns status "Accepted"' ); SELECT is ( @@ -27,7 +27,7 @@ SELECT is ( "widgetname":"tab_connections_tbl_downstream", "formtype":"form_feature"}, "feature":{"tableName":"tbl_connection_downstream", "idName":"node_id", "id":"74"}, "data":{"filterFields":{"node_id":{"value":"74","filterSign":"="}}, "pageInfo":{}}}$$)::JSON)->>'status', 'Accepted', - 'Check if gw_fct_getlist returns status "Accepted"' + 'Check if gw_fct_getlist --> "tableName":"tbl_connection_downstream" returns status "Accepted"' ); SELECT is ( @@ -35,7 +35,7 @@ SELECT is ( "widgetname":"tab_elements_tbl_elements", "formtype":"form_feature"}, "feature":{"tableName":"tbl_element_x_node", "idName":"node_id", "id":"74"}, "data":{"filterFields":{"node_id":{"value":"74","filterSign":"="}}, "pageInfo":{}}}$$)::JSON)->>'status', 'Accepted', - 'Check if gw_fct_getlist returns status "Accepted"' + 'Check if gw_fct_getlist --> "tableName":"tbl_element_x_node" returns status "Accepted"' ); SELECT is ( @@ -43,7 +43,7 @@ SELECT is ( "widgetname":"tab_event_tbl_event_cf", "formtype":"form_feature"}, "feature":{"tableName":"tbl_event_x_node", "idName":"node_id", "id":"74"}, "data":{"filterFields":{"node_id":{"value":"74","filterSign":"="}}, "pageInfo":{}}}$$)::JSON)->>'status', 'Accepted', - 'Check if gw_fct_getlist returns status "Accepted"' + 'Check if gw_fct_getlist --> "tableName":"tbl_event_x_node" returns status "Accepted"' ); SELECT is ( @@ -51,9 +51,26 @@ SELECT is ( "widgetname":"tab_documents_tbl_documents", "formtype":"form_feature"}, "feature":{"tableName":"tbl_doc_x_node", "idName":"node_id", "id":"74"}, "data":{"filterFields":{"node_id":{"value":"74","filterSign":"="}}, "pageInfo":{}}}$$)::JSON)->>'status', 'Accepted', - 'Check if gw_fct_getlist returns status "Accepted"' + 'Check if gw_fct_getlist --> "tableName":"tbl_doc_x_node" returns status "Accepted"' ); +SELECT is ( + (gw_fct_getlist($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{}, + "feature":{"tableName":"v_edit_cat_hydrology"}, "data":{"filterFields":{"limit": -1, "name": + {"filterSign":"ILIKE", "value":""}, "active": {"filterSign":"=", "value":"true"}}, "pageInfo":{}}}$$)::JSON)->>'status', + 'Accepted', + 'Check if gw_fct_getlist --> "tableName":"v_edit_cat_hydrology" returns status "Accepted"' +); + +SELECT is ( + (gw_fct_getlist($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{}, "feature":{"tableName":"cat_work"}, + "data":{"filterFields":{"limit": -1, "id": {"filterSign":"ILIKE", "value":""}}, "pageInfo":{}}}$$)::JSON)->>'status', + 'Accepted', + 'Check if gw_fct_getlist --> "tableName":"cat_work" returns status "Accepted"' +); + + + -- Finish the test SELECT finish(); diff --git a/test/plsql/ud/test_gw_fct_getprint.sql b/test/plsql/ud/test_gw_fct_getprint.sql new file mode 100644 index 0000000000..73dc2959e6 --- /dev/null +++ b/test/plsql/ud/test_gw_fct_getprint.sql @@ -0,0 +1,27 @@ +/* +This file is part of Giswater 3 +The program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +This version of Giswater is provided by Giswater Association +*/ +BEGIN; + +-- Suppress NOTICE messages +SET client_min_messages TO WARNING; + +SET search_path = "SCHEMA_NAME", public, pg_catalog; + +-- Plan for 1 test +SELECT plan(1); + +-- Extract and test the "status" field from the function's JSON response +SELECT is ( + (gw_fct_getprint($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{}, "feature":{}, + "data":{"filterFields":{}, "pageInfo":{}, "composers":"{composer_plan}"}}$$)::JSON)->>'status', + 'Accepted', + 'Check if gw_fct_getprint returns status "Accepted"' +); + +-- Finish the test +SELECT finish(); + +ROLLBACK; \ No newline at end of file diff --git a/test/plsql/ud/test_gw_fct_getprocess.sql b/test/plsql/ud/test_gw_fct_getprocess.sql new file mode 100644 index 0000000000..26388c5264 --- /dev/null +++ b/test/plsql/ud/test_gw_fct_getprocess.sql @@ -0,0 +1,35 @@ +/* +This file is part of Giswater 3 +The program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +This version of Giswater is provided by Giswater Association +*/ +BEGIN; + +-- Suppress NOTICE messages +SET client_min_messages TO WARNING; + +SET search_path = "SCHEMA_NAME", public, pg_catalog; + +-- Plan for 1 test +SELECT plan(1); + +-- Extract and test the "status" field from the function's JSON response +SELECT is ( + (gw_fct_getprocess($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{}, + "feature":{}, "data":{"filterFields":{}, "pageInfo":{}, "functionId":3100}}$$)::JSON)->>'status', + 'Accepted', + 'Check if gw_fct_getprocess --> "functionId":3100 returns status "Accepted"' +); + +SELECT is ( + (gw_fct_getprocess($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{}, + "feature":{}, "data":{"filterFields":{}, "pageInfo":{}, "functionId":"2670"}}$$)::JSON)->>'status', + 'Accepted', + 'Check if gw_fct_getprocess --> "functionId":"2670" returns status "Accepted"' +); + + +-- Finish the test +SELECT finish(); + +ROLLBACK; \ No newline at end of file diff --git a/test/plsql/ud/test_gw_fct_getprofile.sql b/test/plsql/ud/test_gw_fct_getprofile.sql new file mode 100644 index 0000000000..5221666ff6 --- /dev/null +++ b/test/plsql/ud/test_gw_fct_getprofile.sql @@ -0,0 +1,27 @@ +/* +This file is part of Giswater 3 +The program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +This version of Giswater is provided by Giswater Association +*/ +BEGIN; + +-- Suppress NOTICE messages +SET client_min_messages TO WARNING; + +SET search_path = "SCHEMA_NAME", public, pg_catalog; + +-- Plan for 1 test +SELECT plan(1); + +-- Extract and test the "status" field from the function's JSON response +SELECT is ( + (gw_fct_getprofile($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{}, "feature":{}, + "data":{"filterFields":{}, "pageInfo":{}}}$$)::JSON)->>'status', + 'Accepted', + 'Check if gw_fct_getprofile returns status "Accepted"' +); + +-- Finish the test +SELECT finish(); + +ROLLBACK; \ No newline at end of file diff --git a/test/plsql/ud/test_gw_fct_getprofilevalues.sql b/test/plsql/ud/test_gw_fct_getprofilevalues.sql new file mode 100644 index 0000000000..f61a92edac --- /dev/null +++ b/test/plsql/ud/test_gw_fct_getprofilevalues.sql @@ -0,0 +1,27 @@ +/* +This file is part of Giswater 3 +The program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +This version of Giswater is provided by Giswater Association +*/ +BEGIN; + +-- Suppress NOTICE messages +SET client_min_messages TO WARNING; + +SET search_path = "SCHEMA_NAME", public, pg_catalog; + +-- Plan for 1 test +SELECT plan(1); + +-- Extract and test the "status" field from the function's JSON response +SELECT is ( + (gw_fct_getprofilevalues($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{}, "feature":{}, + "data":{"filterFields":{}, "pageInfo":{}, "initNode":"64", "endNode":"37"}}$$)::JSON)->>'status', + 'Accepted', + 'Check if gw_fct_getprofilevalues returns status "Accepted"' +); + +-- Finish the test +SELECT finish(); + +ROLLBACK; \ No newline at end of file diff --git a/test/plsql/ud/test_gw_fct_getreport.sql b/test/plsql/ud/test_gw_fct_getreport.sql new file mode 100644 index 0000000000..118983e097 --- /dev/null +++ b/test/plsql/ud/test_gw_fct_getreport.sql @@ -0,0 +1,29 @@ +/* +This file is part of Giswater 3 +The program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +This version of Giswater is provided by Giswater Association +*/ +BEGIN; + +-- Suppress NOTICE messages +SET client_min_messages TO WARNING; + +SET search_path = "SCHEMA_NAME", public, pg_catalog; + +-- Plan for 1 test +SELECT plan(1); + +-- Extract and test the "status" field from the function's JSON response +SELECT is ( + (gw_fct_getreport($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{}, "feature":{}, + "data":{"filterFields":{}, "pageInfo":{}, "filter":[{"filterName": "Exploitation", "filterValue": "", "filterSign": "="}, + {"filterName": "Arc Catalog", "filterValue": "", "filterSign": "="}], "listId":"100"}}$$)::JSON)->>'status', + 'Accepted', + 'Check if gw_fct_getreport returns status "Accepted"' +); + + +-- Finish the test +SELECT finish(); + +ROLLBACK; \ No newline at end of file diff --git a/test/plsql/ud/test_gw_fct_getsearch.sql b/test/plsql/ud/test_gw_fct_getsearch.sql new file mode 100644 index 0000000000..1a6cdbfedf --- /dev/null +++ b/test/plsql/ud/test_gw_fct_getsearch.sql @@ -0,0 +1,27 @@ +/* +This file is part of Giswater 3 +The program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +This version of Giswater is provided by Giswater Association +*/ +BEGIN; + +-- Suppress NOTICE messages +SET client_min_messages TO WARNING; + +SET search_path = "SCHEMA_NAME", public, pg_catalog; + +-- Plan for 1 test +SELECT plan(1); + +-- Extract and test the "status" field from the function's JSON response +SELECT is ( + (gw_fct_getsearch($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{}, "feature":{}, + "data":{"filterFields":{}, "pageInfo":{}, "addSchema":"NULL"}}$$)::JSON)->>'status', + 'Accepted', + 'Check if gw_fct_getsearch returns status "Accepted"' +); + +-- Finish the test +SELECT finish(); + +ROLLBACK; \ No newline at end of file diff --git a/test/plsql/ud/test_gw_fct_getselectors.sql b/test/plsql/ud/test_gw_fct_getselectors.sql new file mode 100644 index 0000000000..b908206d2d --- /dev/null +++ b/test/plsql/ud/test_gw_fct_getselectors.sql @@ -0,0 +1,42 @@ +/* +This file is part of Giswater 3 +The program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +This version of Giswater is provided by Giswater Association +*/ +BEGIN; + +-- Suppress NOTICE messages +SET client_min_messages TO WARNING; + +SET search_path = "SCHEMA_NAME", public, pg_catalog; + +-- Plan for 2 test +SELECT plan(2); + +-- Extract and test the "status" field from the function's JSON response +SELECT is ( + (gw_fct_getselectors($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{"currentTab":"tab_psector"}, + "feature":{}, "data":{"filterFields":{}, "pageInfo":{}, "selectorType":"selector_basic", "filterText":"", "addSchema":"NULL"}}$$)::JSON)->>'status', + 'Accepted', + 'Check if gw_fct_getselectors --> "currentTab":"tab_psector" returns status "Accepted"' +); + +SELECT is ( + (gw_fct_getselectors($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{"currentTab":"tab_dscenario"}, + "feature":{}, "data":{"filterFields":{}, "pageInfo":{}, "selectorType":"selector_basic", "filterText":"", "addSchema":"NULL"}}$$)::JSON)->>'status', + 'Accepted', + 'Check if gw_fct_getselectors --> "currentTab":"tab_dscenario" returns status "Accepted"' +); + +SELECT is ( + (gw_fct_getselectors($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{"currentTab":"None"}, "feature":{}, + "data":{"filterFields":{}, "pageInfo":{}, "selectorType":"selector_basic", "filterText":""}}$$)::JSON)->>'status', + 'Accepted', + 'Check if gw_fct_getselectors --> "currentTab":"None" returns status "Accepted"' +); + + +-- Finish the test +SELECT finish(); + +ROLLBACK; \ No newline at end of file diff --git a/test/plsql/ud/test_gw_fct_gettoolbox.sql b/test/plsql/ud/test_gw_fct_gettoolbox.sql new file mode 100644 index 0000000000..c587068ce0 --- /dev/null +++ b/test/plsql/ud/test_gw_fct_gettoolbox.sql @@ -0,0 +1,27 @@ +/* +This file is part of Giswater 3 +The program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +This version of Giswater is provided by Giswater Association +*/ +BEGIN; + +-- Suppress NOTICE messages +SET client_min_messages TO WARNING; + +SET search_path = "SCHEMA_NAME", public, pg_catalog; + +-- Plan for 1 test +SELECT plan(1); + +-- Extract and test the "status" field from the function's JSON response +SELECT is ( + (gw_fct_gettoolbox($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{}, + "feature":{}, "data":{"filterFields":{}, "pageInfo":{}, "isToolbox":true}}$$)::JSON)->>'status', + 'Accepted', + 'Check if gw_fct_gettoolbox --> returns status "Accepted"' +); + +-- Finish the test +SELECT finish(); + +ROLLBACK; \ No newline at end of file diff --git a/test/plsql/ud/test_gw_fct_graphanalytics_downstream.sql b/test/plsql/ud/test_gw_fct_graphanalytics_downstream.sql index 09d7c45a14..7409844385 100644 --- a/test/plsql/ud/test_gw_fct_graphanalytics_downstream.sql +++ b/test/plsql/ud/test_gw_fct_graphanalytics_downstream.sql @@ -10,7 +10,8 @@ SET client_min_messages TO WARNING; SET search_path = "SCHEMA_NAME", public, pg_catalog; -SELECT plan(2); +-- Plan for 3 test +SELECT plan(3); SELECT is ( (gw_fct_graphanalytics_downstream($${"client":{"device":4, "infoType":1, "lang":"ES"}, @@ -27,6 +28,15 @@ SELECT is ( 'Check if gw_fct_graphanalytics_downstream with coordinates returns status "Accepted"' ); +SELECT is ( + (gw_fct_graphanalytics_downstream($${"client":{"device":4, "lang":"es_ES", "infoType":1, + "epsg":25831}, "form":{}, "feature":{"id":[38]}, "data":{"filterFields":{}, "pageInfo":{}, + "coordinates":{"xcoord":419164.5943072313,"ycoord":4576631.247667303, + "zoomRatio":585.5045021272166}}}$$)::JSON)->>'status', + 'Accepted', + 'Check if gw_fct_graphanalytics_downstream with coordinates and epsg returns status "Accepted"' +); + -- Finish the test SELECT finish(); diff --git a/test/plsql/ud/test_gw_fct_setarcdivide.sql b/test/plsql/ud/test_gw_fct_setarcdivide.sql index db9030c21f..df7e6d6750 100644 --- a/test/plsql/ud/test_gw_fct_setarcdivide.sql +++ b/test/plsql/ud/test_gw_fct_setarcdivide.sql @@ -10,13 +10,18 @@ SET client_min_messages TO WARNING; SET search_path = "SCHEMA_NAME", public, pg_catalog; +-- Plan for 1 test SELECT plan(1); -SELECT ok(1=1, 'One equals one'); --- TODO --- gw_fct_setarcdivide +-- Extract and test the "status" field from the function's JSON response +SELECT is ( + (gw_fct_setarcdivide($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, + "form":{}, "feature":{"id":["100028"]}, "data":{"filterFields":{}, "pageInfo":{}}}$$)::JSON)->>'status', + 'Accepted', + 'Check if gw_fct_setarcdivide returns status "Accepted"' +); -- Finish the test SELECT finish(); -ROLLBACK; +ROLLBACK; \ No newline at end of file diff --git a/test/plsql/ud/test_gw_fct_setchangefeaturetype.sql b/test/plsql/ud/test_gw_fct_setchangefeaturetype.sql new file mode 100644 index 0000000000..02e2c97df8 --- /dev/null +++ b/test/plsql/ud/test_gw_fct_setchangefeaturetype.sql @@ -0,0 +1,28 @@ +/* +This file is part of Giswater 3 +The program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +This version of Giswater is provided by Giswater Association +*/ +BEGIN; + +-- Suppress NOTICE messages +SET client_min_messages TO WARNING; + +SET search_path = "SCHEMA_NAME", public, pg_catalog; + +-- Plan for 1 test +SELECT plan(1); + +-- Extract and test the "status" field from the function's JSON response +SELECT is ( + (gw_fct_setchangefeaturetype($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{}, + "feature":{"type":"node"}, "data":{"filterFields":{}, "pageInfo":{}, "feature_id":"100029", "feature_type_new":"JUMP", + "featurecat_id":"CHAMBER-01"}}$$)::JSON)->>'status', + 'Accepted', + 'Check if gw_fct_setchangefeaturetype returns status "Accepted"' +); + +-- Finish the test +SELECT finish(); + +ROLLBACK; \ No newline at end of file diff --git a/test/plsql/ud/test_gw_fct_setcheckproject.sql b/test/plsql/ud/test_gw_fct_setcheckproject.sql new file mode 100644 index 0000000000..c7720b774e --- /dev/null +++ b/test/plsql/ud/test_gw_fct_setcheckproject.sql @@ -0,0 +1,74 @@ +/* +This file is part of Giswater 3 +The program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +This version of Giswater is provided by Giswater Association +*/ +BEGIN; + +-- Suppress NOTICE messages +SET client_min_messages TO WARNING; + +SET search_path = "SCHEMA_NAME", public, pg_catalog; + +-- Plan for 1 test +SELECT plan(1); + +-- Extract and test the "status" field from the function's JSON response +SELECT is ( + (gw_fct_setcheckproject($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{}, "feature":{}, + "data":{"filterFields":{}, "pageInfo":{}, "version":"3.6.012", "fid":101, "initProject":false, "addSchema":"NULL", + "mainSchema":"NULL", "projecRole":"role_admin", "infoType":"full", "logFolderVolume":"7.52 MB", "projectType":"ud", + "qgisVersion":"3.34.9-Prizren", "osVersion":"Windows 11", "fields":[ {"table_schema":"ud_36", "table_id":"v_edit_exploitation", + "table_dbname":"giswater", "table_host":"localhost", "fid":101, "table_user":"postgres"}, {"table_schema":"ud_36", + "table_id":"v_edit_drainzone", "table_dbname":"giswater", "table_host":"localhost", "fid":101, "table_user":"postgres"}, + {"table_schema":"ud_36", "table_id":"v_edit_sector", "table_dbname":"giswater", "table_host":"localhost", "fid":101, + "table_user":"postgres"}, {"table_schema":"ud_36", "table_id":"v_edit_node", "table_dbname":"giswater", "table_host":"localhost", + "fid":101, "table_user":"postgres"}, {"table_schema":"ud_36", "table_id":"v_edit_connec", "table_dbname":"giswater", + "table_host":"localhost", "fid":101, "table_user":"postgres"}, {"table_schema":"ud_36", "table_id":"v_edit_gully", + "table_dbname":"giswater", "table_host":"localhost", "fid":101, "table_user":"postgres"}, {"table_schema":"ud_36", + "table_id":"v_edit_arc", "table_dbname":"giswater", "table_host":"localhost", "fid":101, "table_user":"postgres"}, + {"table_schema":"ud_36", "table_id":"v_edit_link", "table_dbname":"giswater", "table_host":"localhost", "fid":101, + "table_user":"postgres"}, {"table_schema":"ud_36", "table_id":"ve_pol_node", "table_dbname":"giswater", + "table_host":"localhost", "fid":101, "table_user":"postgres"}, {"table_schema":"ud_36", "table_id":"ve_pol_gully", + "table_dbname":"giswater", "table_host":"localhost", "fid":101, "table_user":"postgres"}, {"table_schema":"ud_36", + "table_id":"ve_pol_connec", "table_dbname":"giswater", "table_host":"localhost", "fid":101, "table_user":"postgres"}, + {"table_schema":"ud_36", "table_id":"v_edit_dimensions", "table_dbname":"giswater", "table_host":"localhost", "fid":101, + "table_user":"postgres"}, {"table_schema":"ud_36", "table_id":"v_edit_element", "table_dbname":"giswater", "table_host":"localhost", + "fid":101, "table_user":"postgres"}, {"table_schema":"ud_36", "table_id":"v_edit_raingage", "table_dbname":"giswater", + "table_host":"localhost", "fid":101, "table_user":"postgres"}, {"table_schema":"ud_36", "table_id":"v_edit_inp_subcatchment", + "table_dbname":"giswater", "table_host":"localhost", "fid":101, "table_user":"postgres"}, {"table_schema":"ud_36", + "table_id":"v_edit_inp_subc2outlet", "table_dbname":"giswater", "table_host":"localhost", "fid":101, "table_user":"postgres"}, + {"table_schema":"ud_36", "table_id":"v_edit_inp_junction", "table_dbname":"giswater", "table_host":"localhost", "fid":101, + "table_user":"postgres"}, {"table_schema":"ud_36", "table_id":"v_edit_inp_outfall", "table_dbname":"giswater", "table_host":"localhost", + "fid":101, "table_user":"postgres"}, {"table_schema":"ud_36", "table_id":"v_edit_inp_divider", "table_dbname":"giswater", + "table_host":"localhost", "fid":101, "table_user":"postgres"}, {"table_schema":"ud_36", "table_id":"v_edit_inp_storage", + "table_dbname":"giswater", "table_host":"localhost", "fid":101, "table_user":"postgres"}, {"table_schema":"ud_36", + "table_id":"v_edit_inp_netgully", "table_dbname":"giswater", "table_host":"localhost", "fid":101, "table_user":"postgres"}, + {"table_schema":"ud_36", "table_id":"v_edit_inp_conduit", "table_dbname":"giswater", "table_host":"localhost", "fid":101, + "table_user":"postgres"}, {"table_schema":"ud_36", "table_id":"v_edit_inp_virtual", "table_dbname":"giswater", "table_host":"localhost", + "fid":101, "table_user":"postgres"}, {"table_schema":"ud_36", "table_id":"v_edit_inp_pump", "table_dbname":"giswater", + "table_host":"localhost", "fid":101, "table_user":"postgres"}, {"table_schema":"ud_36", "table_id":"v_edit_inp_weir", + "table_dbname":"giswater", "table_host":"localhost", "fid":101, "table_user":"postgres"}, {"table_schema":"ud_36", + "table_id":"v_edit_inp_outlet", "table_dbname":"giswater", "table_host":"localhost", "fid":101, "table_user":"postgres"}, + {"table_schema":"ud_36", "table_id":"v_edit_inp_orifice", "table_dbname":"giswater", "table_host":"localhost", "fid":101, + "table_user":"postgres"}, {"table_schema":"ud_36", "table_id":"v_edit_inp_gully", "table_dbname":"giswater", "table_host":"localhost", + "fid":101, "table_user":"postgres"}, {"table_schema":"ud_36", "table_id":"vi_gully2node", "table_dbname":"giswater", + "table_host":"localhost", "fid":101, "table_user":"postgres"}, {"table_schema":"ud_36", "table_id":"v_edit_inp_flwreg_orifice", + "table_dbname":"giswater", "table_host":"localhost", "fid":101, "table_user":"postgres"}, {"table_schema":"ud_36", + "table_id":"v_edit_inp_flwreg_outlet", "table_dbname":"giswater", "table_host":"localhost", "fid":101, "table_user":"postgres"}, + {"table_schema":"ud_36", "table_id":"v_edit_inp_flwreg_pump", "table_dbname":"giswater", "table_host":"localhost", "fid":101, + "table_user":"postgres"}, {"table_schema":"ud_36", "table_id":"v_edit_inp_flwreg_weir", "table_dbname":"giswater", + "table_host":"localhost", "fid":101, "table_user":"postgres"}, {"table_schema":"ud_36", "table_id":"v_rpt_nodeflooding_sum", + "table_dbname":"giswater", "table_host":"localhost", "fid":101, "table_user":"postgres"}, {"table_schema":"ud_36", + "table_id":"v_rpt_nodesurcharge_sum", "table_dbname":"giswater", "table_host":"localhost", "fid":101, "table_user":"postgres"}, + {"table_schema":"ud_36", "table_id":"v_rpt_nodeinflow_sum", "table_dbname":"giswater", "table_host":"localhost", "fid":101, + "table_user":"postgres"}, {"table_schema":"ud_36", "table_id":"v_rpt_nodedepth_sum", "table_dbname":"giswater", "table_host":"localhost", "fid":101, "table_user":"postgres"}, {"table_schema":"ud_36", "table_id":"v_rpt_arcflow_sum", "table_dbname":"giswater", "table_host":"localhost", "fid":101, "table_user":"postgres"}, {"table_schema":"ud_36", "table_id":"v_rpt_condsurcharge_sum", "table_dbname":"giswater", "table_host":"localhost", "fid":101, "table_user":"postgres"}, {"table_schema":"ud_36", "table_id":"v_rpt_pumping_sum", "table_dbname":"giswater", "table_host":"localhost", "fid":101, "table_user":"postgres"}, {"table_schema":"ud_36", "table_id":"v_rpt_flowclass_sum", "table_dbname":"giswater", "table_host":"localhost", "fid":101, "table_user":"postgres"}, {"table_schema":"ud_36", "table_id":"v_rpt_arcpolload_sum", "table_dbname":"giswater", "table_host":"localhost", "fid":101, "table_user":"postgres"}, {"table_schema":"ud_36", "table_id":"v_rpt_outfallflow_sum", "table_dbname":"giswater", "table_host":"localhost", "fid":101, "table_user":"postgres"}, {"table_schema":"ud_36", "table_id":"v_rpt_outfallload_sum", "table_dbname":"giswater", "table_host":"localhost", "fid":101, "table_user":"postgres"}, {"table_schema":"ud_36", "table_id":"v_rpt_storagevol_sum", "table_dbname":"giswater", "table_host":"localhost", "fid":101, "table_user":"postgres"}, {"table_schema":"ud_36", "table_id":"v_rpt_subcatchrunoff_sum", "table_dbname":"giswater", "table_host":"localhost", "fid":101, "table_user":"postgres"}, {"table_schema":"ud_36", "table_id":"v_rpt_subcatchwasoff_sum", "table_dbname":"giswater", "table_host":"localhost", "fid":101, "table_user":"postgres"}, {"table_schema":"ud_36", "table_id":"v_rpt_lidperfomance_sum", "table_dbname":"giswater", "table_host":"localhost", "fid":101, "table_user":"postgres"}, {"table_schema":"ud_36", "table_id":"v_edit_plan_psector", "table_dbname":"giswater", "table_host":"localhost", "fid":101, "table_user":"postgres"}, {"table_schema":"ud_36", "table_id":"v_plan_current_psector", "table_dbname":"giswater", "table_host":"localhost", "fid":101, "table_user":"postgres"}, {"table_schema":"ud_36", "table_id":"v_plan_psector_connec", "table_dbname":"giswater", "table_host":"localhost", "fid":101, "table_user":"postgres"}, {"table_schema":"ud_36", "table_id":"v_plan_psector_link", "table_dbname":"giswater", "table_host":"localhost", "fid":101, "table_user":"postgres"}, {"table_schema":"ud_36", "table_id":"v_plan_psector_node", "table_dbname":"giswater", "table_host":"localhost", "fid":101, "table_user":"postgres"}, {"table_schema":"ud_36", "table_id":"v_plan_psector_arc", "table_dbname":"giswater", "table_host":"localhost", "fid":101, "table_user":"postgres"}, {"table_schema":"ud_36", "table_id":"ext_municipality", "table_dbname":"giswater", "table_host":"localhost", "fid":101, "table_user":"postgres"}, {"table_schema":"ud_36", "table_id":"v_ext_address", "table_dbname":"giswater", "table_host":"localhost", "fid":101, "table_user":"postgres"}, {"table_schema":"ud_36", "table_id":"v_ext_streetaxis", "table_dbname":"giswater", "table_host":"localhost", "fid":101, "table_user":"postgres"}, {"table_schema":"ud_36", "table_id":"v_ext_plot", + "table_dbname":"giswater", "table_host":"localhost", "fid":101, "table_user":"postgres"}]}}$$)::JSON)->>'status', + 'Accepted', + 'Check if gw_fct_setprint returns status "Accepted"' +); + +-- Finish the test +SELECT finish(); + +ROLLBACK; \ No newline at end of file diff --git a/test/plsql/ud/test_gw_fct_setconfig.sql b/test/plsql/ud/test_gw_fct_setconfig.sql new file mode 100644 index 0000000000..e6be8f3364 --- /dev/null +++ b/test/plsql/ud/test_gw_fct_setconfig.sql @@ -0,0 +1,35 @@ +/* +This file is part of Giswater 3 +The program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +This version of Giswater is provided by Giswater Association +*/ +BEGIN; + +-- Suppress NOTICE messages +SET client_min_messages TO WARNING; + +SET search_path = "SCHEMA_NAME", public, pg_catalog; + +-- Plan for 2 test +SELECT plan(2); + +-- Extract and test the "status" field from the function's JSON response +SELECT is ( + (gw_fct_setconfig($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{"formName":"epaoptions"}, + "feature":{}, "data":{"filterFields":{}, "pageInfo":{}, "fields":[]}}$$)::JSON)->>'status', + 'Accepted', + 'Check if gw_fct_setconfig --> "formName":"epaoptions" returns status "Accepted"' +); + +SELECT is ( + (gw_fct_setconfig($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{"formName":"config"}, "feature":{}, + "data":{"filterFields":{}, "pageInfo":{}, "fields":[{"widget_type": "combo", "widget": "basic_search_exploitation_vdefault", + "value": "2", "isChecked": "True", "chk": "chk_basic_search_exploitation_vdefault"}]}}$$)::JSON)->>'status', + 'Accepted', + 'Check if gw_fct_setconfig --> "formName":"config" returns status "Accepted"' +); + +-- Finish the test +SELECT finish(); + +ROLLBACK; \ No newline at end of file diff --git a/test/plsql/ud/test_gw_fct_setdimensioning.sql b/test/plsql/ud/test_gw_fct_setdimensioning.sql new file mode 100644 index 0000000000..173f759bf4 --- /dev/null +++ b/test/plsql/ud/test_gw_fct_setdimensioning.sql @@ -0,0 +1,28 @@ +/* +This file is part of Giswater 3 +The program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +This version of Giswater is provided by Giswater Association +*/ +BEGIN; + +-- Suppress NOTICE messages +SET client_min_messages TO WARNING; + +SET search_path = "SCHEMA_NAME", public, pg_catalog; + +-- Plan for 1 test +SELECT plan(1); + +-- Extract and test the "status" field from the function's JSON response +SELECT is ( + (gw_fct_setdimensioning($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{}, + "feature":{"tableName":"v_edit_dimensions", "id":"6"}, "data":{"filterFields":{}, "pageInfo":{}, + "fields":{"x_symbol":"1", "distance":"1", "direction_arrow":"False","state":"1","expl_id":"2","feature_type":"ARC"}}}$$)::JSON)->>'status', + 'Accepted', + 'Check if gw_fct_setdimensioning returns status "Accepted"' +); + +-- Finish the test +SELECT finish(); + +ROLLBACK; \ No newline at end of file diff --git a/test/plsql/ud/test_gw_fct_setendfeature.sql b/test/plsql/ud/test_gw_fct_setendfeature.sql new file mode 100644 index 0000000000..22dd1ab229 --- /dev/null +++ b/test/plsql/ud/test_gw_fct_setendfeature.sql @@ -0,0 +1,28 @@ +/* +This file is part of Giswater 3 +The program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +This version of Giswater is provided by Giswater Association +*/ +BEGIN; + +-- Suppress NOTICE messages +SET client_min_messages TO WARNING; + +SET search_path = "SCHEMA_NAME", public, pg_catalog; + +-- Plan for 1 test +SELECT plan(1); + +-- Extract and test the "status" field from the function's JSON response +SELECT is ( + (gw_fct_setendfeature($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{}, + "feature":[{"featureType":"arc", "featureId":["160"]}], "data":{"filterFields":{}, "pageInfo":{}, + "state_type":"1", "enddate":"2024/08/16", "workcat_date":"2000/01/01", "workcat_id_end":"work1"}}$$)::JSON)->>'status', + 'Accepted', + 'Check if gw_fct_setendfeature returns status "Accepted"' +); + +-- Finish the test +SELECT finish(); + +ROLLBACK; \ No newline at end of file diff --git a/test/plsql/ud/test_gw_fct_setfeaturedelete.sql b/test/plsql/ud/test_gw_fct_setfeaturedelete.sql new file mode 100644 index 0000000000..06e4469b3b --- /dev/null +++ b/test/plsql/ud/test_gw_fct_setfeaturedelete.sql @@ -0,0 +1,27 @@ +/* +This file is part of Giswater 3 +The program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +This version of Giswater is provided by Giswater Association +*/ +BEGIN; + +-- Suppress NOTICE messages +SET client_min_messages TO WARNING; + +SET search_path = "SCHEMA_NAME", public, pg_catalog; + +-- Plan for 1 test +SELECT plan(1); + +-- Extract and test the "status" field from the function's JSON response +SELECT is ( + (gw_fct_setfeaturedelete($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{}, + "feature":{"type":"NODE"}, "data":{"filterFields":{}, "pageInfo":{}, "feature_id":"34"}}$$)::JSON)->>'status', + 'Accepted', + 'Check if gw_fct_setfeaturedelete returns status "Accepted"' +); + +-- Finish the test +SELECT finish(); + +ROLLBACK; \ No newline at end of file diff --git a/test/plsql/ud/test_gw_fct_setfields.sql b/test/plsql/ud/test_gw_fct_setfields.sql index 4ad862aa28..68d6d5affd 100644 --- a/test/plsql/ud/test_gw_fct_setfields.sql +++ b/test/plsql/ud/test_gw_fct_setfields.sql @@ -28,6 +28,14 @@ SELECT ok(1=1, 'One equals one'); -- 'Check if gw_fct_setfields -> wholeSelection returns status "Accepted"' -- ); +-- SELECT is( +-- (gw_fct_setfields($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{}, "feature":{"id":"T10-5m-e2", +-- "tableName":"v_edit_inp_timeseries" }, "data":{"filterFields":{}, "pageInfo":{}, "fields":{"expl_id": 2, "idval": "T10-5m-e2", +-- "timser_type": "Rainfall", "times_type": "RELATIVE", "descript": "null", "fname": "null"}}}$$)::JSON)->>'status', +-- 'Accepted', +-- 'Check if gw_fct_setfields -> wholeSelection returns status "Accepted"' +-- ); + -- Finish the test SELECT finish(); diff --git a/test/plsql/ud/test_gw_fct_setprint.sql b/test/plsql/ud/test_gw_fct_setprint.sql new file mode 100644 index 0000000000..eae2f4291a --- /dev/null +++ b/test/plsql/ud/test_gw_fct_setprint.sql @@ -0,0 +1,31 @@ +/* +This file is part of Giswater 3 +The program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +This version of Giswater is provided by Giswater Association +*/ +BEGIN; + +-- Suppress NOTICE messages +SET client_min_messages TO WARNING; + +SET search_path = "SCHEMA_NAME", public, pg_catalog; + +-- Plan for 1 test +SELECT plan(1); + +-- Extract and test the "status" field from the function's JSON response +SELECT is ( + (gw_fct_setprint($${"client":{"device":4, "infoType":1, "lang":"ES"}, "form":{}, "feature":{}, + "data":{"composer": "composer_plan", "scale": 3306, "rotation": 0.0, "title": null, + "ComposerTemplates": [{"ComposerTemplate": "composer_plan", "ComposerMap": [{"width": 65.4621, + "height": 46.5539, "name": "Mapa 1", "index": 0}, {"width": 177.676, "height": 98.32249999946721, + "name": "map", "index": 1}]}], "extent": {"p1": {"xcoord": 418656.50312160864, "ycoord": 4576500.030933464}, + "p2": {"xcoord": 419749.31458233343, "ycoord": 4576733.6423506085}}}}$$)::JSON)->>'status', + 'Accepted', + 'Check if gw_fct_setprint returns status "Accepted"' +); + +-- Finish the test +SELECT finish(); + +ROLLBACK; \ No newline at end of file diff --git a/test/plsql/ud/test_gw_fct_setprofile.sql b/test/plsql/ud/test_gw_fct_setprofile.sql new file mode 100644 index 0000000000..ff82844d94 --- /dev/null +++ b/test/plsql/ud/test_gw_fct_setprofile.sql @@ -0,0 +1,28 @@ +/* +This file is part of Giswater 3 +The program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +This version of Giswater is provided by Giswater Association +*/ +BEGIN; + +-- Suppress NOTICE messages +SET client_min_messages TO WARNING; + +SET search_path = "SCHEMA_NAME", public, pg_catalog; + +-- Plan for 1 test +SELECT plan(1); + +-- Extract and test the "status" field from the function's JSON response +SELECT is ( + (gw_fct_setprofile($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{}, "feature":{}, + "data":{"filterFields":{}, "pageInfo":{}, "profile_id":"12", "listArcs":"[159]","initNode":"64", "endNode":"37", + "linksDistance":1, "scale":{ "eh":1000, "ev":1000}, "title":"null", "date":"16/08/2024"}}$$)::JSON)->>'status', + 'Accepted', + 'Check if gw_fct_setprofile returns status "Accepted"' +); + +-- Finish the test +SELECT finish(); + +ROLLBACK; \ No newline at end of file diff --git a/test/plsql/ud/test_gw_fct_setsearch.sql b/test/plsql/ud/test_gw_fct_setsearch.sql new file mode 100644 index 0000000000..b32470fd85 --- /dev/null +++ b/test/plsql/ud/test_gw_fct_setsearch.sql @@ -0,0 +1,50 @@ +/* +This file is part of Giswater 3 +The program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +This version of Giswater is provided by Giswater Association +*/ +BEGIN; + +-- Suppress NOTICE messages +SET client_min_messages TO WARNING; + +SET search_path = "SCHEMA_NAME", public, pg_catalog; + +-- Plan for 4 test +SELECT plan(4); + +-- Extract and test the "status" field from the function's JSON response +SELECT is ( + (gw_fct_setsearch($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{"tabName":"network"}, + "feature":{}, "data":{"filterFields":{}, "pageInfo":{}, "searchType":"arc", "net_type":{"id":"v_edit_arc", "name":"Arcs"}, + "net_code":{"text":"100011 : CC040"}, "addSchema":"NULL"}}$$)::JSON)->>'status', + 'Accepted', + 'Check if gw_fct_setsearch --> tabName":"network" returns status "Accepted"' +); + +SELECT is ( + (gw_fct_setsearch($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{"tabName":"workcat"}, + "feature":{}, "data":{"filterFields":{}, "pageInfo":{}, "workcat_search":{"text":"work1"}, "addSchema":"NULL"}}$$)::JSON)->>'status', + 'Accepted', + 'Check if gw_fct_setsearch --> tabName":"workcat" returns status "Accepted"' +); + +SELECT is ( + (gw_fct_setsearch($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{"tabName":"psector"}, + "feature":{}, "data":{"filterFields":{}, "pageInfo":{}, "psector_expl":{"id":"1", "name":"expl_01"}, + "psector_search":{"text":"ACT_01_F0"}, "addSchema":"NULL"}}$$)::JSON)->>'status', + 'Accepted', + 'Check if gw_fct_setsearch --> tabName":"psector" returns status "Accepted"' +); + +SELECT is ( + (gw_fct_setsearch($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{"tabName":"visit"}, + "feature":{}, "data":{"filterFields":{}, "pageInfo":{}, "visit_search":{"text":"1"}, "addSchema":"NULL"}}$$)::JSON)->>'status', + 'Accepted', + 'Check if gw_fct_setsearch --> tabName":"visit" returns status "Accepted"' +); + +-- Finish the test +SELECT finish(); + +ROLLBACK; \ No newline at end of file diff --git a/test/plsql/ud/test_gw_fct_setsearchadd.sql b/test/plsql/ud/test_gw_fct_setsearchadd.sql new file mode 100644 index 0000000000..1fe1cb969c --- /dev/null +++ b/test/plsql/ud/test_gw_fct_setsearchadd.sql @@ -0,0 +1,28 @@ +/* +This file is part of Giswater 3 +The program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +This version of Giswater is provided by Giswater Association +*/ +BEGIN; + +-- Suppress NOTICE messages +SET client_min_messages TO WARNING; + +SET search_path = "SCHEMA_NAME", public, pg_catalog; + +-- Plan for 1 test +SELECT plan(1); + +-- Extract and test the "status" field from the function's JSON response +SELECT is ( + (gw_fct_setsearchadd($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{"tabName":"address"}, + "feature":{}, "data":{"filterFields":{}, "pageInfo":{}, "add_muni":{"id":"1", "name":"Sant Boi del Llobregat"}, + "add_street":{"text":"General Prim, Av. del"}, "add_postnumber":{"text":"11"}}}$$)::JSON)->>'status', + 'Accepted', + 'Check if gw_fct_setsearchadd returns status "Accepted"' +); + +-- Finish the test +SELECT finish(); + +ROLLBACK; \ No newline at end of file diff --git a/test/plsql/ud/test_gw_fct_setselectors.sql b/test/plsql/ud/test_gw_fct_setselectors.sql new file mode 100644 index 0000000000..e3e59b71ee --- /dev/null +++ b/test/plsql/ud/test_gw_fct_setselectors.sql @@ -0,0 +1,84 @@ +/* +This file is part of Giswater 3 +The program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +This version of Giswater is provided by Giswater Association +*/ +BEGIN; + +-- Suppress NOTICE messages +SET client_min_messages TO WARNING; + +SET search_path = "SCHEMA_NAME", public, pg_catalog; + +-- Plan for 8 test +SELECT plan(8); + +-- Extract and test the "status" field from the function's JSON response +SELECT is ( + (gw_fct_setselectors($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{}, "feature":{}, + "data":{"filterFields":{}, "pageInfo":{}, "selectorType":"selector_basic", "tabName":"tab_exploitation", "id":"1", + "isAlone":"True", "disableParent":"False", "value":"True", "addSchema":"NULL"}}$$)::JSON)->>'status', + 'Accepted', + 'Check if gw_fct_setselectors --> "tabName":"tab_exploitation" && "value":"True" returns status "Accepted"' +); + +SELECT is ( + (gw_fct_setselectors($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{}, "feature":{}, + "data":{"filterFields":{}, "pageInfo":{}, "selectorType":"selector_basic", "tabName":"tab_exploitation", "id":"1", + "isAlone":"True", "disableParent":"False", "value":"False", "addSchema":"NULL"}}$$)::JSON)->>'status', + 'Accepted', + 'Check if gw_fct_setselectors --> "tabName":"tab_exploitation" && "value":"False" returns status "Accepted"' +); + +SELECT is ( + (gw_fct_setselectors($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{}, "feature":{}, + "data":{"filterFields":{}, "pageInfo":{}, "selectorType":"selector_basic", "tabName":"tab_sector", "id":"1", "isAlone":"False", + "disableParent":"False", "value":"True", "addSchema":"NULL"}}$$)::JSON)->>'status', + 'Accepted', + 'Check if gw_fct_setselectors --> "tabName":"tab_sector" && "value":"True" returns status "Accepted"' +); + +SELECT is ( + (gw_fct_setselectors($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{}, + "feature":{}, "data":{"filterFields":{}, "pageInfo":{}, "selectorType":"selector_basic", "tabName":"tab_sector", "id":"1", + "isAlone":"False", "disableParent":"False", "value":"False", "addSchema":"NULL"}}$$)::JSON)->>'status', + 'Accepted', + 'Check if gw_fct_setselectors --> "tabName":"tab_sector" && "value":"False" returns status "Accepted"' +); + +SELECT is ( + (gw_fct_setselectors($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{}, "feature":{}, + "data":{"filterFields":{}, "pageInfo":{}, "selectorType":"selector_basic", "tabName":"tab_network_state", "id":"1", + "isAlone":"False", "disableParent":"False", "value":"True", "addSchema":"NULL"}}$$)::JSON)->>'status', + 'Accepted', + 'Check if gw_fct_setselectors --> "tabName":"tab_network_state" && "value":"True" returns status "Accepted"' +); + +SELECT is ( + (gw_fct_setselectors($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{}, "feature":{}, + "data":{"filterFields":{}, "pageInfo":{}, "selectorType":"selector_basic", "tabName":"tab_network_state", "id":"1", + "isAlone":"False", "disableParent":"False", "value":"False", "addSchema":"NULL"}}$$)::JSON)->>'status', + 'Accepted', + 'Check if gw_fct_setselectors --> "tabName":"tab_network_state" && "value":"False" returns status "Accepted"' +); + +SELECT is ( + (gw_fct_setselectors($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{}, "feature":{}, + "data":{"filterFields":{}, "pageInfo":{}, "selectorType":"selector_basic", "tabName":"tab_psector", "id":"1", "isAlone":"False", + "disableParent":"False", "value":"True", "addSchema":"NULL"}}$$)::JSON)->>'status', + 'Accepted', + 'Check if gw_fct_setselectors --> "tabName":"tab_psector" && "value":"True" returns status "Accepted"' +); + +SELECT is ( + (gw_fct_setselectors($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{}, "feature":{}, + "data":{"filterFields":{}, "pageInfo":{}, "selectorType":"selector_basic", "tabName":"tab_psector", "id":"1", "isAlone":"False", + "disableParent":"False", "value":"False", "addSchema":"NULL"}}$$)::JSON)->>'status', + 'Accepted', + 'Check if gw_fct_setselectors --> "tabName":"tab_psector" && "value":"False" returns status "Accepted"' +); + +-- Finish the test +SELECT finish(); + +ROLLBACK; \ No newline at end of file diff --git a/test/plsql/ud/test_gw_fct_upsertfields.sql b/test/plsql/ud/test_gw_fct_upsertfields.sql new file mode 100644 index 0000000000..155ba9bdb5 --- /dev/null +++ b/test/plsql/ud/test_gw_fct_upsertfields.sql @@ -0,0 +1,35 @@ +/* +This file is part of Giswater 3 +The program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +This version of Giswater is provided by Giswater Association +*/ +BEGIN; + +-- Suppress NOTICE messages +SET client_min_messages TO WARNING; + +SET search_path = "SCHEMA_NAME", public, pg_catalog; + +-- Plan for 2 test +SELECT plan(2); + +-- Extract and test the "status" field from the function's JSON response +SELECT is ( + (gw_fct_upsertfields($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{}, "feature":{"id":"1", + "tableName":"v_edit_cat_hydrology"},"data":{"filterFields":{}, "pageInfo":{}, "fields":{"infiltration": "GREEN_AMPT"}}}$$)::JSON)->>'status', + 'Accepted', + 'Check if gw_fct_upsertfields --> "tableName":"v_edit_cat_hydrology" returns status "Accepted"' +); + +SELECT is ( + (gw_fct_upsertfields($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{}, "feature":{"id":"1", + "tableName":"v_edit_drainzone"}, "data":{"filterFields":{}, "pageInfo":{}, "fields":{"drainzone_id": "1", "active": "false", + "expl_id": "0", "name": "2"}, "force_action":"UPDATE"}}$$)::JSON)->>'status', + 'Accepted', + 'Check if gw_fct_upsertfields --> "tableName":"v_edit_drainzone" returns status "Accepted"' +); + +-- Finish the test +SELECT finish(); + +ROLLBACK; \ No newline at end of file diff --git a/test/plsql/ud/test_gw_fct_workspacemanager.sql b/test/plsql/ud/test_gw_fct_workspacemanager.sql new file mode 100644 index 0000000000..5f957b37d9 --- /dev/null +++ b/test/plsql/ud/test_gw_fct_workspacemanager.sql @@ -0,0 +1,27 @@ +/* +This file is part of Giswater 3 +The program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +This version of Giswater is provided by Giswater Association +*/ +BEGIN; + +-- Suppress NOTICE messages +SET client_min_messages TO WARNING; + +SET search_path = "SCHEMA_NAME", public, pg_catalog; + +-- Plan for 1 test +SELECT plan(1); + +-- Extract and test the "status" field from the function's JSON response +SELECT is ( + (gw_fct_workspacemanager($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, + "form":{}, "feature":{}, "data":{"filterFields":{}, "pageInfo":{}, "action":"CHECK"}}$$)::JSON)->>'status', + 'Accepted', + 'Check if gw_fct_workspacemanager returns status "Accepted"' +); + +-- Finish the test +SELECT finish(); + +ROLLBACK; \ No newline at end of file diff --git a/test/plsql/ws/test_gw_fct_config_mapzones.sql b/test/plsql/ws/test_gw_fct_config_mapzones.sql new file mode 100644 index 0000000000..bd69bd1eab --- /dev/null +++ b/test/plsql/ws/test_gw_fct_config_mapzones.sql @@ -0,0 +1,27 @@ +/* +This file is part of Giswater 3 +The program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +This version of Giswater is provided by Giswater Association +*/ +BEGIN; + +-- Suppress NOTICE messages +SET client_min_messages TO WARNING; + +SET search_path = "SCHEMA_NAME", public, pg_catalog; + +-- Plan for 5 test +SELECT plan(5); + +-- Extract and test the "status" field from the function's JSON response +SELECT is ( + (gw_fct_config_mapzones($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{}, "feature":{}, "data":{"filterFields":{}, "pageInfo":{}, + "parameters": {"action": "UPDATE", "configZone": "dma", "mapzoneId": "2", "config": {"use":[], "ignore":[], "forceClosed":[]}, "netscenarioId": 1}}}$$)::JSON)->>'status', + 'Accepted', + 'Check if gw_fct_config_mapzones returns status "Accepted"' +); + +-- Finish the test +SELECT finish(); + +ROLLBACK; \ No newline at end of file diff --git a/test/plsql/ws/test_gw_fct_getcatalog.sql b/test/plsql/ws/test_gw_fct_getcatalog.sql index 9124020145..9b3b3a20dc 100644 --- a/test/plsql/ws/test_gw_fct_getcatalog.sql +++ b/test/plsql/ws/test_gw_fct_getcatalog.sql @@ -10,8 +10,8 @@ SET client_min_messages TO WARNING; SET search_path = "SCHEMA_NAME", public, pg_catalog; --- Plan for 1 test -SELECT plan(1); +-- Plan for 2 test +SELECT plan(2); -- Extract and test the "status" field from the function's JSON response SELECT is ( @@ -22,7 +22,16 @@ SELECT is ( 'Check if gw_fct_getcatalog returns status "Accepted"' ); +SELECT is ( + (gw_fct_getcatalog($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, + "form":{"formName":"new_workcat", "tabName":"data", "editable":"TRUE"}, "feature":{"tableName":"ve_node_shutoff_valve", + "featureId":"1088", "feature_type":"SHUTOFF_VALVE"}, "data":{"filterFields":{}, "pageInfo":{}, + "coordinates":{"x1": 419179.4317495035, "y1": 4576762.208694622}}}$$)::JSON)->>'status', + 'Accepted', + 'Check if gw_fct_getcatalog with coordinates returns status "Accepted"' +); + -- Finish the test SELECT finish(); -ROLLBACK; +ROLLBACK; \ No newline at end of file diff --git a/test/plsql/ws/test_gw_fct_getcheckdelete.sql b/test/plsql/ws/test_gw_fct_getcheckdelete.sql new file mode 100644 index 0000000000..22053fa6b1 --- /dev/null +++ b/test/plsql/ws/test_gw_fct_getcheckdelete.sql @@ -0,0 +1,27 @@ +/* +This file is part of Giswater 3 +The program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +This version of Giswater is provided by Giswater Association +*/ +BEGIN; + +-- Suppress NOTICE messages +SET client_min_messages TO WARNING; + +SET search_path = "SCHEMA_NAME", public, pg_catalog; + +-- Plan for 1 test +SELECT plan(1); + +-- Extract and test the "status" field from the function's JSON response +SELECT is ( + (gw_fct_getcheckdelete($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{}, + "feature":{"id":["5"], "featureType":"PSECTOR"}, "data":{"filterFields":{}, "pageInfo":{}}}$$)::JSON)->>'status', + 'Accepted', + 'Check if gw_fct_getcheckdelete returns status "Accepted"' +); + +-- Finish the test +SELECT finish(); + +ROLLBACK; \ No newline at end of file diff --git a/test/plsql/ws/test_gw_fct_getconfig.sql b/test/plsql/ws/test_gw_fct_getconfig.sql new file mode 100644 index 0000000000..6eb8555147 --- /dev/null +++ b/test/plsql/ws/test_gw_fct_getconfig.sql @@ -0,0 +1,42 @@ +/* +This file is part of Giswater 3 +The program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +This version of Giswater is provided by Giswater Association +*/ +BEGIN; + +-- Suppress NOTICE messages +SET client_min_messages TO WARNING; + +SET search_path = "SCHEMA_NAME", public, pg_catalog; + +-- Plan for 2 test +SELECT plan(2); + +-- Extract and test the "status" field from the function's JSON response +SELECT is ( + (gw_fct_getconfig($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{"formName":"epaoptions"}, + "feature":{}, "data":{"filterFields":{}, "pageInfo":{}}}$$)::JSON)->>'status', + 'Accepted', + 'Check if gw_fct_getconfig --> "formName":"epaoptions" returns status "Accepted"' +); + +SELECT is ( + (gw_fct_getconfig($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{"formName":"config"}, + "feature":{}, "data":{"filterFields":{}, "pageInfo":{}, "list_layers_name":"{Mincut init point, Mincut result valve, + Mincut result node, Mincut result connec, Mincut result arc, Node, Connec, Arc, Link, Connec polygon, Node polygon, + Dimensioning, Inp reservoir, Inp tank, Inp inlet, Inp junction, Inp shortpipe, Inp valve, Inp pump, Inp connec, Inp pipe, + Inp virtualvalve, Inp virtualpump, Plan psector connec, Plan psector node, Plan psector arc, Plan psector link, Municipality, + Streetaxis, Plot}", "list_tables_name":"{v_om_mincut_initpoint, v_om_mincut_valve, v_om_mincut_node, v_om_mincut_connec, + v_om_mincut_arc, v_edit_node, v_edit_connec, v_edit_arc, v_edit_link, ve_pol_connec, ve_pol_node, v_edit_dimensions, + v_edit_inp_reservoir, v_edit_inp_tank, v_edit_inp_inlet, v_edit_inp_junction, v_edit_inp_shortpipe, v_edit_inp_valve, + v_edit_inp_pump, v_edit_inp_connec, v_edit_inp_pipe, v_edit_inp_virtualvalve, v_edit_inp_virtualpump, v_plan_psector_connec, + v_plan_psector_node, v_plan_psector_arc, v_plan_psector_link, ext_municipality, v_ext_streetaxis, v_ext_plot}"}}$$)::JSON)->>'status', + 'Accepted', + 'Check if gw_fct_getconfig --> "formName":"config" returns status "Accepted"' +); + +-- Finish the test +SELECT finish(); + +ROLLBACK; \ No newline at end of file diff --git a/test/plsql/ws/test_gw_fct_getdimensioning.sql b/test/plsql/ws/test_gw_fct_getdimensioning.sql new file mode 100644 index 0000000000..47e1afbb25 --- /dev/null +++ b/test/plsql/ws/test_gw_fct_getdimensioning.sql @@ -0,0 +1,28 @@ +/* +This file is part of Giswater 3 +The program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +This version of Giswater is provided by Giswater Association +*/ +BEGIN; + +-- Suppress NOTICE messages +SET client_min_messages TO WARNING; + +SET search_path = "SCHEMA_NAME", public, pg_catalog; + +-- Plan for 1 test +SELECT plan(1); + +-- Extract and test the "status" field from the function's JSON response +SELECT is ( + (gw_fct_getdimensioning($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{}, "feature":{}, + "data":{"filterFields":{}, "pageInfo":{}, "coordinates":{"x1":418911.54997240973, "y1":4576938.048954305, + "x2":418911.54997240973, "y2":4576938.048954305}}}$$)::JSON)->>'status', + 'Accepted', + 'Check if gw_fct_getdimensioning returns status "Accepted"' +); + +-- Finish the test +SELECT finish(); + +ROLLBACK; \ No newline at end of file diff --git a/test/plsql/ws/test_gw_fct_getfeaturegeom.sql b/test/plsql/ws/test_gw_fct_getfeaturegeom.sql new file mode 100644 index 0000000000..308b34f59e --- /dev/null +++ b/test/plsql/ws/test_gw_fct_getfeaturegeom.sql @@ -0,0 +1,27 @@ +/* +This file is part of Giswater 3 +The program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +This version of Giswater is provided by Giswater Association +*/ +BEGIN; + +-- Suppress NOTICE messages +SET client_min_messages TO WARNING; + +SET search_path = "SCHEMA_NAME", public, pg_catalog; + +-- Plan for 1 test +SELECT plan(1); + +-- Extract and test the "status" field from the function's JSON response +SELECT is ( + (gw_fct_getfeaturegeom($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{}, "feature":{}, + "data":{"filterFields":{}, "pageInfo":{}, "feature_type": "connec", "ids": "[3103, 3104]"}}$$)::JSON)->>'status', + 'Accepted', + 'Check if gw_fct_getfeaturegeom returns status "Accepted"' +); + +-- Finish the test +SELECT finish(); + +ROLLBACK; \ No newline at end of file diff --git a/test/plsql/ws/test_gw_fct_getfeaturerelation.sql b/test/plsql/ws/test_gw_fct_getfeaturerelation.sql new file mode 100644 index 0000000000..2d837c205a --- /dev/null +++ b/test/plsql/ws/test_gw_fct_getfeaturerelation.sql @@ -0,0 +1,27 @@ +/* +This file is part of Giswater 3 +The program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +This version of Giswater is provided by Giswater Association +*/ +BEGIN; + +-- Suppress NOTICE messages +SET client_min_messages TO WARNING; + +SET search_path = "SCHEMA_NAME", public, pg_catalog; + +-- Plan for 1 test +SELECT plan(1); + +-- Extract and test the "status" field from the function's JSON response +SELECT is ( + (gw_fct_getfeaturerelation($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{}, + "feature":{"type":"ARC"}, "data":{"filterFields":{}, "pageInfo":{}, "feature_id":"113881"}}$$)::JSON)->>'status', + 'Accepted', + 'Check if gw_fct_getfeaturerelation returns status "Accepted"' +); + +-- Finish the test +SELECT finish(); + +ROLLBACK; \ No newline at end of file diff --git a/test/plsql/ws/test_gw_fct_getgraphconfig.sql b/test/plsql/ws/test_gw_fct_getgraphconfig.sql new file mode 100644 index 0000000000..706d707b5b --- /dev/null +++ b/test/plsql/ws/test_gw_fct_getgraphconfig.sql @@ -0,0 +1,27 @@ +/* +This file is part of Giswater 3 +The program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +This version of Giswater is provided by Giswater Association +*/ +BEGIN; + +-- Suppress NOTICE messages +SET client_min_messages TO WARNING; + +SET search_path = "SCHEMA_NAME", public, pg_catalog; + +-- Plan for 1 test +SELECT plan(1); + +-- Extract and test the "status" field from the function's JSON response +SELECT is ( + (gw_fct_getgraphconfig($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{}, "feature":{}, "data":{"filterFields":{}, + "pageInfo":{}, "context":"NETSCENARIO", "mapzone": "dma", "mapzoneId": "2", "netscenarioId": 1}}$$)::JSON)->>'status', + 'Accepted', + 'Check if gw_fct_getgraphconfig returns status "Accepted"' +); + +-- Finish the test +SELECT finish(); + +ROLLBACK; \ No newline at end of file diff --git a/test/plsql/ws/test_gw_fct_getinfofromid.sql b/test/plsql/ws/test_gw_fct_getinfofromid.sql index d59d2063e4..741b30d4e3 100644 --- a/test/plsql/ws/test_gw_fct_getinfofromid.sql +++ b/test/plsql/ws/test_gw_fct_getinfofromid.sql @@ -14,8 +14,8 @@ SELECT plan(1); SELECT ok(1=1, 'One equals one'); -- TODO: Add test for gw_fct_getinfofromid --- -- Plan for 4 test --- SELECT plan(4); +-- -- Plan for 5 test +-- SELECT plan(5); -- -- Extract and test the "status" field from the function's JSON response -- SELECT is( @@ -46,6 +46,14 @@ SELECT ok(1=1, 'One equals one'); -- 'Check if gw_fct_getinfofromid returns status "Accepted"' -- ); +-- SELECT is( +-- (gw_fct_getinfofromid($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{}, +-- "feature":{"tableName":"plan_netscenario_dma", "id": "1, 2"}, "data":{"filterFields":{}, "pageInfo":{}}}$$)::JSON)->>'status', +-- 'Accepted', +-- 'Check if gw_fct_getinfofromid --> "tableName":"plan_netscenario_dma" returns status "Accepted"' +-- ); + + -- Finish the test SELECT finish(); diff --git a/test/plsql/ws/test_gw_fct_getlist.sql b/test/plsql/ws/test_gw_fct_getlist.sql index 1eb7a7d047..44ee083236 100644 --- a/test/plsql/ws/test_gw_fct_getlist.sql +++ b/test/plsql/ws/test_gw_fct_getlist.sql @@ -20,7 +20,7 @@ SELECT is ( "feature":{"tableName":"tbl_inp_dscenario_junction", "idName":"node_id", "id":"1071"}, "data":{"filterFields":{"node_id":{"value":"1071","filterSign":"="}}, "pageInfo":{}}}$$)::JSON)->>'status', 'Accepted', - 'Check if gw_fct_getlist returns status "Accepted"' + 'Check if gw_fct_getlist --> "tabName":"epa" returns status "Accepted"' ); SELECT is ( @@ -29,7 +29,7 @@ SELECT is ( "feature":{"tableName":"tbl_element_x_node", "idName":"node_id", "id":"1071"}, "data":{"filterFields":{"node_id":{"value":"1071","filterSign":"="}}, "pageInfo":{}}}$$)::JSON)->>'status', 'Accepted', - 'Check if gw_fct_getlist returns status "Accepted"' + 'Check if gw_fct_getlist --> "tabName":"elements" returns status "Accepted"' ); SELECT is ( @@ -38,7 +38,7 @@ SELECT is ( "idName":"node_id", "id":"1071"}, "data":{"filterFields":{"node_id":{"value":"1071","filterSign":"="}, "parameter_type":{"value":"INCIDENCE","filterSign":"ILIKE"}}, "pageInfo":{}}}$$)::JSON)->>'status', 'Accepted', - 'Check if gw_fct_getlist returns status "Accepted"' + 'Check if gw_fct_getlist --> "tabName":"tab_event" returns status "Accepted"' ); SELECT is ( @@ -46,9 +46,31 @@ SELECT is ( "widgetname":"tab_documents_tbl_documents", "formtype":"form_feature"}, "feature":{"tableName":"tbl_doc_x_node", "idName":"node_id", "id":"1071"}, "data":{"filterFields":{"node_id":{"value":"1071","filterSign":"="}}, "pageInfo":{}}}$$)::JSON)->>'status', 'Accepted', - 'Check if gw_fct_getlist returns status "Accepted"' + 'Check if gw_fct_getlist --> "tabName":"documents" returns status "Accepted"' ); +SELECT is ( + (gw_fct_getlist($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{}, "feature":{"tableName":"v_ui_plan_netscenario"}, + "data":{"filterFields":{"limit": -1, "name": {"filterSign":"ILIKE", "value":""}, "active": {"filterSign":"=", "value":"true"}}, "pageInfo":{}}}$$)::JSON)->>'status', + 'Accepted', + 'Check if gw_fct_getlist --> "tableName":"v_ui_plan_netscenario" returns status "Accepted"' +); + +SELECT is ( + (gw_fct_getlist($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{}, "feature":{"tableName":"v_edit_cat_dscenario"}, + "data":{"filterFields":{"limit": -1, "name": {"filterSign":"ILIKE", "value":""}, "active": {"filterSign":"=", "value":"true"}}, "pageInfo":{}}}$$)::JSON)->>'status', + 'Accepted', + 'Check if gw_fct_getlist --> "tableName":"v_edit_cat_dscenario" returns status "Accepted"' +); + +SELECT is ( + (gw_fct_getlist($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{}, "feature":{"tableName":"v_ui_workspace"}, + "data":{"filterFields":{"limit": -1, "name": {"filterSign":"ILIKE", "value":""}}, "pageInfo":{}}}$$)::JSON)->>'status', + 'Accepted', + 'Check if gw_fct_getlist --> "tableName":"v_ui_workspace" returns status "Accepted"' +); + + -- Finish the test SELECT finish(); diff --git a/test/plsql/ws/test_gw_fct_getprocess.sql b/test/plsql/ws/test_gw_fct_getprocess.sql new file mode 100644 index 0000000000..d39c16610a --- /dev/null +++ b/test/plsql/ws/test_gw_fct_getprocess.sql @@ -0,0 +1,27 @@ +/* +This file is part of Giswater 3 +The program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +This version of Giswater is provided by Giswater Association +*/ +BEGIN; + +-- Suppress NOTICE messages +SET client_min_messages TO WARNING; + +SET search_path = "SCHEMA_NAME", public, pg_catalog; + +-- Plan for 1 test +SELECT plan(1); + +-- Extract and test the "status" field from the function's JSON response +SELECT is ( + (gw_fct_getprocess($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{}, + "feature":{}, "data":{"filterFields":{}, "pageInfo":{}, "functionId":3042}}$$)::JSON)->>'status', + 'Accepted', + 'Check if gw_fct_getprocess returns status "Accepted"' +); + +-- Finish the test +SELECT finish(); + +ROLLBACK; \ No newline at end of file diff --git a/test/plsql/ws/test_gw_fct_getsearch.sql b/test/plsql/ws/test_gw_fct_getsearch.sql new file mode 100644 index 0000000000..1a6cdbfedf --- /dev/null +++ b/test/plsql/ws/test_gw_fct_getsearch.sql @@ -0,0 +1,27 @@ +/* +This file is part of Giswater 3 +The program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +This version of Giswater is provided by Giswater Association +*/ +BEGIN; + +-- Suppress NOTICE messages +SET client_min_messages TO WARNING; + +SET search_path = "SCHEMA_NAME", public, pg_catalog; + +-- Plan for 1 test +SELECT plan(1); + +-- Extract and test the "status" field from the function's JSON response +SELECT is ( + (gw_fct_getsearch($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{}, "feature":{}, + "data":{"filterFields":{}, "pageInfo":{}, "addSchema":"NULL"}}$$)::JSON)->>'status', + 'Accepted', + 'Check if gw_fct_getsearch returns status "Accepted"' +); + +-- Finish the test +SELECT finish(); + +ROLLBACK; \ No newline at end of file diff --git a/test/plsql/ws/test_gw_fct_getselectors.sql b/test/plsql/ws/test_gw_fct_getselectors.sql new file mode 100644 index 0000000000..13de75f99c --- /dev/null +++ b/test/plsql/ws/test_gw_fct_getselectors.sql @@ -0,0 +1,41 @@ +/* +This file is part of Giswater 3 +The program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +This version of Giswater is provided by Giswater Association +*/ +BEGIN; + +-- Suppress NOTICE messages +SET client_min_messages TO WARNING; + +SET search_path = "SCHEMA_NAME", public, pg_catalog; + +-- Plan for 3 test +SELECT plan(3); + +-- Extract and test the "status" field from the function's JSON response +SELECT is ( + (gw_fct_getselectors($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{"currentTab":"tab_exploitation"}, "feature":{}, + "data":{"filterFields":{}, "pageInfo":{}, "selectorType":"selector_basic", "filterText":"", "addSchema":"NULL"}}$$)::JSON)->>'status', + 'Accepted', + 'Check if gw_fct_getselectors --> GwSelectorButton returns status "Accepted"' +); + +SELECT is ( + (gw_fct_getselectors($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{}, "feature":{}, "data":{"filterFields":{}, + "pageInfo":{}, "selectorType":"selector_basic", "tabName":"tab_psector", "id":1, "isAlone":"False", "disableParent":"False", "value":"True"}}$$)::JSON)->>'status', + 'Accepted', + 'Check if gw_fct_getselectors --> GwPriceManagerButton returns status "Accepted"' +); + +SELECT is ( + (gw_fct_getselectors($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{"currentTab":"tab_dscenario"}, "feature":{}, + "data":{"filterFields":{}, "pageInfo":{}, "selectorType":"selector_basic", "filterText":"", "addSchema":"NULL"}}$$)::JSON)->>'status', + 'Accepted', + 'Check if gw_fct_getselectors --> GwGo2EpaButton returns status "Accepted"' +); + +-- Finish the test +SELECT finish(); + +ROLLBACK; diff --git a/test/plsql/ws/test_gw_fct_gettypeahead.sql b/test/plsql/ws/test_gw_fct_gettypeahead.sql new file mode 100644 index 0000000000..f522999b8e --- /dev/null +++ b/test/plsql/ws/test_gw_fct_gettypeahead.sql @@ -0,0 +1,28 @@ +/* +This file is part of Giswater 3 +The program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +This version of Giswater is provided by Giswater Association +*/ +BEGIN; + +-- Suppress NOTICE messages +SET client_min_messages TO WARNING; + +SET search_path = "SCHEMA_NAME", public, pg_catalog; + +-- Plan for 1 test +SELECT plan(1); + +-- Extract and test the "status" field from the function's JSON response +SELECT is ( + (gw_fct_gettypeahead($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{}, "feature":{}, + "data":{"filterFields":{}, "pageInfo":{}, "queryText":"SELECT id, id as idval FROM cat_arc WHERE id IS NOT NULL AND active IS TRUE ", + "queryTextFilter":" AND arctype_id", "parentId":"arc_type", "parentValue":"PIPE", "textToSearch":"PELD110-PN10"}}$$)::JSON)->>'status', + 'Accepted', + 'Check if gw_fct_getcatfeaturevalues returns status "Accepted"' +); + +-- Finish the test +SELECT finish(); + +ROLLBACK; diff --git a/test/plsql/ws/test_gw_fct_getwidgetprices.sql b/test/plsql/ws/test_gw_fct_getwidgetprices.sql new file mode 100644 index 0000000000..63ef6ca084 --- /dev/null +++ b/test/plsql/ws/test_gw_fct_getwidgetprices.sql @@ -0,0 +1,27 @@ +/* +This file is part of Giswater 3 +The program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +This version of Giswater is provided by Giswater Association +*/ +BEGIN; + +-- Suppress NOTICE messages +SET client_min_messages TO WARNING; + +SET search_path = "SCHEMA_NAME", public, pg_catalog; + +-- Plan for 1 test +SELECT plan(1); + +-- Extract and test the "status" field from the function's JSON response +SELECT is ( + (gw_fct_getwidgetprices($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{}, "feature":{}, + "data":{"filterFields":{}, "pageInfo":{}, "tableName":"v_edit_plan_psector_x_other", "psectorId":5}}$$)::JSON)->>'status', + 'Accepted', + 'Check if gw_fct_getwidgetprices returns status "Accepted"' +); + +-- Finish the test +SELECT finish(); + +ROLLBACK; \ No newline at end of file diff --git a/test/plsql/ws/test_gw_fct_setarcdivide.sql b/test/plsql/ws/test_gw_fct_setarcdivide.sql index db9030c21f..ebf8a0540e 100644 --- a/test/plsql/ws/test_gw_fct_setarcdivide.sql +++ b/test/plsql/ws/test_gw_fct_setarcdivide.sql @@ -10,13 +10,18 @@ SET client_min_messages TO WARNING; SET search_path = "SCHEMA_NAME", public, pg_catalog; +-- Plan for 1 test SELECT plan(1); -SELECT ok(1=1, 'One equals one'); --- TODO --- gw_fct_setarcdivide +-- Extract and test the "status" field from the function's JSON response +SELECT is ( + (gw_fct_setarcdivide($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, + "form":{}, "feature":{"id":["114468"]}, "data":{"filterFields":{}, "pageInfo":{}}}$$)::JSON)->>'status', + 'Accepted', + 'Check if gw_fct_setarcdivide returns status "Accepted"' +); -- Finish the test SELECT finish(); -ROLLBACK; +ROLLBACK; \ No newline at end of file diff --git a/test/plsql/ws/test_gw_fct_setchangefeaturetype.sql b/test/plsql/ws/test_gw_fct_setchangefeaturetype.sql new file mode 100644 index 0000000000..021d4437b8 --- /dev/null +++ b/test/plsql/ws/test_gw_fct_setchangefeaturetype.sql @@ -0,0 +1,28 @@ +/* +This file is part of Giswater 3 +The program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +This version of Giswater is provided by Giswater Association +*/ +BEGIN; + +-- Suppress NOTICE messages +SET client_min_messages TO WARNING; + +SET search_path = "SCHEMA_NAME", public, pg_catalog; + +-- Plan for 1 test +SELECT plan(1); + +-- Extract and test the "status" field from the function's JSON response +SELECT is ( + (gw_fct_setchangefeaturetype($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{}, + "feature":{"type":"node"}, "data":{"filterFields":{}, "pageInfo":{}, "feature_id":"1111", "feature_type_new":"REDUCTION", + "featurecat_id":"REDUC_110-63 PN16"}}$$)::JSON)->>'status', + 'Accepted', + 'Check if gw_fct_setchangefeaturetype returns status "Accepted"' +); + +-- Finish the test +SELECT finish(); + +ROLLBACK; \ No newline at end of file diff --git a/test/plsql/ws/test_gw_fct_setconfig.sql b/test/plsql/ws/test_gw_fct_setconfig.sql new file mode 100644 index 0000000000..7be9cc222e --- /dev/null +++ b/test/plsql/ws/test_gw_fct_setconfig.sql @@ -0,0 +1,34 @@ +/* +This file is part of Giswater 3 +The program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +This version of Giswater is provided by Giswater Association +*/ +BEGIN; + +-- Suppress NOTICE messages +SET client_min_messages TO WARNING; + +SET search_path = "SCHEMA_NAME", public, pg_catalog; + +-- Plan for 2 test +SELECT plan(2); + +-- Extract and test the "status" field from the function's JSON response +SELECT is ( + (gw_fct_setconfig($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{"formName":"epaoptions"}, + "feature":{}, "data":{"filterFields":{}, "pageInfo":{}, "fields":[]}}$$)::JSON)->>'status', + 'Accepted', + 'Check if gw_fct_setconfig --> "formName":"epaoptions" returns status "Accepted"' +); + +SELECT is ( + (gw_fct_setconfig($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{"formName":"config"}, + "feature":{}, "data":{"filterFields":{}, "pageInfo":{}, "fields":[]}}$$)::JSON)->>'status', + 'Accepted', + 'Check if gw_fct_setconfig --> "formName":"config" returns status "Accepted"' +); + +-- Finish the test +SELECT finish(); + +ROLLBACK; \ No newline at end of file diff --git a/test/plsql/ws/test_gw_fct_setdelete.sql b/test/plsql/ws/test_gw_fct_setdelete.sql new file mode 100644 index 0000000000..418a3a45cc --- /dev/null +++ b/test/plsql/ws/test_gw_fct_setdelete.sql @@ -0,0 +1,27 @@ +/* +This file is part of Giswater 3 +The program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +This version of Giswater is provided by Giswater Association +*/ +BEGIN; + +-- Suppress NOTICE messages +SET client_min_messages TO WARNING; + +SET search_path = "SCHEMA_NAME", public, pg_catalog; + +-- Plan for 1 test +SELECT plan(1); + +-- Extract and test the "status" field from the function's JSON response +SELECT is ( + (gw_fct_setdelete($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{}, "feature":{"id":["5"], "featureType":"PSECTOR", + "tableName":"v_ui_plan_psector", "idName":"psector_id"}, "data":{"filterFields":{}, "pageInfo":{}}}$$)::JSON)->>'status', + 'Accepted', + 'Check if gw_fct_setdelete returns status "Accepted"' +); + +-- Finish the test +SELECT finish(); + +ROLLBACK; \ No newline at end of file diff --git a/test/plsql/ws/test_gw_fct_setdimensioning.sql b/test/plsql/ws/test_gw_fct_setdimensioning.sql new file mode 100644 index 0000000000..e35f973783 --- /dev/null +++ b/test/plsql/ws/test_gw_fct_setdimensioning.sql @@ -0,0 +1,28 @@ +/* +This file is part of Giswater 3 +The program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +This version of Giswater is provided by Giswater Association +*/ +BEGIN; + +-- Suppress NOTICE messages +SET client_min_messages TO WARNING; + +SET search_path = "SCHEMA_NAME", public, pg_catalog; + +-- Plan for 1 test +SELECT plan(1); + +-- Extract and test the "status" field from the function's JSON response +SELECT is ( + (gw_fct_setdimensioning($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{}, + "feature":{"tableName":"v_edit_dimensions", "id":"2"}, "data":{"filterFields":{}, "pageInfo":{}, + "fields":{"direction_arrow":"False","state":"1","expl_id":"1","feature_type":""}}}$$)::JSON)->>'status', + 'Accepted', + 'Check if gw_fct_setdimensioning returns status "Accepted"' +); + +-- Finish the test +SELECT finish(); + +ROLLBACK; \ No newline at end of file diff --git a/test/plsql/ws/test_gw_fct_setendfeature.sql b/test/plsql/ws/test_gw_fct_setendfeature.sql new file mode 100644 index 0000000000..a9a007724a --- /dev/null +++ b/test/plsql/ws/test_gw_fct_setendfeature.sql @@ -0,0 +1,28 @@ +/* +This file is part of Giswater 3 +The program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +This version of Giswater is provided by Giswater Association +*/ +BEGIN; + +-- Suppress NOTICE messages +SET client_min_messages TO WARNING; + +SET search_path = "SCHEMA_NAME", public, pg_catalog; + +-- Plan for 1 test +SELECT plan(1); + +-- Extract and test the "status" field from the function's JSON response +SELECT is ( + (gw_fct_setendfeature($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{}, + "feature":[], "data":{"filterFields":{}, "pageInfo":{}, "state_type":"1", "enddate":"2024/08/13", + "workcat_date":"2000/01/01", "workcat_id_end":"work1"}}$$)::JSON)->>'status', + 'Accepted', + 'Check if gw_fct_setendfeature returns status "Accepted"' +); + +-- Finish the test +SELECT finish(); + +ROLLBACK; \ No newline at end of file diff --git a/test/plsql/ws/test_gw_fct_setfeaturedelete.sql b/test/plsql/ws/test_gw_fct_setfeaturedelete.sql new file mode 100644 index 0000000000..3f5f8f58d3 --- /dev/null +++ b/test/plsql/ws/test_gw_fct_setfeaturedelete.sql @@ -0,0 +1,27 @@ +/* +This file is part of Giswater 3 +The program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +This version of Giswater is provided by Giswater Association +*/ +BEGIN; + +-- Suppress NOTICE messages +SET client_min_messages TO WARNING; + +SET search_path = "SCHEMA_NAME", public, pg_catalog; + +-- Plan for 1 test +SELECT plan(1); + +-- Extract and test the "status" field from the function's JSON response +SELECT is ( + (gw_fct_setfeaturedelete($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{}, + "feature":{"type":"CONNEC"}, "data":{"filterFields":{}, "pageInfo":{}, "feature_id":"114258"}}$$)::JSON)->>'status', + 'Accepted', + 'Check if gw_fct_setfeaturedelete returns status "Accepted"' +); + +-- Finish the test +SELECT finish(); + +ROLLBACK; \ No newline at end of file diff --git a/test/plsql/ws/test_gw_fct_setlinktonetwork.sql b/test/plsql/ws/test_gw_fct_setlinktonetwork.sql index 826b1d6014..2dc4aaea16 100644 --- a/test/plsql/ws/test_gw_fct_setlinktonetwork.sql +++ b/test/plsql/ws/test_gw_fct_setlinktonetwork.sql @@ -10,8 +10,17 @@ SET client_min_messages TO WARNING; SET search_path = "SCHEMA_NAME", public, pg_catalog; +-- Plan for 1 test SELECT plan(1); -SELECT ok(1=1, 'One equals one'); + +-- Extract and test the "status" field from the function's JSON response +SELECT is ( + (gw_fct_setlinktonetwork($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{}, + "feature":{"id":"[114282, 114283, 114284, 114285, 114286, 114287, 114335, 114336, 114337, 114338, 114339, 114463, 3019, 3020, 3028]"}, + "data":{"filterFields":{}, "pageInfo":{}, "feature_type":"CONNEC"}}$$)::JSON)->>'status', + 'Accepted', + 'Check if gw_fct_setlinktonetwork returns status "Accepted"' +); -- TODO -- gw_fct_setlinktonetwork diff --git a/test/plsql/ws/test_gw_fct_setsearch.sql b/test/plsql/ws/test_gw_fct_setsearch.sql new file mode 100644 index 0000000000..a3659ac562 --- /dev/null +++ b/test/plsql/ws/test_gw_fct_setsearch.sql @@ -0,0 +1,65 @@ +/* +This file is part of Giswater 3 +The program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +This version of Giswater is provided by Giswater Association +*/ +BEGIN; + +-- Suppress NOTICE messages +SET client_min_messages TO WARNING; + +SET search_path = "SCHEMA_NAME", public, pg_catalog; + +-- Plan for 6 test +SELECT plan(6); + +-- Extract and test the "status" field from the function's JSON response +SELECT is ( + (gw_fct_setsearch($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{"tabName":"network"}, + "feature":{}, "data":{"filterFields":{}, "pageInfo":{}, "searchType":"arc", "net_type":{"id":"v_edit_arc", "name":"Arcs"}, + "net_code":{"text":"135 : PVC63-PN10"}, "addSchema":"NULL"}}$$)::JSON)->>'status', + 'Accepted', + 'Check if gw_fct_setsearch --> tabName":"network" returns status "Accepted"' +); + +SELECT is ( + (gw_fct_setsearch($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{"tabName":"address"}, + "feature":{}, "data":{"filterFields":{}, "pageInfo":{}, "add_muni":{"id":"1", "name":"Sant Boi del Llobregat"}, + "add_street":{"text":"Federico Garcia Lorca, C. de"}, "addSchema":"NULL"}}$$)::JSON)->>'status', + 'Accepted', + 'Check if gw_fct_setsearch --> tabName":"address" returns status "Accepted"' +); + +SELECT is ( + (gw_fct_setsearch($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{"tabName":"hydro"}, + "feature":{}, "data":{"filterFields":{}, "pageInfo":{}, "hydro_expl":{"id":"1", "name":"expl_01"}, + "hydro_search":{"text":"10099 - cc3010 - STATE1"}, "addSchema":"NULL", "hydro_contains":"True"}}$$)::JSON)->>'status', + 'Accepted', + 'Check if gw_fct_setsearch --> tabName":"hydro" returns status "Accepted"' +); + +SELECT is ( + (gw_fct_setsearch($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{"tabName":"workcat"}, + "feature":{}, "data":{"filterFields":{}, "pageInfo":{}, "workcat_search":{"text":"work1"}, "addSchema":"NULL"}}$$)::JSON)->>'status', + 'Accepted', + 'Check if gw_fct_setsearch --> tabName":"workcat" returns status "Accepted"' +); + +SELECT is ( + (gw_fct_setsearch($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{"tabName":"psector"}, + "feature":{}, "data":{"filterFields":{}, "pageInfo":{}, "psector_expl":{"id":"1", "name":"expl_01"}, + "psector_search":{"text":"Masterplan 01"}, "addSchema":"NULL"}}$$)::JSON)->>'status', + 'Accepted', + 'Check if gw_fct_setsearch --> tabName":"psector" returns status "Accepted"' +); + +SELECT is ( + (gw_fct_setsearch($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{"tabName":"visit"}, + "feature":{}, "data":{"filterFields":{}, "pageInfo":{}, "visit_search":{"text":"1"}, "addSchema":"NULL"}}$$)::JSON)->>'status', + 'Accepted', + 'Check if gw_fct_setsearch --> tabName":"visit" returns status "Accepted"' +); +-- Finish the test +SELECT finish(); + +ROLLBACK; \ No newline at end of file diff --git a/test/plsql/ws/test_gw_fct_setselectors.sql b/test/plsql/ws/test_gw_fct_setselectors.sql new file mode 100644 index 0000000000..3120b46006 --- /dev/null +++ b/test/plsql/ws/test_gw_fct_setselectors.sql @@ -0,0 +1,136 @@ +/* +This file is part of Giswater 3 +The program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +This version of Giswater is provided by Giswater Association +*/ +BEGIN; + +-- Suppress NOTICE messages +SET client_min_messages TO WARNING; + +SET search_path = "SCHEMA_NAME", public, pg_catalog; + +-- Plan for 14 test +SELECT plan(14); + +-- Extract and test the "status" field from the function's JSON response +SELECT is ( + (gw_fct_setselectors($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{}, "feature":{}, + "data":{"filterFields":{}, "pageInfo":{}, "selectorType":"selector_basic", "tabName":"tab_exploitation", "id":"1", + "isAlone":"True", "disableParent":"False", "value":"True", "addSchema":"NULL"}}$$)::JSON)->>'status', + 'Accepted', + 'Check if gw_fct_setselectors --> "tabName":"tab_exploitation" && "value":"True" returns status "Accepted"' +); + +SELECT is ( + (gw_fct_setselectors($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{}, "feature":{}, + "data":{"filterFields":{}, "pageInfo":{}, "selectorType":"selector_basic", "tabName":"tab_exploitation", "id":"1", + "isAlone":"True", "disableParent":"False", "value":"False", "addSchema":"NULL"}}$$)::JSON)->>'status', + 'Accepted', + 'Check if gw_fct_setselectors --> "tabName":"tab_exploitation" && "value":"False" returns status "Accepted"' +); + +SELECT is ( + (gw_fct_setselectors($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{}, "feature":{}, + "data":{"filterFields":{}, "pageInfo":{}, "selectorType":"selector_basic", "tabName":"tab_sector", "checkAll":"True", + "addSchema":"NULL"}}$$)::JSON)->>'status', + 'Accepted', + 'Check if gw_fct_setselectors --> "tabName":"tab_sector" && "checkAll":"True" returns status "Accepted"' +); + +SELECT is ( + (gw_fct_setselectors($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{}, "feature":{}, + "data":{"filterFields":{}, "pageInfo":{}, "selectorType":"selector_basic", "tabName":"tab_sector", "checkAll":"False", + "addSchema":"NULL"}}$$)::JSON)->>'status', + 'Accepted', + 'Check if gw_fct_setselectors --> "tabName":"tab_sector" && "checkAll":"False" returns status "Accepted"' +); + +SELECT is ( + (gw_fct_setselectors($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{}, "feature":{}, + "data":{"filterFields":{}, "pageInfo":{}, "selectorType":"selector_basic", "tabName":"tab_network_state", "id":"1", + "isAlone":"False", "disableParent":"False", "value":"True", "addSchema":"NULL"}}$$)::JSON)->>'status', + 'Accepted', + 'Check if gw_fct_setselectors --> "tabName":"tab_network_state" && "value":"True" returns status "Accepted"' +); + +SELECT is ( + (gw_fct_setselectors($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{}, "feature":{}, + "data":{"filterFields":{}, "pageInfo":{}, "selectorType":"selector_basic", "tabName":"tab_network_state", "id":"1", + "isAlone":"False", "disableParent":"False", "value":"False", "addSchema":"NULL"}}$$)::JSON)->>'status', + 'Accepted', + 'Check if gw_fct_setselectors --> "tabName":"tab_network_state" && "value":"False" returns status "Accepted"' +); + +SELECT is ( + (gw_fct_setselectors($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{}, "feature":{}, + "data":{"filterFields":{}, "pageInfo":{}, "selectorType":"selector_basic", "tabName":"tab_dscenario", "id":"1", + "isAlone":"False", "disableParent":"False", "value":"True", "addSchema":"NULL"}}$$)::JSON)->>'status', + 'Accepted', + 'Check if gw_fct_setselectors --> "tabName":"tab_dscenario" && "value":"True" returns status "Accepted"' +); + +SELECT is ( + (gw_fct_setselectors($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{}, "feature":{}, + "data":{"filterFields":{}, "pageInfo":{}, "selectorType":"selector_basic", "tabName":"tab_dscenario", "id":"1", + "isAlone":"False", "disableParent":"False", "value":"False", "addSchema":"NULL"}}$$)::JSON)->>'status', + 'Accepted', + 'Check if gw_fct_setselectors --> "tabName":"tab_dscenario" && "value":"False" returns status "Accepted"' +); + +SELECT is ( + (gw_fct_setselectors($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{}, "feature":{}, + "data":{"filterFields":{}, "pageInfo":{}, "selectorType":"selector_basic", "tabName":"tab_dscenario", + "checkAll":"True", "addSchema":"NULL"}}$$)::JSON)->>'status', + 'Accepted', + 'Check if gw_fct_setselectors --> "tabName":"tab_dscenario" && "checkAll":"True" returns status "Accepted"' +); + +SELECT is ( + (gw_fct_setselectors($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{}, "feature":{}, + "data":{"filterFields":{}, "pageInfo":{}, "selectorType":"selector_basic", "tabName":"tab_dscenario", + "checkAll":"False", "addSchema":"NULL"}}$$)::JSON)->>'status', + 'Accepted', + 'Check if gw_fct_setselectors --> "tabName":"tab_dscenario" && "checkAll":"False" returns status "Accepted"' +); + + +SELECT is ( + (gw_fct_setselectors($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{}, "feature":{}, + "data":{"filterFields":{}, "pageInfo":{}, "selectorType":"selector_basic", "tabName":"tab_hydro_state", "checkAll":"True", + "addSchema":"NULL"}}$$)::JSON)->>'status', + 'Accepted', + 'Check if gw_fct_setselectors --> "tabName":"tab_hydro_state" && "checkAll":"True" returns status "Accepted"' +); + +SELECT is ( + (gw_fct_setselectors($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{}, "feature":{}, + "data":{"filterFields":{}, "pageInfo":{}, "selectorType":"selector_basic", "tabName":"tab_hydro_state", "checkAll":"False", + "addSchema":"NULL"}}$$)::JSON)->>'status', + 'Accepted', + 'Check if gw_fct_setselectors --> "tabName":"tab_hydro_state" && "checkAll":"False" returns status "Accepted"' +); + +SELECT is ( + (gw_fct_setselectors($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{}, "feature":{}, + "data":{"filterFields":{}, "pageInfo":{}, "selectorType":"selector_basic", "tabName":"tab_psector", "checkAll":"True", + "addSchema":"NULL"}}$$)::JSON)->>'status', + 'Accepted', + 'Check if gw_fct_setselectors --> "tabName":"tab_psector" && "checkAll":"True" returns status "Accepted"' +); + +SELECT is ( + (gw_fct_setselectors($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{}, "feature":{}, + "data":{"filterFields":{}, "pageInfo":{}, "selectorType":"selector_basic", "tabName":"tab_psector", "checkAll":"False", + "addSchema":"NULL"}}$$)::JSON)->>'status', + 'Accepted', + 'Check if gw_fct_setselectors --> "tabName":"tab_psector" && "checkAll":"False" returns status "Accepted"' +); + + + + +-- Finish the test +SELECT finish(); + +ROLLBACK; \ No newline at end of file diff --git a/test/plsql/ws/test_gw_fct_upsertfields.sql b/test/plsql/ws/test_gw_fct_upsertfields.sql new file mode 100644 index 0000000000..feb21d2a35 --- /dev/null +++ b/test/plsql/ws/test_gw_fct_upsertfields.sql @@ -0,0 +1,37 @@ +/* +This file is part of Giswater 3 +The program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +This version of Giswater is provided by Giswater Association +*/ +BEGIN; + +-- Suppress NOTICE messages +SET client_min_messages TO WARNING; + +SET search_path = "SCHEMA_NAME", public, pg_catalog; + +-- Plan for 2 test +SELECT plan(2); + +-- Extract and test the "status" field from the function's JSON response +SELECT is ( + (gw_fct_upsertfields($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{}, "feature":{"id":"1, 2", "tableName":"plan_netscenario_dma"}, + "data":{"filterFields":{}, "pageInfo":{}, "fields":{"netscenario_id": "1", "dma_id": "2", "dma_name": "dma1-2d", "pattern_id": "PTN-DMA-02-DEF", + "graphconfig": "{\"use\": [{\"nodeParent\": \"1080\", \"toArc\": [2092]}], \"ignore\": [], \"forceClosed\": []}", "active": "true"}, "force_action":"UPDATE"}}$$)::JSON)->>'status', + 'Accepted', + 'Check if gw_fct_upsertfields --> "tableName":"plan_netscenario_dma" returns status "Accepted"' +); + +SELECT is ( + (gw_fct_upsertfields($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{}, "feature":{"id":"1, None", "tableName":"inp_dscenario_demand"}, + "data":{"filterFields":{}, "pageInfo":{}, "fields":{"dscenario_id": "1", "feature_type": "NODE", "demand": "8.000000", "pattern_id": "PTN-HYDRANT", "demand_type": "3", + "source": "NODE 1012"}, "force_action":"UPDATE"}}$$)::JSON)->>'status', + 'Accepted', + 'Check if gw_fct_upsertfields --> "tableName":"inp_dscenario_demand" returns status "Accepted"' +); + + +-- Finish the test +SELECT finish(); + +ROLLBACK; \ No newline at end of file diff --git a/test/plsql/ws/test_gw_fct_workspacemanager.sql b/test/plsql/ws/test_gw_fct_workspacemanager.sql new file mode 100644 index 0000000000..5f957b37d9 --- /dev/null +++ b/test/plsql/ws/test_gw_fct_workspacemanager.sql @@ -0,0 +1,27 @@ +/* +This file is part of Giswater 3 +The program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +This version of Giswater is provided by Giswater Association +*/ +BEGIN; + +-- Suppress NOTICE messages +SET client_min_messages TO WARNING; + +SET search_path = "SCHEMA_NAME", public, pg_catalog; + +-- Plan for 1 test +SELECT plan(1); + +-- Extract and test the "status" field from the function's JSON response +SELECT is ( + (gw_fct_workspacemanager($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, + "form":{}, "feature":{}, "data":{"filterFields":{}, "pageInfo":{}, "action":"CHECK"}}$$)::JSON)->>'status', + 'Accepted', + 'Check if gw_fct_workspacemanager returns status "Accepted"' +); + +-- Finish the test +SELECT finish(); + +ROLLBACK; \ No newline at end of file