Skip to content

Commit

Permalink
tests(plsql): add new test functions in ud
Browse files Browse the repository at this point in the history
  • Loading branch information
nperez-bgeo committed Aug 22, 2024
1 parent 1a42cc4 commit ede26c4
Show file tree
Hide file tree
Showing 5 changed files with 109 additions and 1 deletion.
27 changes: 27 additions & 0 deletions test/plsql/ud/test_gw_fct_setfeaturereplaceplan.sql
Original file line number Diff line number Diff line change
@@ -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_setfeaturereplaceplan($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{},
"feature":{"featureType":"ARC", "ids":["20603"]}, "data":{"filterFields":{}, "pageInfo":{}, "catalog":"VIRTUAL"}}$$)::JSON)->>'status',
'Accepted',
'Check if gw_fct_setfeaturereplaceplan returns status "Accepted"'
);

-- Finish the test
SELECT finish();

ROLLBACK;
27 changes: 27 additions & 0 deletions test/plsql/ws/test_gw_fct_getcatfeaturevalues.sql
Original file line number Diff line number Diff line change
@@ -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;
27 changes: 27 additions & 0 deletions test/plsql/ws/test_gw_fct_gettypeahead copy.sql
Original file line number Diff line number Diff line change
@@ -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_getstylemapzones($${"client":{"device":4, "lang":"es_ES", "infoType":1}, "form":{},
"feature":{}, "data":{"filterFields":{}, "pageInfo":{}, "mapzones":""}}$$)::JSON)->>'status',
'Accepted',
'Check if gw_fct_getstylemapzones returns status "Accepted"'
);

-- Finish the test
SELECT finish();

ROLLBACK;
2 changes: 1 addition & 1 deletion test/plsql/ws/test_gw_fct_gettypeahead.sql
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ SELECT is (
"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"'
'Check if gw_fct_gettypeahead returns status "Accepted"'
);

-- Finish the test
Expand Down
27 changes: 27 additions & 0 deletions test/plsql/ws/test_gw_fct_setfeaturereplaceplan.sql
Original file line number Diff line number Diff line change
@@ -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_setfeaturereplaceplan($${"client":{"device":4, "lang":"es_ES", "infoType":1, "epsg":25831}, "form":{},
"feature":{"featureType":"ARC", "ids":["20861"]}, "data":{"filterFields":{}, "pageInfo":{}, "catalog":"VIRTUAL"}}$$)::JSON)->>'status',
'Accepted',
'Check if gw_fct_setfeaturereplaceplan returns status "Accepted"'
);

-- Finish the test
SELECT finish();

ROLLBACK;

0 comments on commit ede26c4

Please sign in to comment.