Skip to content

Commit

Permalink
tests(ws): remove toolbar files, and create each function test file
Browse files Browse the repository at this point in the history
  • Loading branch information
danimarinBG committed Aug 13, 2024
1 parent 20683f0 commit 425440e
Show file tree
Hide file tree
Showing 12 changed files with 193 additions and 79 deletions.
33 changes: 33 additions & 0 deletions test/plsql/ws/test_gw_fct_anl_arc_length.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
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;

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_anl_arc_length($${"client":{"device":4, "infoType":1, "lang":"ES"}, "form":{},"feature":{"tableName":"v_edit_arc",
"featureType":"ARC", "id":[2001,2002]}, "data":{"selectionMode":"previousSelection","parameters":{"arcLength":"3"}}}$$)::JSON)->>'status',
'Accepted',
'Check if gw_fct_anl_arc_length -> previousSelection returns status "Accepted"'
);


SELECT is (
(gw_fct_anl_arc_length($${"client":{"device":4, "infoType":1, "lang":"ES"},"form":{},"feature":{"tableName":"v_edit_arc",
"featureType":"ARC", "id":[]}, "data":{"selectionMode":"wholeSelection","parameters":{"arcLength":"3"}}}$$)::JSON)->>'status',
'Accepted',
'Check if gw_fct_anl_arc_length -> wholeSelection returns status "Accepted"'
);


-- Finish the test
SELECT finish();

ROLLBACK;
24 changes: 24 additions & 0 deletions test/plsql/ws/test_gw_fct_anl_arc_no_startend_node.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
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;

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_anl_arc_no_startend_node($${"client":{"device":4, "infoType":1, "lang":"ES"}, "feature":{"tableName":"v_edit_arc",
"featureType":"ARC"}, "data":{"parameters":{"arcSearchNodes":"0.1"}}}$$)::JSON)->>'status',
'Accepted',
'Check if gw_fct_anl_arc_no_startend_node returns status "Accepted"'
);

-- Finish the test
SELECT finish();

ROLLBACK;
32 changes: 32 additions & 0 deletions test/plsql/ws/test_gw_fct_anl_arc_same_startend.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
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;

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_anl_arc_same_startend($${"client":{"device":4, "infoType":1, "lang":"ES"},
"feature":{"tableName":"v_edit_arc", "id":[2001,2002]}, "data":{"selectionMode":"previousSelection","parameters":{}}}$$)::JSON)->>'status',
'Accepted',
'Check if gw_fct_anl_arc_same_startend -> previousSelection returns status "Accepted"'
);

SELECT is (
(gw_fct_anl_arc_same_startend($${"client":{"device":4, "infoType":1, "lang":"ES"},
"feature":{"tableName":"v_edit_arc"}, "data":{"selectionMode":"wholeSelection","parameters":{}}}$$)::JSON)->>'status',
'Accepted',
'Check if gw_fct_anl_arc_same_startend -> wholeSelection returns status "Accepted"'
);


-- Finish the test
SELECT finish();

ROLLBACK;
32 changes: 32 additions & 0 deletions test/plsql/ws/test_gw_fct_anl_connec_duplicated.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
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;

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_anl_connec_duplicated($${"client":{"device":4, "infoType":1, "lang":"ES"},"feature":{"tableName":"v_edit_connec"},
"data":{"selectionMode":"wholeSelection", "parameters":{"connecTolerance":10}, "parameters":{}}}$$)::JSON)->>'status',
'Accepted',
'Check if gw_fct_anl_connec_duplicated -> wholeSelection returns status "Accepted"'
);

SELECT is (
(gw_fct_anl_connec_duplicated($${"client":{"device":4, "infoType":1, "lang":"ES"},"feature":{"tableName":"v_edit_connec",
"id":[3101, 3102]}, "data":{"selectionMode":"previousSelection", "parameters":{"connecTolerance":10}, "parameters":{}}}$$)::JSON)->>'status',
'Accepted',
'Check if gw_fct_anl_connec_duplicated -> previousSelection returns status "Accepted"'
);


