Skip to content

Commit cc90f22

Browse files
committed
tests: add correct ud tests from plsql, structure and upsert
1 parent 2ba0a7d commit cc90f22

19 files changed

+730
-133
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/*
2+
This file is part of Giswater 3
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.
4+
This version of Giswater is provided by Giswater Association
5+
*/
6+
BEGIN;
7+
8+
SET search_path = "SCHEMA_NAME", public, pg_catalog;
9+
10+
-- Plan for 2 test
11+
SELECT plan(2);
12+
13+
-- Extract and test the "status" field from the function's JSON response
14+
SELECT is(
15+
(gw_fct_anl_arc_duplicated($${"client":{"device":4, "infoType":1, "lang":"ES"},
16+
"form":{},"feature":{"tableName":"v_edit_arc", "id":[]}, "data":{"filterFields":{}, "pageInfo":{},
17+
"selectionMode":"wholeSelection", "parameters":{"checkType":"finalNodes"}}}$$)::JSON)->>'status',
18+
'Accepted',
19+
'Check if gw_fct_anl_arc_duplicated -> wholeSelection returns status "Accepted"'
20+
);
21+
22+
SELECT is(
23+
(gw_fct_anl_arc_duplicated($${"client":{"device":4, "infoType":1, "lang":"ES"},
24+
"form":{},"feature":{"tableName":"v_edit_arc", "id":[132,133]}, "data":{"filterFields":{}, "pageInfo":{},
25+
"selectionMode":"previousSelection", "parameters":{"checkType":"finalNodes"}}}$$)::JSON)->>'status',
26+
'Accepted',
27+
'Check if gw_fct_anl_arc_duplicated -> previousSelection returns status "Accepted"'
28+
);
29+
30+
-- Finish the test
31+
SELECT finish();
32+
33+
ROLLBACK;
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/*
2+
This file is part of Giswater 3
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.
4+
This version of Giswater is provided by Giswater Association
5+
*/
6+
BEGIN;
7+
8+
SET search_path = "SCHEMA_NAME", public, pg_catalog;
9+
10+
-- Plan for 2 test
11+
SELECT plan(2);
12+
13+
-- Extract and test the "status" field from the function's JSON response
14+
SELECT is (
15+
(gw_fct_anl_arc_length($${"client":{"device":4, "infoType":1, "lang":"ES"}, "form":{},
16+
"feature":{"tableName":"v_edit_arc", "featureType":"ARC", "id":[132,133]},
17+
"data":{"selectionMode":"previousSelection","parameters":{"arcLength":"3"}}}$$)::JSON)->>'status',
18+
'Accepted',
19+
'Check if gw_fct_anl_arc_length -> previousSelection returns status "Accepted"'
20+
);
21+
22+
23+
SELECT is (
24+
(gw_fct_anl_arc_length($${"client":{"device":4, "infoType":1, "lang":"ES"},"form":{},
25+
"feature":{"tableName":"v_edit_arc", "featureType":"ARC", "id":[]},
26+
"data":{"selectionMode":"wholeSelection","parameters":{"arcLength":"3"}}}$$)::JSON)->>'status',
27+
'Accepted',
28+
'Check if gw_fct_anl_arc_length -> wholeSelection returns status "Accepted"'
29+
);
30+
31+
32+
-- Finish the test
33+
SELECT finish();
34+
35+
ROLLBACK;
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/*
2+
This file is part of Giswater 3
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.
4+
This version of Giswater is provided by Giswater Association
5+
*/
6+
BEGIN;
7+
8+
SET search_path = "SCHEMA_NAME", public, pg_catalog;
9+
SET client_min_messages TO WARNING;
10+
11+
-- Plan for 1 test
12+
SELECT plan(1);
13+
14+
-- Extract and test the "status" field from the function's JSON response
15+
SELECT is (
16+
(gw_fct_anl_arc_no_startend_node($${"client":{"device":4, "infoType":1, "lang":"ES"},
17+
"feature":{"tableName":"v_edit_arc", "featureType":"ARC"},
18+
"data":{"parameters":{"arcSearchNodes":"0.1"}}}$$)::JSON)->>'status',
19+
'Accepted',
20+
'Check if gw_fct_anl_arc_no_startend_node returns status "Accepted"'
21+
);
22+
23+
-- Finish the test
24+
SELECT finish();
25+
26+
ROLLBACK;
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/*
2+
This file is part of Giswater 3
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.
4+
This version of Giswater is provided by Giswater Association
5+
*/
6+
BEGIN;
7+
8+
SET search_path = "SCHEMA_NAME", public, pg_catalog;
9+
SET client_min_messages TO WARNING;
10+
11+
-- Plan for 2 test
12+
SELECT plan(2);
13+
14+
-- Extract and test the "status" field from the function's JSON response
15+
SELECT is (
16+
(gw_fct_anl_arc_same_startend($${"client":{"device":4, "infoType":1, "lang":"ES"},
17+
"feature":{"tableName":"v_edit_arc", "id":[132,133]},
18+
"data":{"selectionMode":"previousSelection","parameters":{}}}$$)::JSON)->>'status',
19+
'Accepted',
20+
'Check if gw_fct_anl_arc_same_startend returns status "Accepted"'
21+
);
22+
23+
SELECT is (
24+
(gw_fct_anl_arc_same_startend($${"client":{"device":4, "infoType":1, "lang":"ES"},
25+
"feature":{"tableName":"v_edit_arc"},
26+
"data":{"selectionMode":"wholeSelection","parameters":{}}}$$)::JSON)->>'status',
27+
'Accepted',
28+
'Check if gw_fct_anl_arc_same_startend returns status "Accepted"'
29+
);
30+
31+
-- Finish the test
32+
SELECT finish();
33+
34+
ROLLBACK;
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/*
2+
This file is part of Giswater 3
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.
4+
This version of Giswater is provided by Giswater Association
5+
*/
6+
BEGIN;
7+
8+
SET search_path = "SCHEMA_NAME", public, pg_catalog;
9+
10+
-- Plan for 2 test
11+
SELECT plan(2);
12+
13+
-- Extract and test the "status" field from the function's JSON response
14+
SELECT is (
15+
(gw_fct_anl_connec_duplicated($${"client":{"device":4, "infoType":1, "lang":"ES"},
16+
"feature":{"tableName":"v_edit_connec"}, "data":{"selectionMode":"wholeSelection",
17+
"parameters":{"connecTolerance":10}, "parameters":{}}}$$)::JSON)->>'status',
18+
'Accepted',
19+
'Check if gw_fct_anl_connec_duplicated -> wholeSelection returns status "Accepted"'
20+
);
21+
22+
SELECT is (
23+
(gw_fct_anl_connec_duplicated($${"client":{"device":4, "infoType":1, "lang":"ES"},
24+
"feature":{"tableName":"v_edit_connec", "id":[3101, 3102]}, "data":{"selectionMode":"previousSelection",
25+
"parameters":{"connecTolerance":10}}}$$)::JSON)->>'status',
26+
'Accepted',
27+
'Check if gw_fct_anl_connec_duplicated -> previousSelection returns status "Accepted"'
28+
);
29+
30+
31+
-- Finish the test
32+
SELECT finish();
33+
34+
ROLLBACK;
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*
2+
This file is part of Giswater 3
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.
4+
This version of Giswater is provided by Giswater Association
5+
*/
6+
BEGIN;
7+
8+
SET search_path = "SCHEMA_NAME", public, pg_catalog;
9+
10+
SELECT plan(2);
11+
12+
SELECT is (
13+
(gw_fct_graphanalytics_downstream($${"client":{"device":4, "infoType":1, "lang":"ES"},
14+
"feature":{"id":["20607"]},"data":{}}$$)::JSON)->>'status',
15+
'Accepted',
16+
'Check if gw_fct_graphanalytics_downstream returns status "Accepted"'
17+
)
18+
19+
SELECT is (
20+
(SELECT gw_fct_graphanalytics_downstream($${"client":{"device":4, "infoType":1, "lang":"ES"},
21+
"feature":{},"data":{ "coordinates":{"xcoord":419277.7306855297,"ycoord":4576625.674511955,
22+
"zoomRatio":3565.9967217571534}}}$$)::JSON)->>'status',
23+
'Accepted',
24+
'Check if gw_fct_graphanalytics_downstream with coordinates returns status "Accepted"'
25+
)
26+
27+
-- Finish the test
28+
SELECT finish();
29+
30+
ROLLBACK;
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/*
2+
This file is part of Giswater 3
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.
4+
This version of Giswater is provided by Giswater Association
5+
*/
6+
BEGIN;
7+
8+
SET search_path = "SCHEMA_NAME", public, pg_catalog;
9+
10+
SELECT plan(1);
11+
SELECT ok(1=1, 'One equals one');
12+
13+
-- TODO
14+
-- gw_fct_graphanalytics_mapzones_advanced
15+
16+
-- Finish the test
17+
SELECT finish();
18+
19+
ROLLBACK;
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*
2+
This file is part of Giswater 3
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.
4+
This version of Giswater is provided by Giswater Association
5+
*/
6+
BEGIN;
7+
8+
SET search_path = "SCHEMA_NAME", public, pg_catalog;
9+
10+
SELECT plan(2);
11+
12+
SELECT is (
13+
(gw_fct_graphanalytics_upstream($${"client":{"device":4, "infoType":1, "lang":"ES"},
14+
"feature":{"id":["20607"]},"data":{}}$$)::JSON)->>'status',
15+
'Accepted',
16+
'Check if gw_fct_graphanalytics_upstream returns status "Accepted"'
17+
)
18+
19+
SELECT is (
20+
(gw_fct_graphanalytics_upstream($${"client":{"device":4, "infoType":1, "lang":"ES"},
21+
"feature":{},"data":{"coordinates":{"xcoord":419278.0533606678,"ycoord":4576625.482073168,
22+
"zoomRatio":437.2725774103561}}}$$)::JSON)->>'status',
23+
'Accepted',
24+
'Check if gw_fct_graphanalytics_upstream with coordinates returns status "Accepted"'
25+
)
26+
27+
-- Finish the test
28+
SELECT finish();
29+
30+
ROLLBACK;
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/*
2+
This file is part of Giswater 3
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.
4+
This version of Giswater is provided by Giswater Association
5+
*/
6+
BEGIN;
7+
8+
SET search_path = "SCHEMA_NAME", public, pg_catalog;
9+
10+
SELECT plan(1);
11+
SELECT ok(1=1, 'One equals one');
12+
13+
-- TODO
14+
-- gw_fct_pg2epa_main
15+
-- SELECT gw_fct_pg2epa_main($${"client":{"device":4, "infoType":1, "lang":"ES", "epsg":25831}, "data":{"resultId":"test1", "step":"1"}}$$);
16+
-- SELECT gw_fct_pg2epa_main($${"client":{"device":4, "infoType":1, "lang":"ES", "epsg":25831}, "data":{"resultId":"test1", "step":"2"}}$$);
17+
-- SELECT gw_fct_pg2epa_main($${"client":{"device":4, "infoType":1, "lang":"ES", "epsg":25831}, "data":{"resultId":"test1", "step":"3"}}$$);
18+
-- SELECT gw_fct_pg2epa_main($${"client":{"device":4, "infoType":1, "lang":"ES", "epsg":25831}, "data":{"resultId":"test1", "step":"4"}}$$);
19+
-- SELECT gw_fct_pg2epa_main($${"client":{"device":4, "infoType":1, "lang":"ES", "epsg":25831}, "data":{"resultId":"test1", "step":"5"}}$$);
20+
-- SELECT gw_fct_pg2epa_main($${"client":{"device":4, "infoType":1, "lang":"ES", "epsg":25831}, "data":{"resultId":"test1", "step":"6"}}$$);
21+
-- SELECT gw_fct_pg2epa_main($${"client":{"device":4, "infoType":1, "lang":"ES", "epsg":25831}, "data":{"resultId":"test1", "step":"7"}}$$);
22+
23+
-- Finish the test
24+
SELECT finish();
25+
26+
ROLLBACK;

