From 85baa22ca1f0e6c5d294a1b6d1f77e6f47723d5c Mon Sep 17 00:00:00 2001 From: Ganesh Jaybhay Date: Tue, 3 Sep 2019 17:42:44 +0530 Subject: [PATCH] Added Modified SQL test cases for FTS Configurations. --- .../msql_alter_fts_conf_add_comment.sql | 2 ++ .../default/msql_alter_fts_conf_add_token.sql | 3 ++ .../msql_alter_fts_conf_remove_token.sql | 2 ++ .../default/msql_alter_fts_conf_rename.sql | 2 ++ .../tests/default/msql_create_fts_conf.sql | 3 ++ .../default/msql_create_fts_conf_def1.sql | 3 ++ .../default/msql_create_fts_conf_def2.sql | 3 ++ .../tests/default/test.json | 28 ++++++++++++++----- 8 files changed, 39 insertions(+), 7 deletions(-) create mode 100644 web/pgadmin/browser/server_groups/servers/databases/schemas/fts_configurations/tests/default/msql_alter_fts_conf_add_comment.sql create mode 100644 web/pgadmin/browser/server_groups/servers/databases/schemas/fts_configurations/tests/default/msql_alter_fts_conf_add_token.sql create mode 100644 web/pgadmin/browser/server_groups/servers/databases/schemas/fts_configurations/tests/default/msql_alter_fts_conf_remove_token.sql create mode 100644 web/pgadmin/browser/server_groups/servers/databases/schemas/fts_configurations/tests/default/msql_alter_fts_conf_rename.sql create mode 100644 web/pgadmin/browser/server_groups/servers/databases/schemas/fts_configurations/tests/default/msql_create_fts_conf.sql create mode 100644 web/pgadmin/browser/server_groups/servers/databases/schemas/fts_configurations/tests/default/msql_create_fts_conf_def1.sql create mode 100644 web/pgadmin/browser/server_groups/servers/databases/schemas/fts_configurations/tests/default/msql_create_fts_conf_def2.sql diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_configurations/tests/default/msql_alter_fts_conf_add_comment.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_configurations/tests/default/msql_alter_fts_conf_add_comment.sql new file mode 100644 index 000000000..1a543b78f --- /dev/null +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_configurations/tests/default/msql_alter_fts_conf_add_comment.sql @@ -0,0 +1,2 @@ +COMMENT ON TEXT SEARCH CONFIGURATION test.test_fts_configuration_def1 + IS 'test comment'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_configurations/tests/default/msql_alter_fts_conf_add_token.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_configurations/tests/default/msql_alter_fts_conf_add_token.sql new file mode 100644 index 000000000..23419b7d8 --- /dev/null +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_configurations/tests/default/msql_alter_fts_conf_add_token.sql @@ -0,0 +1,3 @@ +ALTER TEXT SEARCH CONFIGURATION test.test_fts_configuration_def1 + ADD MAPPING FOR file + WITH english_stem; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_configurations/tests/default/msql_alter_fts_conf_remove_token.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_configurations/tests/default/msql_alter_fts_conf_remove_token.sql new file mode 100644 index 000000000..309d84b9a --- /dev/null +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_configurations/tests/default/msql_alter_fts_conf_remove_token.sql @@ -0,0 +1,2 @@ +ALTER TEXT SEARCH CONFIGURATION test.test_fts_configuration_def2 + DROP MAPPING FOR word; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_configurations/tests/default/msql_alter_fts_conf_rename.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_configurations/tests/default/msql_alter_fts_conf_rename.sql new file mode 100644 index 000000000..e098faf14 --- /dev/null +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_configurations/tests/default/msql_alter_fts_conf_rename.sql @@ -0,0 +1,2 @@ +ALTER TEXT SEARCH CONFIGURATION test.test_fts_configuration_def1 + RENAME TO test_fts_configuration; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_configurations/tests/default/msql_create_fts_conf.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_configurations/tests/default/msql_create_fts_conf.sql new file mode 100644 index 000000000..34a77f5e9 --- /dev/null +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_configurations/tests/default/msql_create_fts_conf.sql @@ -0,0 +1,3 @@ +CREATE TEXT SEARCH CONFIGURATION test."test_fts_conf_$%{}[]()&*^!@""'`\/#" ( + PARSER = default +); diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_configurations/tests/default/msql_create_fts_conf_def1.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_configurations/tests/default/msql_create_fts_conf_def1.sql new file mode 100644 index 000000000..95a9d05e7 --- /dev/null +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_configurations/tests/default/msql_create_fts_conf_def1.sql @@ -0,0 +1,3 @@ +CREATE TEXT SEARCH CONFIGURATION test.test_fts_configuration_def1 ( + PARSER = default +); diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_configurations/tests/default/msql_create_fts_conf_def2.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_configurations/tests/default/msql_create_fts_conf_def2.sql new file mode 100644 index 000000000..0fff1bc73 --- /dev/null +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_configurations/tests/default/msql_create_fts_conf_def2.sql @@ -0,0 +1,3 @@ +CREATE TEXT SEARCH CONFIGURATION test.test_fts_configuration_def2 ( + COPY=english +); diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_configurations/tests/default/test.json b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_configurations/tests/default/test.json index a1b7d3837..b3b1b5122 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_configurations/tests/default/test.json +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_configurations/tests/default/test.json @@ -4,6 +4,7 @@ "name": "Create FTS Configuration", "endpoint": "NODE-fts_configuration.obj", "sql_endpoint": "NODE-fts_configuration.sql_id", + "msql_endpoint": "NODE-fts_configuration.msql", "data": { "name": "test_fts_conf_$%{}[]()&*^!@\"'`\\/#", "schema": "test", @@ -11,7 +12,8 @@ "prsname": "default", "tokens": [] }, - "expected_sql_file": "create_fts_conf.sql" + "expected_sql_file": "create_fts_conf.sql", + "expected_msql_file": "msql_create_fts_conf.sql" }, { "type": "delete", "name": "Drop FTS Configuration", @@ -24,6 +26,7 @@ "name": "Create FTS Configuration with Parser", "endpoint": "NODE-fts_configuration.obj", "sql_endpoint": "NODE-fts_configuration.sql_id", + "msql_endpoint": "NODE-fts_configuration.msql", "data": { "name": "test_fts_configuration_def1", "schema": "test", @@ -31,34 +34,41 @@ "prsname": "default", "tokens": [] }, - "expected_sql_file": "create_fts_conf_def1.sql" + "expected_sql_file": "create_fts_conf_def1.sql", + "expected_msql_file": "msql_create_fts_conf_def1.sql" }, { "type": "alter", "name": "Alter FTS Configuration add comment", "endpoint": "NODE-fts_configuration.obj_id", "sql_endpoint": "NODE-fts_configuration.sql_id", + "msql_endpoint": "NODE-fts_configuration.msql_id", "data": { "description": "test comment" }, - "expected_sql_file": "alter_fts_conf_add_comment.sql" + "expected_sql_file": "alter_fts_conf_add_comment.sql", + "expected_msql_file": "msql_alter_fts_conf_add_comment.sql" }, { "type": "alter", "name": "Alter FTS Configuration add token file", "endpoint": "NODE-fts_configuration.obj_id", "sql_endpoint": "NODE-fts_configuration.sql_id", + "msql_endpoint": "NODE-fts_configuration.msql_id", "data": { "tokens": {"added": [{"token": "file", "dictname": ["english_stem"]}]} }, - "expected_sql_file": "alter_fts_conf_add_token.sql" + "expected_sql_file": "alter_fts_conf_add_token.sql", + "expected_msql_file": "msql_alter_fts_conf_add_token.sql" }, { "type": "alter", "name": "Alter FTS Configuration Rename", "endpoint": "NODE-fts_configuration.obj_id", "sql_endpoint": "NODE-fts_configuration.sql_id", + "msql_endpoint": "NODE-fts_configuration.msql_id", "data": { "name": "test_fts_configuration" }, - "expected_sql_file": "alter_fts_conf_rename.sql" + "expected_sql_file": "alter_fts_conf_rename.sql", + "expected_msql_file": "msql_alter_fts_conf_rename.sql" }, { "type": "delete", "name": "Drop FTS Configuration with parser", @@ -71,22 +81,26 @@ "name": "Create FTS Configuration with copy config", "endpoint": "NODE-fts_configuration.obj", "sql_endpoint": "NODE-fts_configuration.sql_id", + "msql_endpoint": "NODE-fts_configuration.msql", "data": { "name": "test_fts_configuration_def2", "schema": "test", "schema_id": "", "copy_config": "english" }, - "expected_sql_file": "create_fts_conf_def2.sql" + "expected_sql_file": "create_fts_conf_def2.sql", + "expected_msql_file": "msql_create_fts_conf_def2.sql" }, { "type": "alter", "name": "Alter FTS Configuration remove token file", "endpoint": "NODE-fts_configuration.obj_id", "sql_endpoint": "NODE-fts_configuration.sql_id", + "msql_endpoint": "NODE-fts_configuration.msql_id", "data": { "tokens": {"deleted": [{"token": "word", "dictname": ["english_stem"]}]} }, - "expected_sql_file": "alter_fts_conf_remove_token.sql" + "expected_sql_file": "alter_fts_conf_remove_token.sql", + "expected_msql_file": "msql_alter_fts_conf_remove_token.sql" }, { "type": "delete", "name": "Drop FTS Configuration with copy config",