-- Finish the test
SELECT finish();

ROLLBACK;
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,13 @@ 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;

SET search_path = "SCHEMA_NAME", public, pg_catalog;

-- gw_fct_graphanalytics_mapzones

-- Finish the test
SELECT finish();

ROLLBACK;
22 changes: 22 additions & 0 deletions test/plsql/ws/test_gw_fct_pg2epa_main.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
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;

SET search_path = "SCHEMA_NAME", public, pg_catalog;

-- gw_fct_pg2epa_main
-- SELECT gw_fct_pg2epa_main($${"client":{"device":4, "infoType":1, "lang":"ES", "epsg":25831}, "data":{"resultId":"test1", "step":"1"}}$$);
-- SELECT gw_fct_pg2epa_main($${"client":{"device":4, "infoType":1, "lang":"ES", "epsg":25831}, "data":{"resultId":"test1", "step":"2"}}$$);
-- SELECT gw_fct_pg2epa_main($${"client":{"device":4, "infoType":1, "lang":"ES", "epsg":25831}, "data":{"resultId":"test1", "step":"3"}}$$);
-- SELECT gw_fct_pg2epa_main($${"client":{"device":4, "infoType":1, "lang":"ES", "epsg":25831}, "data":{"resultId":"test1", "step":"4"}}$$);
-- SELECT gw_fct_pg2epa_main($${"client":{"device":4, "infoType":1, "lang":"ES", "epsg":25831}, "data":{"resultId":"test1", "step":"5"}}$$);
-- SELECT gw_fct_pg2epa_main($${"client":{"device":4, "infoType":1, "lang":"ES", "epsg":25831}, "data":{"resultId":"test1", "step":"6"}}$$);
-- SELECT gw_fct_pg2epa_main($${"client":{"device":4, "infoType":1, "lang":"ES", "epsg":25831}, "data":{"resultId":"test1", "step":"7"}}$$);

-- Finish the test
SELECT finish();

ROLLBACK;
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,13 @@ 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;

SET search_path = "SCHEMA_NAME", public, pg_catalog;

-- gw_fct_setarcdivide

-- Finish the test
SELECT finish();

ROLLBACK;
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,13 @@ 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;

-- gw_fct_graphanalytics_mapzones
SET search_path = "SCHEMA_NAME", public, pg_catalog;

-- gw_fct_setarcfusion

-- Finish the test
SELECT finish();

ROLLBACK;
23 changes: 23 additions & 0 deletions test/plsql/ws/test_gw_fct_setlinktonetwork.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
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;

SET search_path = "SCHEMA_NAME", public, pg_catalog;

-- gw_fct_setlinktonetwork
-- SELECT gw_fct_setlinktonetwork($${"client":{"device":4, "infoType":1, "lang":"ES"},
-- "feature":{"id":["3201","3200"]},"data":{"feature_type":"CONNEC", "forcedArcs":["2001","2002"]}}$$);

-- SELECT gw_fct_setlinktonetwork($${"client":{"device":4, "infoType":1, "lang":"ES"},
-- "feature":{"id":["100013"]},"data":{"feature_type":"CONNEC"}}$$);

-- SELECT gw_fct_setlinktonetwork($${"client":{"device":4, "infoType":1, "lang":"ES"},
-- "feature":{"id":["100014"]},"data":{"feature_type":"GULLY"}}$$);

-- Finish the test
SELECT finish();

ROLLBACK;
21 changes: 0 additions & 21 deletions test/plsql/ws/test_plsql_ws_edit.sql

This file was deleted.

17 changes: 0 additions & 17 deletions test/plsql/ws/test_plsql_ws_epa.sql

This file was deleted.

40 changes: 0 additions & 40 deletions test/plsql/ws/test_plsql_ws_utilities.sql

This file was deleted.

0 comments on commit 425440e

Please sign in to comment.