test/plsql/ud/test_plsql_ud_plan.sql renamed to test/plsql/ud/test_gw_fct_setarcdivide.sql

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,17 @@ This file is part of Giswater 3
33
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.
44
This version of Giswater is provided by Giswater Association
55
*/
6+
BEGIN;
67

7-
-- gw_fct_graphanalytics_mapzones
8+
SET search_path = "SCHEMA_NAME", public, pg_catalog;
89

10+
SELECT plan(1);
11+
SELECT ok(1=1, 'One equals one');
912

13+
-- TODO
14+
-- gw_fct_setarcdivide
15+
16+
-- Finish the test
17+
SELECT finish();
18+
19+
ROLLBACK;

test/plsql/ud/test_plsql_ud_basic.sql renamed to test/plsql/ud/test_gw_fct_setarcfusion.sql

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,17 @@ This file is part of Giswater 3
33
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.
44
This version of Giswater is provided by Giswater Association
55
*/
6+
BEGIN;
67

8+
SET search_path = "SCHEMA_NAME", public, pg_catalog;
9+
10+
SELECT plan(1);
11+
SELECT ok(1=1, 'One equals one');
12+
13+
-- TODO
14+
-- gw_fct_setarcdivide
15+
16+
-- Finish the test
17+
SELECT finish();
18+
19+
ROLLBACK;
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/*
2+
This file is part of Giswater 3
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.
4+
This version of Giswater is provided by Giswater Association
5+
*/
6+
BEGIN;
7+
8+
SET search_path = "SCHEMA_NAME", public, pg_catalog;
9+
10+
SELECT plan(1);
11+
SELECT ok(1=1, 'One equals one');
12+
13+
-- TODO
14+
-- gw_fct_setlinktonetwork
15+
-- SELECT gw_fct_setlinktonetwork($${"client":{"device":4, "infoType":1, "lang":"ES"},
16+
-- "feature":{"id":["10117","10118"]},"data":{"feature_type":"CONNEC", "forcedArcs":["2001","2002"]}}$$);
17+
18+
-- SELECT gw_fct_setlinktonetwork($${"client":{"device":4, "infoType":1, "lang":"ES"},
19+
-- "feature":{"id":["30012"]},"data":{"feature_type":"CONNEC"}}$$);
20+
21+
-- SELECT gw_fct_setlinktonetwork($${"client":{"device":4, "infoType":1, "lang":"ES"},
22+
-- "feature":{"id":["30014"]},"data":{"feature_type":"GULLY"}}$$);
23+
24+
25+
26+
-- Finish the test
27+
SELECT finish();
28+
29+
ROLLBACK;

test/plsql/ud/test_plsql_ud_edit.sql

Lines changed: 0 additions & 21 deletions
This file was deleted.

test/plsql/ud/test_plsql_ud_epa.sql

Lines changed: 0 additions & 15 deletions
This file was deleted.

test/plsql/ud/test_plsql_ud_om.sql

Lines changed: 0 additions & 16 deletions
This file was deleted.

0 commit comments

Comments
 (0)