Skip to content

Commit 408ff9f

Browse files
committed
Merge branch 'dev-3.6' of https://github.com/Giswater/giswater_dbmodel into dev-3.6
2 parents 4132e16 + 15e70a9 commit 408ff9f

File tree

6 files changed

+321
-12
lines changed

6 files changed

+321
-12
lines changed

test/plsql/ud/test_gw_fct_config_mapzones.sql

Lines changed: 34 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,48 @@ SET client_min_messages TO WARNING;
1010

1111
SET search_path = "SCHEMA_NAME", public, pg_catalog;
1212

13-
-- Plan for 2 test
14-
SELECT plan(2);
13+
-- Plan for 5 test
14+
SELECT plan(5);
1515

1616
-- Extract and test the "status" field from the function's JSON response
1717
SELECT is (
18-
(gw_fct_getprofile($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{}, "feature":{},
19-
"data":{"filterFields":{}, "pageInfo":{}}}$$)::JSON)->>'status',
18+
(gw_fct_config_mapzones($${"client":{"device":4, "lang":"NULL", "infoType":1, "epsg":25831}, "form":{}, "feature":{}, "data":{"filterFields":{}, "pageInfo":{},
19+
"parameters": {"action": "UPDATE", "configZone": "drainzone", "mapzoneId": "-1",
20+
"config": {"use":[{"nodeParent":""}], "ignore":[], "forceClosed":[]}}}}$$)::JSON)->>'status',
2021
'Accepted',
21-
'Check if gw_fct_getprofile returns status "Accepted"'
22+
'Check if gw_fct_config_mapzones with action "UPDATE" returns status "Accepted"'
2223
);
2324

2425
SELECT is (
25-
(gw_fct_config_mapzones($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{}, "feature":{},
26-
"data":{"filterFields":{}, "pageInfo":{}, "parameters": {"action": "UPDATE", "configZone": "drainzone",
27-
"mapzoneId": "-1", "config": {"use":[{"nodeParent":""}], "ignore":[], "forceClosed":[]}}}}$$)::JSON)->>'status',
26+
(gw_fct_config_mapzones($${"client":{"device":4, "lang":"NULL", "infoType":1, "epsg":25831}, "form":{}, "feature":{}, "data":{"filterFields":{}, "pageInfo":{},
27+
"parameters": {"action": "ADD", "configZone": "drainzone", "mapzoneId": "-1", "nodeParent": "82", "toArc": [], "config": {"use":[{"nodeParent":""}], "ignore":[],
28+
"forceClosed":[]}}}}$$)::JSON)->>'status',
2829
'Accepted',
29-
'Check if gw_fct_getprofile with parameters returns status "Accepted"'
30+
'Check if gw_fct_config_mapzones with action "ADD" and 4th parameter is "nodeParent" returns status "Accepted"'
31+
);
32+
33+
SELECT is (
34+
(gw_fct_config_mapzones($${"client":{"device":4, "lang":"NULL", "infoType":1, "epsg":25831}, "form":{}, "feature":{}, "data":{"filterFields":{}, "pageInfo":{},
35+
"parameters": {"action": "ADD", "configZone": "drainzone", "mapzoneId": "-1", "forceClosed": ["82"], "config": {"use": [{"nodeParent": "82"}], "ignore": [],
36+
"forceClosed": []}}}}$$)::JSON)->>'status',
37+
'Accepted',
38+
'Check if gw_fct_config_mapzones with action "ADD" and 4th parameter is "forceClosed" returns status "Accepted"'
39+
);
40+
41+
SELECT is (
42+
(gw_fct_config_mapzones($${"client":{"device":4, "lang":"NULL", "infoType":1, "epsg":25831}, "form":{}, "feature":{}, "data":{"filterFields":{}, "pageInfo":{},
43+
"parameters": {"action": "REMOVE", "configZone": "drainzone", "mapzoneId": "-1", "nodeParent": "82", "config": {"use": [{"nodeParent": "82"}], "ignore": [],
44+
"forceClosed": []}}}}$$)::JSON)->>'status',
45+
'Accepted',
46+
'Check if gw_fct_config_mapzones with action "REMOVE" and 4th parameter is "nodeParent" returns status "Accepted"'
47+
);
48+
49+
SELECT is (
50+
(gw_fct_config_mapzones($${"client":{"device":4, "lang":"NULL", "infoType":1, "epsg":25831}, "form":{}, "feature":{}, "data":{"filterFields":{}, "pageInfo":{},
51+
"parameters": {"action": "REMOVE", "configZone": "drainzone", "mapzoneId": "-1", "forceClosed": ["82"],
52+
"config": {"use": [{"nodeParent": "82"}], "ignore": [], "forceClosed": [82]}}}}$$)::JSON)->>'status',
53+
'Accepted',
54+
'Check if gw_fct_config_mapzones with action "REMOVE" and 4th parameter is "forceClosed" returns status "Accepted"'
3055
);
3156

3257
-- Finish the test

test/plsql/ws/test_gw_fct_config_mapzones.sql

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,47 @@ SET client_min_messages TO WARNING;
1010

1111
SET search_path = "SCHEMA_NAME", public, pg_catalog;
1212

13-
-- Plan for 1 test
14-
SELECT plan(1);
13+
-- Plan for 5 test
14+
SELECT plan(5);
1515

1616
-- Extract and test the "status" field from the function's JSON response
1717
SELECT is (
1818
(gw_fct_config_mapzones($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{}, "feature":{}, "data":{"filterFields":{}, "pageInfo":{},
1919
"parameters": {"action": "UPDATE", "configZone": "dma", "mapzoneId": "2", "config": {"use":[], "ignore":[], "forceClosed":[]}, "netscenarioId": 1}}}$$)::JSON)->>'status',
2020
'Accepted',
21-
'Check if gw_fct_config_mapzones returns status "Accepted"'
21+
'Check if gw_fct_config_mapzones with action "UPDATE" returns status "Accepted"'
22+
);
23+
24+
SELECT is (
25+
(gw_fct_config_mapzones($${"client":{"device":4, "lang":"NULL", "infoType":1, "epsg":25831}, "form":{}, "feature":{}, "data":{"filterFields":{}, "pageInfo":{},
26+
"parameters": {"action": "ADD", "configZone": "sector", "mapzoneId": "1", "nodeParent": "1010", "toArc": ["2018"], "config": {"use": [{"toArc": [2207], "nodeParent": "1097"}],
27+
"ignore": [], "forceClosed": [1010]}}}}$$)::JSON)->>'status',
28+
'Accepted',
29+
'Check if gw_fct_config_mapzones with action "ADD" and 4th parameter is "nodeParent" returns status "Accepted"'
30+
);
31+
32+
SELECT is (
33+
(gw_fct_config_mapzones($${"client":{"device":4, "lang":"NULL", "infoType":1, "epsg":25831}, "form":{}, "feature":{}, "data":{"filterFields":{}, "pageInfo":{},
34+
"parameters": {"action": "ADD", "configZone": "sector", "mapzoneId": "1", "forceClosed": ["1010"], "config": {"use": [{"toArc": [2207], "nodeParent": "1097"},
35+
{"toArc": [2018], "nodeParent": "1010"}], "ignore": [], "forceClosed": [1010]}}}}$$)::JSON)->>'status',
36+
'Accepted',
37+
'Check if gw_fct_config_mapzones with action "ADD" and 4th parameter is "forceClosed" returns status "Accepted"'
38+
);
39+
40+
SELECT is (
41+
(gw_fct_config_mapzones($${"client":{"device":4, "lang":"NULL", "infoType":1, "epsg":25831}, "form":{}, "feature":{}, "data":{"filterFields":{}, "pageInfo":{},
42+
"parameters": {"action": "REMOVE", "configZone": "sector", "mapzoneId": "1", "nodeParent": "1010", "config": {"use": [{"toArc": [2207], "nodeParent": "1097"},
43+
{"toArc": [2018], "nodeParent": "1010"}], "ignore": [], "forceClosed": [1010]}}}}$$)::JSON)->>'status',
44+
'Accepted',
45+
'Check if gw_fct_config_mapzones with action "REMOVE" and 4th parameter is "nodeParent" returns status "Accepted"'
46+
);
47+
48+
SELECT is (
49+
(gw_fct_config_mapzones($${"client":{"device":4, "lang":"NULL", "infoType":1, "epsg":25831}, "form":{}, "feature":{}, "data":{"filterFields":{}, "pageInfo":{},
50+
"parameters": {"action": "REMOVE", "configZone": "sector", "mapzoneId": "1", "forceClosed": ["1010"], "config": {"use": [{"toArc": [2207], "nodeParent": "1097"}],
51+
"ignore": [], "forceClosed": [1010]}}}}$$)::JSON)->>'status',
52+
'Accepted',
53+
'Check if gw_fct_config_mapzones with action "REMOVE" and 4th parameter is "forceClosed" returns status "Accepted"'
2254
);
2355

2456
-- Finish the test

0 commit comments

Comments
 (0)