From 1ad5fb86cb1b8073c1458559dd9053739bddf2d8 Mon Sep 17 00:00:00 2001 From: mas2hc Date: Mon, 16 Oct 2023 13:59:12 +0700 Subject: [PATCH 1/3] Update new jsonp extension in atest folder --- .../jsonpreprocessor/test_jsonpreprocessor.py | 106 +++++++++--------- ...e_config.json => proper_file_config.jsonp} | 0 ....json => import_file_utf8_format_01.jsonp} | 2 +- ....json => import_file_utf8_format_02.jsonp} | 2 +- ....json => import_file_utf8_format_03.jsonp} | 2 +- ....json => import_file_utf8_format_04.jsonp} | 2 +- .../import_files01_config.jsonp} | 4 +- ...onfig.json => import_files02_config.jsonp} | 4 +- ...onfig.json => import_files03_config.jsonp} | 4 +- ...onfig.json => import_files04_config.jsonp} | 4 +- ...ig.json => import_one_file01_config.jsonp} | 2 +- ...ig.json => import_one_file02_config.jsonp} | 2 +- ...ig.json => import_one_file03_config.jsonp} | 2 +- ...ig.json => import_one_file04_config.jsonp} | 2 +- ...nfig.json => nested_import01_config.jsonp} | 2 +- ...nfig.json => nested_import02_config.jsonp} | 2 +- .../nested_import03_config.json | 27 ----- .../nested_import03_config.jsonp | 27 +++++ ...nfig.json => nested_import04_config.jsonp} | 2 +- .../nested_import05_config.json | 27 ----- .../nested_import05_config.jsonp | 27 +++++ ...nfig.json => nested_import06_config.jsonp} | 2 +- .../nested_import07_config.json | 27 ----- .../nested_import07_config.jsonp | 27 +++++ .../nested_import08_config.json | 27 ----- .../nested_import08_config.jsonp | 27 +++++ .../nested_import09_config.json | 27 ----- .../nested_import09_config.jsonp | 27 +++++ .../re_import_file01_config.jsonp} | 4 +- ...on_update_01.json => json_update_01.jsonp} | 0 ...on_update_02.json => json_update_02.jsonp} | 0 ...on_update_03.json => json_update_03.jsonp} | 0 ...on_update_04.json => json_update_04.jsonp} | 0 ...on_update_05.json => json_update_05.jsonp} | 0 ...on_update_06.json => json_update_06.jsonp} | 0 ...re_01.json => sub_data_structure_01.jsonp} | 0 ...re_02.json => sub_data_structure_02.jsonp} | 0 ...s_common.json => definitions_common.jsonp} | 0 .../common/{global.json => global.jsonp} | 0 ...ded_params.json => overrided_params.jsonp} | 2 +- .../{test_config.json => test_config.jsonp} | 0 ...config_01.json => project_config_01.jsonp} | 2 +- ...config_02.json => project_config_02.jsonp} | 2 +- ...config_03.json => project_config_03.jsonp} | 6 +- ...config_04.json => project_config_04.jsonp} | 0 ...on_format_01.json => json_format_01.jsonp} | 0 ...on_format_02.json => json_format_02.jsonp} | 0 ...on_format_03.json => json_format_03.jsonp} | 0 ...on_format_04.json => json_format_04.jsonp} | 0 ...on_format_05.json => json_format_05.jsonp} | 0 .../{utf8_format.json => utf8_format.jsonp} | 0 ...f8_format_01.json => utf8_format_01.jsonp} | 2 +- ...f8_format_02.json => utf8_format_02.jsonp} | 0 ...f8_format_03.json => utf8_format_03.jsonp} | 2 +- ...01.json => dotdict_format_config_01.jsonp} | 2 +- ...02.json => dotdict_format_config_02.jsonp} | 2 +- ...03.json => dotdict_format_config_03.jsonp} | 2 +- ...04.json => dotdict_format_config_04.jsonp} | 2 +- ...ommon.json => dotdict_format_common.jsonp} | 0 ...nfig.json => imported_file01_config.jsonp} | 0 ...nfig.json => imported_file02_config.jsonp} | 0 ...config.json => nested_file01_config.jsonp} | 0 ...config.json => nested_file02_config.jsonp} | 0 ...config.json => nested_file03_config.jsonp} | 2 +- ...ig.json => nested_imported01_config.jsonp} | 2 +- ...ig.json => nested_imported02_config.jsonp} | 2 +- ...ig.json => nested_imported03_config.jsonp} | 2 +- ...ig.json => nested_imported04_config.jsonp} | 4 +- ...ig.json => nested_imported05_config.jsonp} | 4 +- .../import/nested_imported06_config.json | 25 ----- .../import/nested_imported06_config.jsonp | 25 +++++ ...ormat_data.json => utf8_format_data.jsonp} | 0 ...data_01.json => utf8_format_data_01.jsonp} | 0 ...data_02.json => utf8_format_data_02.jsonp} | 0 ...data_03.json => utf8_format_data_03.jsonp} | 0 ...es_config.json => testsuites_config.jsonp} | 44 ++++---- 76 files changed, 277 insertions(+), 277 deletions(-) rename atest/testdata/config/01_proper_json/{proper_file_config.json => proper_file_config.jsonp} (100%) rename atest/testdata/config/02_import_json/{import_file_utf8_format_01.json => import_file_utf8_format_01.jsonp} (94%) rename atest/testdata/config/02_import_json/{import_file_utf8_format_02.json => import_file_utf8_format_02.jsonp} (95%) rename atest/testdata/config/02_import_json/{import_file_utf8_format_03.json => import_file_utf8_format_03.jsonp} (95%) rename atest/testdata/config/02_import_json/{import_file_utf8_format_04.json => import_file_utf8_format_04.jsonp} (96%) rename atest/testdata/config/{04_re_import/re_import_file01_config.json => 02_import_json/import_files01_config.jsonp} (89%) rename atest/testdata/config/02_import_json/{import_files02_config.json => import_files02_config.jsonp} (89%) rename atest/testdata/config/02_import_json/{import_files03_config.json => import_files03_config.jsonp} (89%) rename atest/testdata/config/02_import_json/{import_files04_config.json => import_files04_config.jsonp} (89%) rename atest/testdata/config/02_import_json/{import_one_file02_config.json => import_one_file01_config.jsonp} (94%) rename atest/testdata/config/02_import_json/{import_one_file01_config.json => import_one_file02_config.jsonp} (94%) rename atest/testdata/config/02_import_json/{import_one_file03_config.json => import_one_file03_config.jsonp} (94%) rename atest/testdata/config/02_import_json/{import_one_file04_config.json => import_one_file04_config.jsonp} (94%) rename atest/testdata/config/03_nested_import/{nested_import01_config.json => nested_import01_config.jsonp} (94%) rename atest/testdata/config/03_nested_import/{nested_import02_config.json => nested_import02_config.jsonp} (94%) delete mode 100644 atest/testdata/config/03_nested_import/nested_import03_config.json create mode 100644 atest/testdata/config/03_nested_import/nested_import03_config.jsonp rename atest/testdata/config/03_nested_import/{nested_import04_config.json => nested_import04_config.jsonp} (94%) delete mode 100644 atest/testdata/config/03_nested_import/nested_import05_config.json create mode 100644 atest/testdata/config/03_nested_import/nested_import05_config.jsonp rename atest/testdata/config/03_nested_import/{nested_import06_config.json => nested_import06_config.jsonp} (94%) delete mode 100644 atest/testdata/config/03_nested_import/nested_import07_config.json create mode 100644 atest/testdata/config/03_nested_import/nested_import07_config.jsonp delete mode 100644 atest/testdata/config/03_nested_import/nested_import08_config.json create mode 100644 atest/testdata/config/03_nested_import/nested_import08_config.jsonp delete mode 100644 atest/testdata/config/03_nested_import/nested_import09_config.json create mode 100644 atest/testdata/config/03_nested_import/nested_import09_config.jsonp rename atest/testdata/config/{02_import_json/import_files01_config.json => 04_re_import/re_import_file01_config.jsonp} (89%) rename atest/testdata/config/05_sub_datastructure/{json_update_01.json => json_update_01.jsonp} (100%) rename atest/testdata/config/05_sub_datastructure/{json_update_02.json => json_update_02.jsonp} (100%) rename atest/testdata/config/05_sub_datastructure/{json_update_03.json => json_update_03.jsonp} (100%) rename atest/testdata/config/05_sub_datastructure/{json_update_04.json => json_update_04.jsonp} (100%) rename atest/testdata/config/05_sub_datastructure/{json_update_05.json => json_update_05.jsonp} (100%) rename atest/testdata/config/05_sub_datastructure/{json_update_06.json => json_update_06.jsonp} (100%) rename atest/testdata/config/05_sub_datastructure/{sub_data_structure_01.json => sub_data_structure_01.jsonp} (100%) rename atest/testdata/config/05_sub_datastructure/{sub_data_structure_02.json => sub_data_structure_02.jsonp} (100%) rename atest/testdata/config/06_override_params/common/{definitions_common.json => definitions_common.jsonp} (100%) rename atest/testdata/config/06_override_params/common/{global.json => global.jsonp} (100%) rename atest/testdata/config/06_override_params/common/{overrided_params.json => overrided_params.jsonp} (97%) rename atest/testdata/config/06_override_params/common/{test_config.json => test_config.jsonp} (100%) rename atest/testdata/config/06_override_params/{project_config_01.json => project_config_01.jsonp} (98%) rename atest/testdata/config/06_override_params/{project_config_02.json => project_config_02.jsonp} (98%) rename atest/testdata/config/06_override_params/{project_config_03.json => project_config_03.jsonp} (87%) rename atest/testdata/config/06_override_params/{project_config_04.json => project_config_04.jsonp} (100%) rename atest/testdata/config/07_json_format/{json_format_01.json => json_format_01.jsonp} (100%) rename atest/testdata/config/07_json_format/{json_format_02.json => json_format_02.jsonp} (100%) rename atest/testdata/config/07_json_format/{json_format_03.json => json_format_03.jsonp} (100%) rename atest/testdata/config/07_json_format/{json_format_04.json => json_format_04.jsonp} (100%) rename atest/testdata/config/07_json_format/{json_format_05.json => json_format_05.jsonp} (100%) rename atest/testdata/config/08_utf8_encoding/{utf8_format.json => utf8_format.jsonp} (100%) rename atest/testdata/config/08_utf8_encoding/{utf8_format_01.json => utf8_format_01.jsonp} (95%) rename atest/testdata/config/08_utf8_encoding/{utf8_format_02.json => utf8_format_02.jsonp} (100%) rename atest/testdata/config/08_utf8_encoding/{utf8_format_03.json => utf8_format_03.jsonp} (96%) rename atest/testdata/config/09_dotdict_format/{dotdict_format_config_01.json => dotdict_format_config_01.jsonp} (95%) rename atest/testdata/config/09_dotdict_format/{dotdict_format_config_02.json => dotdict_format_config_02.jsonp} (94%) rename atest/testdata/config/09_dotdict_format/{dotdict_format_config_03.json => dotdict_format_config_03.jsonp} (94%) rename atest/testdata/config/09_dotdict_format/{dotdict_format_config_04.json => dotdict_format_config_04.jsonp} (94%) rename atest/testdata/config/09_dotdict_format/import/{dotdict_format_common.json => dotdict_format_common.jsonp} (100%) rename atest/testdata/config/import/{imported_file01_config.json => imported_file01_config.jsonp} (100%) rename atest/testdata/config/import/{imported_file02_config.json => imported_file02_config.jsonp} (100%) rename atest/testdata/config/import/nested_import/{nested_file01_config.json => nested_file01_config.jsonp} (100%) rename atest/testdata/config/import/nested_import/{nested_file02_config.json => nested_file02_config.jsonp} (100%) rename atest/testdata/config/import/nested_import/{nested_file03_config.json => nested_file03_config.jsonp} (93%) rename atest/testdata/config/import/{nested_imported01_config.json => nested_imported01_config.jsonp} (92%) rename atest/testdata/config/import/{nested_imported02_config.json => nested_imported02_config.jsonp} (92%) rename atest/testdata/config/import/{nested_imported03_config.json => nested_imported03_config.jsonp} (93%) rename atest/testdata/config/import/{nested_imported04_config.json => nested_imported04_config.jsonp} (86%) rename atest/testdata/config/import/{nested_imported05_config.json => nested_imported05_config.jsonp} (86%) delete mode 100644 atest/testdata/config/import/nested_imported06_config.json create mode 100644 atest/testdata/config/import/nested_imported06_config.jsonp rename atest/testdata/config/import/{utf8_format_data.json => utf8_format_data.jsonp} (100%) rename atest/testdata/config/import/{utf8_format_data_01.json => utf8_format_data_01.jsonp} (100%) rename atest/testdata/config/import/{utf8_format_data_02.json => utf8_format_data_02.jsonp} (100%) rename atest/testdata/config/import/{utf8_format_data_03.json => utf8_format_data_03.jsonp} (100%) rename atest/testdata/config/{testsuites_config.json => testsuites_config.jsonp} (68%) diff --git a/atest/jsonpreprocessor/test_jsonpreprocessor.py b/atest/jsonpreprocessor/test_jsonpreprocessor.py index cf7cb6be..a8d3004f 100644 --- a/atest/jsonpreprocessor/test_jsonpreprocessor.py +++ b/atest/jsonpreprocessor/test_jsonpreprocessor.py @@ -13,7 +13,7 @@ def test_json_config_format_01(self): ''' Test with json config file has standard format without commnent. ''' - sJsonfile = os.path.abspath("../testdata/config/07_json_format/json_format_01.json") + sJsonfile = os.path.abspath("../testdata/config/07_json_format/json_format_01.jsonp") oJsonPreprocessor = CJsonPreprocessor(syntax="python") oJsonData = oJsonPreprocessor.jsonLoad(sJsonfile) @@ -23,7 +23,7 @@ def test_json_config_format_02(self): ''' Test with the standard json config file has commnents. ''' - sJsonfile = os.path.abspath("../testdata/config/07_json_format/json_format_02.json") + sJsonfile = os.path.abspath("../testdata/config/07_json_format/json_format_02.jsonp") oJsonPreprocessor = CJsonPreprocessor(syntax="python") oJsonData = oJsonPreprocessor.jsonLoad(sJsonfile) @@ -34,7 +34,7 @@ def test_json_config_format_03(self): Test with the json config file has commnents. The elements and values contain // ''' - sJsonfile = os.path.abspath("../testdata/config/07_json_format/json_format_03.json") + sJsonfile = os.path.abspath("../testdata/config/07_json_format/json_format_03.jsonp") oJsonPreprocessor = CJsonPreprocessor(syntax="python") oJsonData = oJsonPreprocessor.jsonLoad(sJsonfile) @@ -46,7 +46,7 @@ def test_json_config_format_04(self): The elements and values contain // Some unusual new lines in json config file. ''' - sJsonfile = os.path.abspath("../testdata/config/07_json_format/json_format_04.json") + sJsonfile = os.path.abspath("../testdata/config/07_json_format/json_format_04.jsonp") oJsonPreprocessor = CJsonPreprocessor(syntax="python") oJsonData = oJsonPreprocessor.jsonLoad(sJsonfile) @@ -56,7 +56,7 @@ def test_json_config_format_05(self): ''' Test with the json config file has only 1 line with // ''' - sJsonfile = os.path.abspath("../testdata/config/07_json_format/json_format_05.json") + sJsonfile = os.path.abspath("../testdata/config/07_json_format/json_format_05.jsonp") oJsonPreprocessor = CJsonPreprocessor(syntax="python") oJsonData = oJsonPreprocessor.jsonLoad(sJsonfile) @@ -65,63 +65,63 @@ def test_json_config_format_05(self): class TestLoadJsonFiles: def test_load_proper_file(self): - sJsonfile = os.path.abspath("../testdata/config/01_proper_json/proper_file_config.json") + sJsonfile = os.path.abspath("../testdata/config/01_proper_json/proper_file_config.jsonp") oJsonPreprocessor = CJsonPreprocessor(syntax="python") oJsonData = oJsonPreprocessor.jsonLoad(sJsonfile) assert oJsonData == PROPERCONFIGFILE def test_import_one_file_01(self): - sJsonfile = os.path.abspath("../testdata/config/02_import_json/import_one_file01_config.json") + sJsonfile = os.path.abspath("../testdata/config/02_import_json/import_one_file01_config.jsonp") oJsonPreprocessor = CJsonPreprocessor(syntax="python") oJsonData = oJsonPreprocessor.jsonLoad(sJsonfile) assert oJsonData == IMPORTEDFILE01 def test_import_one_file_02(self): - sJsonfile = os.path.abspath("../testdata/config/02_import_json/import_one_file02_config.json") + sJsonfile = os.path.abspath("../testdata/config/02_import_json/import_one_file02_config.jsonp") oJsonPreprocessor = CJsonPreprocessor(syntax="python") oJsonData = oJsonPreprocessor.jsonLoad(sJsonfile) assert oJsonData == IMPORTEDFILE02 def test_import_one_file_03(self): - sJsonfile = os.path.abspath("../testdata/config/02_import_json/import_one_file03_config.json") + sJsonfile = os.path.abspath("../testdata/config/02_import_json/import_one_file03_config.jsonp") oJsonPreprocessor = CJsonPreprocessor(syntax="python") oJsonData = oJsonPreprocessor.jsonLoad(sJsonfile) assert oJsonData == IMPORTEDFILE03 def test_import_one_file_04(self): - sJsonfile = os.path.abspath("../testdata/config/02_import_json/import_one_file04_config.json") + sJsonfile = os.path.abspath("../testdata/config/02_import_json/import_one_file04_config.jsonp") oJsonPreprocessor = CJsonPreprocessor(syntax="python") oJsonData = oJsonPreprocessor.jsonLoad(sJsonfile) assert oJsonData == IMPORTEDFILE04 def test_import_files_05(self): - sJsonfile = os.path.abspath("../testdata/config/02_import_json/import_files01_config.json") + sJsonfile = os.path.abspath("../testdata/config/02_import_json/import_files01_config.jsonp") oJsonPreprocessor = CJsonPreprocessor(syntax="python") oJsonData = oJsonPreprocessor.jsonLoad(sJsonfile) assert oJsonData == IMPORTEDFILES01 def test_import_files_06(self): - sJsonfile = os.path.abspath("../testdata/config/02_import_json/import_files02_config.json") + sJsonfile = os.path.abspath("../testdata/config/02_import_json/import_files02_config.jsonp") oJsonPreprocessor = CJsonPreprocessor(syntax="python") oJsonData = oJsonPreprocessor.jsonLoad(sJsonfile) assert oJsonData == IMPORTEDFILES02 def test_import_files_07(self): - sJsonfile = os.path.abspath("../testdata/config/02_import_json/import_files03_config.json") + sJsonfile = os.path.abspath("../testdata/config/02_import_json/import_files03_config.jsonp") oJsonPreprocessor = CJsonPreprocessor(syntax="python") oJsonData = oJsonPreprocessor.jsonLoad(sJsonfile) assert oJsonData == IMPORTEDFILES03 def test_import_files_08(self): - sJsonfile = os.path.abspath("../testdata/config/02_import_json/import_files04_config.json") + sJsonfile = os.path.abspath("../testdata/config/02_import_json/import_files04_config.jsonp") oJsonPreprocessor = CJsonPreprocessor(syntax="python") oJsonData = oJsonPreprocessor.jsonLoad(sJsonfile) @@ -130,63 +130,63 @@ def test_import_files_08(self): class TestNestedImport: def test_nested_import_one_file_01(self): - sJsonfile = os.path.abspath("../testdata/config/03_nested_import/nested_import01_config.json") + sJsonfile = os.path.abspath("../testdata/config/03_nested_import/nested_import01_config.jsonp") oJsonPreprocessor = CJsonPreprocessor(syntax="python") oJsonData = oJsonPreprocessor.jsonLoad(sJsonfile) assert oJsonData == NESTEDIMPORT01 def test_nested_import_one_file_02(self): - sJsonfile = os.path.abspath("../testdata/config/03_nested_import/nested_import02_config.json") + sJsonfile = os.path.abspath("../testdata/config/03_nested_import/nested_import02_config.jsonp") oJsonPreprocessor = CJsonPreprocessor(syntax="python") oJsonData = oJsonPreprocessor.jsonLoad(sJsonfile) assert oJsonData == NESTEDIMPORT02 def test_nested_import_one_file_03(self): - sJsonfile = os.path.abspath("../testdata/config/03_nested_import/nested_import03_config.json") + sJsonfile = os.path.abspath("../testdata/config/03_nested_import/nested_import03_config.jsonp") oJsonPreprocessor = CJsonPreprocessor(syntax="python") oJsonData = oJsonPreprocessor.jsonLoad(sJsonfile) assert oJsonData == NESTEDIMPORT03 def test_nested_import_one_file_04(self): - sJsonfile = os.path.abspath("../testdata/config/03_nested_import/nested_import04_config.json") + sJsonfile = os.path.abspath("../testdata/config/03_nested_import/nested_import04_config.jsonp") oJsonPreprocessor = CJsonPreprocessor(syntax="python") oJsonData = oJsonPreprocessor.jsonLoad(sJsonfile) assert oJsonData == NESTEDIMPORT04 def test_nested_import_one_file_05(self): - sJsonfile = os.path.abspath("../testdata/config/03_nested_import/nested_import05_config.json") + sJsonfile = os.path.abspath("../testdata/config/03_nested_import/nested_import05_config.jsonp") oJsonPreprocessor = CJsonPreprocessor(syntax="python") oJsonData = oJsonPreprocessor.jsonLoad(sJsonfile) assert oJsonData == NESTEDIMPORT05 def test_nested_import_one_file_06(self): - sJsonfile = os.path.abspath("../testdata/config/03_nested_import/nested_import06_config.json") + sJsonfile = os.path.abspath("../testdata/config/03_nested_import/nested_import06_config.jsonp") oJsonPreprocessor = CJsonPreprocessor(syntax="python") oJsonData = oJsonPreprocessor.jsonLoad(sJsonfile) assert oJsonData == NESTEDIMPORT06 def test_nested_import_one_file_07(self): - sJsonfile = os.path.abspath("../testdata/config/03_nested_import/nested_import07_config.json") + sJsonfile = os.path.abspath("../testdata/config/03_nested_import/nested_import07_config.jsonp") oJsonPreprocessor = CJsonPreprocessor(syntax="python") oJsonData = oJsonPreprocessor.jsonLoad(sJsonfile) assert oJsonData == NESTEDIMPORT07 def test_nested_import_one_file_08(self): - sJsonfile = os.path.abspath("../testdata/config/03_nested_import/nested_import08_config.json") + sJsonfile = os.path.abspath("../testdata/config/03_nested_import/nested_import08_config.jsonp") oJsonPreprocessor = CJsonPreprocessor(syntax="python") oJsonData = oJsonPreprocessor.jsonLoad(sJsonfile) assert oJsonData == NESTEDIMPORT08 def test_nested_import_one_file_09(self): - sJsonfile = os.path.abspath("../testdata/config/03_nested_import/nested_import09_config.json") + sJsonfile = os.path.abspath("../testdata/config/03_nested_import/nested_import09_config.jsonp") oJsonPreprocessor = CJsonPreprocessor(syntax="python") oJsonData = oJsonPreprocessor.jsonLoad(sJsonfile) @@ -195,7 +195,7 @@ def test_nested_import_one_file_09(self): class TestReimport: def test_re_import_01(self): - sJsonfile = os.path.abspath("../testdata/config/04_re_import/re_import_file01_config.json") + sJsonfile = os.path.abspath("../testdata/config/04_re_import/re_import_file01_config.jsonp") oJsonPreprocessor = CJsonPreprocessor(syntax="python") oJsonData = oJsonPreprocessor.jsonLoad(sJsonfile) @@ -207,7 +207,7 @@ def test_override_parameter_01(self): ''' The parameters are overrided in the same configuration file. ''' - sJsonfile = os.path.abspath("../testdata/config/06_override_params/project_config_01.json") + sJsonfile = os.path.abspath("../testdata/config/06_override_params/project_config_01.jsonp") oJsonPreprocessor = CJsonPreprocessor(syntax="python") oJsonData = oJsonPreprocessor.jsonLoad(sJsonfile) @@ -219,7 +219,7 @@ def test_override_parameter_02(self): ''' The parameters in imported json file are overrided. ''' - sJsonfile = os.path.abspath("../testdata/config/06_override_params/project_config_02.json") + sJsonfile = os.path.abspath("../testdata/config/06_override_params/project_config_02.jsonp") oJsonPreprocessor = CJsonPreprocessor(syntax="python") oJsonData = oJsonPreprocessor.jsonLoad(sJsonfile) @@ -231,7 +231,7 @@ def test_override_parameter_03(self): ''' The parameters in imported json file are overrided in other imported file, overrided json object, added new json object, ... ''' - sJsonfile = os.path.abspath("../testdata/config/06_override_params/project_config_03.json") + sJsonfile = os.path.abspath("../testdata/config/06_override_params/project_config_03.jsonp") oJsonPreprocessor = CJsonPreprocessor(syntax="python") oJsonData = oJsonPreprocessor.jsonLoad(sJsonfile) @@ -249,10 +249,10 @@ def test_sub_data_structure_01(self): ''' Updated 1 parameter without nested variable. ''' - sJsonfile = os.path.abspath("../testdata/config/05_sub_datastructure/sub_data_structure_01.json") + sJsonfile = os.path.abspath("../testdata/config/05_sub_datastructure/sub_data_structure_01.jsonp") oJsonPreprocessor = CJsonPreprocessor(syntax="python") oJsonData = oJsonPreprocessor.jsonLoad(sJsonfile) - sUpdateJsonfile = os.path.abspath("../testdata/config/05_sub_datastructure/json_update_01.json") + sUpdateJsonfile = os.path.abspath("../testdata/config/05_sub_datastructure/json_update_01.jsonp") oUpdateJsonData = oJsonPreprocessor.jsonLoad(sUpdateJsonfile) oJsonData.update(oUpdateJsonData) @@ -262,10 +262,10 @@ def test_sub_data_structure_02(self): ''' Updated more than 1 parameter without nested variable. ''' - sJsonfile = os.path.abspath("../testdata/config/05_sub_datastructure/sub_data_structure_01.json") + sJsonfile = os.path.abspath("../testdata/config/05_sub_datastructure/sub_data_structure_01.jsonp") oJsonPreprocessor = CJsonPreprocessor(syntax="python") oJsonData = oJsonPreprocessor.jsonLoad(sJsonfile) - sUpdateJsonfile = os.path.abspath("../testdata/config/05_sub_datastructure/json_update_02.json") + sUpdateJsonfile = os.path.abspath("../testdata/config/05_sub_datastructure/json_update_02.jsonp") oUpdateJsonData = oJsonPreprocessor.jsonLoad(sUpdateJsonfile) oJsonData.update(oUpdateJsonData) @@ -277,10 +277,10 @@ def test_sub_data_structure_03(self): ''' Updated 1 parameter with nested variable in element name. ''' - sJsonfile = os.path.abspath("../testdata/config/05_sub_datastructure/sub_data_structure_01.json") + sJsonfile = os.path.abspath("../testdata/config/05_sub_datastructure/sub_data_structure_01.jsonp") oJsonPreprocessor = CJsonPreprocessor(syntax="python") oJsonData = oJsonPreprocessor.jsonLoad(sJsonfile) - sUpdateJsonfile = os.path.abspath("../testdata/config/05_sub_datastructure/json_update_03.json") + sUpdateJsonfile = os.path.abspath("../testdata/config/05_sub_datastructure/json_update_03.jsonp") oUpdateJsonData = oJsonPreprocessor.jsonLoad(sUpdateJsonfile) oJsonData.update(oUpdateJsonData) @@ -290,10 +290,10 @@ def test_sub_data_structure_04(self): ''' Updated 1 parameter with nested variable in element value. ''' - sJsonfile = os.path.abspath("../testdata/config/05_sub_datastructure/sub_data_structure_01.json") + sJsonfile = os.path.abspath("../testdata/config/05_sub_datastructure/sub_data_structure_01.jsonp") oJsonPreprocessor = CJsonPreprocessor(syntax="python") oJsonData = oJsonPreprocessor.jsonLoad(sJsonfile) - sUpdateJsonfile = os.path.abspath("../testdata/config/05_sub_datastructure/json_update_04.json") + sUpdateJsonfile = os.path.abspath("../testdata/config/05_sub_datastructure/json_update_04.jsonp") oUpdateJsonData = oJsonPreprocessor.jsonLoad(sUpdateJsonfile) oJsonData.update(oUpdateJsonData) @@ -303,10 +303,10 @@ def test_sub_data_structure_05(self): ''' Updated 1 parameter with nested variable in both element name and value. ''' - sJsonfile = os.path.abspath("../testdata/config/05_sub_datastructure/sub_data_structure_01.json") + sJsonfile = os.path.abspath("../testdata/config/05_sub_datastructure/sub_data_structure_01.jsonp") oJsonPreprocessor = CJsonPreprocessor(syntax="python") oJsonData = oJsonPreprocessor.jsonLoad(sJsonfile) - sUpdateJsonfile = os.path.abspath("../testdata/config/05_sub_datastructure/json_update_05.json") + sUpdateJsonfile = os.path.abspath("../testdata/config/05_sub_datastructure/json_update_05.jsonp") oUpdateJsonData = oJsonPreprocessor.jsonLoad(sUpdateJsonfile) oJsonData.update(oUpdateJsonData) @@ -316,10 +316,10 @@ def test_sub_data_structure_06(self): ''' Updated more than 1 parameter with nested variable. ''' - sJsonfile = os.path.abspath("../testdata/config/05_sub_datastructure/sub_data_structure_01.json") + sJsonfile = os.path.abspath("../testdata/config/05_sub_datastructure/sub_data_structure_01.jsonp") oJsonPreprocessor = CJsonPreprocessor(syntax="python") oJsonData = oJsonPreprocessor.jsonLoad(sJsonfile) - sUpdateJsonfile = os.path.abspath("../testdata/config/05_sub_datastructure/json_update_06.json") + sUpdateJsonfile = os.path.abspath("../testdata/config/05_sub_datastructure/json_update_06.jsonp") oUpdateJsonData = oJsonPreprocessor.jsonLoad(sUpdateJsonfile) oJsonData.update(oUpdateJsonData) @@ -332,7 +332,7 @@ def test_sub_data_structure_07(self): ''' The value is list contained dictionary element. ''' - sJsonfile = os.path.abspath("../testdata/config/05_sub_datastructure/sub_data_structure_02.json") + sJsonfile = os.path.abspath("../testdata/config/05_sub_datastructure/sub_data_structure_02.jsonp") oJsonPreprocessor = CJsonPreprocessor(syntax="python") oJsonData = oJsonPreprocessor.jsonLoad(sJsonfile) @@ -345,7 +345,7 @@ def test_none_true_false_datatype(self): ''' Test python data types and syntax to json. ``True``, ``False`` and ``None`` will be a accepted as json syntax elements. ''' - sJsonfile = os.path.abspath("../testdata/config/06_override_params/project_config_04.json") + sJsonfile = os.path.abspath("../testdata/config/06_override_params/project_config_04.jsonp") oJsonPreprocessor = CJsonPreprocessor(syntax="python") oJsonData = oJsonPreprocessor.jsonLoad(sJsonfile) assert oJsonData['string_null'] == 'null' @@ -366,7 +366,7 @@ def test_utf8_encoding(self): ''' Test utf-8 encoding ''' - sJsonfile = os.path.abspath("../testdata/config/08_utf8_encoding/utf8_format.json") + sJsonfile = os.path.abspath("../testdata/config/08_utf8_encoding/utf8_format.jsonp") oJsonPreprocessor = CJsonPreprocessor(syntax="python") oJsonData = oJsonPreprocessor.jsonLoad(sJsonfile) assert oJsonData['German'] == "Dies ist der UTF-8 SälfTest" @@ -381,7 +381,7 @@ def test_utf8_encoding_both_key_and_value(self): ''' Test utf-8 encoding in both key and value in json configuration file. ''' - sJsonfile = os.path.abspath("../testdata/config/08_utf8_encoding/utf8_format_02.json") + sJsonfile = os.path.abspath("../testdata/config/08_utf8_encoding/utf8_format_02.jsonp") oJsonPreprocessor = CJsonPreprocessor(syntax="python") oJsonData = oJsonPreprocessor.jsonLoad(sJsonfile) assert oJsonData['Tiếng Đức'] == "Dies ist der UTF-8 SälfTest" @@ -396,7 +396,7 @@ def test_utf8_encoding_imported_01(self): ''' Test utf-8 encoding file is imported to other normal json config file ''' - sJsonfile = os.path.abspath("../testdata/config/02_import_json/import_file_utf8_format_01.json") + sJsonfile = os.path.abspath("../testdata/config/02_import_json/import_file_utf8_format_01.jsonp") oJsonPreprocessor = CJsonPreprocessor(syntax="python") oJsonData = oJsonPreprocessor.jsonLoad(sJsonfile) assert oJsonData['German'] == "Dies ist der UTF-8 SälfTest" @@ -411,7 +411,7 @@ def test_utf8_encoding_imported_02(self): ''' Test utf-8 encoding file is imported to other utf8 json config file ''' - sJsonfile = os.path.abspath("../testdata/config/02_import_json/import_file_utf8_format_02.json") + sJsonfile = os.path.abspath("../testdata/config/02_import_json/import_file_utf8_format_02.jsonp") oJsonPreprocessor = CJsonPreprocessor(syntax="python") oJsonData = oJsonPreprocessor.jsonLoad(sJsonfile) assert oJsonData['German'] == "Dies ist der UTF-8 SälfTest" @@ -426,7 +426,7 @@ def test_utf8_encoding_imported_03(self): ''' Test utf-8 encoding file is imported and overried by utf8 values to other json config file ''' - sJsonfile = os.path.abspath("../testdata/config/02_import_json/import_file_utf8_format_03.json") + sJsonfile = os.path.abspath("../testdata/config/02_import_json/import_file_utf8_format_03.jsonp") oJsonPreprocessor = CJsonPreprocessor(syntax="python") oJsonData = oJsonPreprocessor.jsonLoad(sJsonfile) assert oJsonData['German'] == "Dies ist der UTF-8 SälfTest" @@ -441,7 +441,7 @@ def test_utf8_encoding_imported_04(self): ''' Test utf-8 encoding - Override utf8 data by normal data ''' - sJsonfile = os.path.abspath("../testdata/config/02_import_json/import_file_utf8_format_04.json") + sJsonfile = os.path.abspath("../testdata/config/02_import_json/import_file_utf8_format_04.jsonp") oJsonPreprocessor = CJsonPreprocessor(syntax="python") oJsonData = oJsonPreprocessor.jsonLoad(sJsonfile) assert oJsonData['German'] == "This is German" @@ -456,7 +456,7 @@ def test_utf8_encoding_imported_05(self): ''' Test utf-8 encoding - import normal json configuration file into utf8 file. ''' - sJsonfile = os.path.abspath("../testdata/config/08_utf8_encoding/utf8_format_01.json") + sJsonfile = os.path.abspath("../testdata/config/08_utf8_encoding/utf8_format_01.jsonp") oJsonPreprocessor = CJsonPreprocessor(syntax="python") oJsonData = oJsonPreprocessor.jsonLoad(sJsonfile) assert oJsonData['German'] == "Dies ist der UTF-8 SälfTest" @@ -475,7 +475,7 @@ def test_utf8_encoding_imported_06(self): ''' Test utf-8 encoding - Override parameters have utf8 format in keys. ''' - sJsonfile = os.path.abspath("../testdata/config/08_utf8_encoding/utf8_format_03.json") + sJsonfile = os.path.abspath("../testdata/config/08_utf8_encoding/utf8_format_03.jsonp") oJsonPreprocessor = CJsonPreprocessor(syntax="python") oJsonData = oJsonPreprocessor.jsonLoad(sJsonfile) assert oJsonData['utf8']['Tiếng Đức'] == "This is German" @@ -490,7 +490,7 @@ def test_dotdict_format_in_value_01(self): ''' Test nested param with dotdict format in the right site of a colon in a JSON file. ''' - sJsonfile = os.path.abspath("../testdata/config/09_dotdict_format/dotdict_format_config_01.json") + sJsonfile = os.path.abspath("../testdata/config/09_dotdict_format/dotdict_format_config_01.jsonp") oJsonPreprocessor = CJsonPreprocessor(syntax="python") oJsonData = oJsonPreprocessor.jsonLoad(sJsonfile) assert oJsonData['params']['global']['newParam_01'] == 1 @@ -504,7 +504,7 @@ def test_dotdict_format_in_value_02(self): Test nested param with dotdict format in the right site of a colon in a JSON file. Nested param is a element of a list ''' - sJsonfile = os.path.abspath("../testdata/config/09_dotdict_format/dotdict_format_config_02.json") + sJsonfile = os.path.abspath("../testdata/config/09_dotdict_format/dotdict_format_config_02.jsonp") oJsonPreprocessor = CJsonPreprocessor(syntax="python") oJsonData = oJsonPreprocessor.jsonLoad(sJsonfile) assert oJsonData['params']['global']['newListParam_01'] == ['one', 2, 1, 'three'] @@ -514,7 +514,7 @@ def test_dotdict_format_in_value_03(self): ''' Test nested param with dotdict format in the left site of a colon in a JSON file. ''' - sJsonfile = os.path.abspath("../testdata/config/09_dotdict_format/dotdict_format_config_03.json") + sJsonfile = os.path.abspath("../testdata/config/09_dotdict_format/dotdict_format_config_03.jsonp") oJsonPreprocessor = CJsonPreprocessor(syntax="python") oJsonData = oJsonPreprocessor.jsonLoad(sJsonfile) assert oJsonData['params']['global']['gPrepro.Float.Param'] == 9.999 @@ -525,7 +525,7 @@ def test_dotdict_format_in_value_04(self): ''' Test nested param with dotdict format in the both sites of a colon in a JSON file. ''' - sJsonfile = os.path.abspath("../testdata/config/09_dotdict_format/dotdict_format_config_04.json") + sJsonfile = os.path.abspath("../testdata/config/09_dotdict_format/dotdict_format_config_04.jsonp") oJsonPreprocessor = CJsonPreprocessor(syntax="python") oJsonData = oJsonPreprocessor.jsonLoad(sJsonfile) assert oJsonData['params']['global']['gPrepro.Float.Param'] == 1 diff --git a/atest/testdata/config/01_proper_json/proper_file_config.json b/atest/testdata/config/01_proper_json/proper_file_config.jsonp similarity index 100% rename from atest/testdata/config/01_proper_json/proper_file_config.json rename to atest/testdata/config/01_proper_json/proper_file_config.jsonp diff --git a/atest/testdata/config/02_import_json/import_file_utf8_format_01.json b/atest/testdata/config/02_import_json/import_file_utf8_format_01.jsonp similarity index 94% rename from atest/testdata/config/02_import_json/import_file_utf8_format_01.json rename to atest/testdata/config/02_import_json/import_file_utf8_format_01.jsonp index 1d0c2a7b..d56732fc 100644 --- a/atest/testdata/config/02_import_json/import_file_utf8_format_01.json +++ b/atest/testdata/config/02_import_json/import_file_utf8_format_01.jsonp @@ -16,7 +16,7 @@ { "Project": "JsonPreprocessor", "WelcomeString": "Hello... JsonPreprocessor selftest is running now!", - "[import]": "../import/utf8_format_data.json", + "[import]": "../import/utf8_format_data.jsonp", // Version control information. "version": { "majorversion": "0", diff --git a/atest/testdata/config/02_import_json/import_file_utf8_format_02.json b/atest/testdata/config/02_import_json/import_file_utf8_format_02.jsonp similarity index 95% rename from atest/testdata/config/02_import_json/import_file_utf8_format_02.json rename to atest/testdata/config/02_import_json/import_file_utf8_format_02.jsonp index 1827c2c5..3fd9e4b7 100644 --- a/atest/testdata/config/02_import_json/import_file_utf8_format_02.json +++ b/atest/testdata/config/02_import_json/import_file_utf8_format_02.jsonp @@ -19,7 +19,7 @@ "German": "Dies ist der UTF-8 SälfTest", "Vietnamese": "Đây là bản tự kiểm tra UTF-8", "Japanese": "これは UTF-8 セルフテストです", - "[import]": "../import/utf8_format_data_01.json", + "[import]": "../import/utf8_format_data_01.jsonp", // Version control information. "version": { "majorversion": "0", diff --git a/atest/testdata/config/02_import_json/import_file_utf8_format_03.json b/atest/testdata/config/02_import_json/import_file_utf8_format_03.jsonp similarity index 95% rename from atest/testdata/config/02_import_json/import_file_utf8_format_03.json rename to atest/testdata/config/02_import_json/import_file_utf8_format_03.jsonp index 9c4fc515..e58fcdc3 100644 --- a/atest/testdata/config/02_import_json/import_file_utf8_format_03.json +++ b/atest/testdata/config/02_import_json/import_file_utf8_format_03.jsonp @@ -19,7 +19,7 @@ "German": "Will be overridden by German", "Vietnamese": "Sẽ được ghi đè bằng câu tiếng Việt khác", "Japanese": "Будет переопределен японским", - "[import]": "../import/utf8_format_data.json", + "[import]": "../import/utf8_format_data.jsonp", // Version control information. "version": { "majorversion": "0", diff --git a/atest/testdata/config/02_import_json/import_file_utf8_format_04.json b/atest/testdata/config/02_import_json/import_file_utf8_format_04.jsonp similarity index 96% rename from atest/testdata/config/02_import_json/import_file_utf8_format_04.json rename to atest/testdata/config/02_import_json/import_file_utf8_format_04.jsonp index 5a4f4ef8..26a132d8 100644 --- a/atest/testdata/config/02_import_json/import_file_utf8_format_04.json +++ b/atest/testdata/config/02_import_json/import_file_utf8_format_04.jsonp @@ -29,5 +29,5 @@ "patchversion": "1" }, "TargetName" : "Device@01", - "[import]": "../import/utf8_format_data_02.json" + "[import]": "../import/utf8_format_data_02.jsonp" } diff --git a/atest/testdata/config/04_re_import/re_import_file01_config.json b/atest/testdata/config/02_import_json/import_files01_config.jsonp similarity index 89% rename from atest/testdata/config/04_re_import/re_import_file01_config.json rename to atest/testdata/config/02_import_json/import_files01_config.jsonp index c11b9121..d5bed8ef 100644 --- a/atest/testdata/config/04_re_import/re_import_file01_config.json +++ b/atest/testdata/config/02_import_json/import_files01_config.jsonp @@ -14,10 +14,10 @@ //***************************************************************************** { - "[import]": "../import/imported_file01_config.json", + "[import]": "../import/imported_file01_config.jsonp", + "[import]": "../import/imported_file02_config.jsonp", "Project": "JsonPreprocessor", "WelcomeString": "Hello... JsonPreprocessor selftest is running now!", - "[import]": "../import/imported_file01_config.json", // Version control information. "version": { "majorversion": "0", diff --git a/atest/testdata/config/02_import_json/import_files02_config.json b/atest/testdata/config/02_import_json/import_files02_config.jsonp similarity index 89% rename from atest/testdata/config/02_import_json/import_files02_config.json rename to atest/testdata/config/02_import_json/import_files02_config.jsonp index 8786b6ce..138ff2f1 100644 --- a/atest/testdata/config/02_import_json/import_files02_config.json +++ b/atest/testdata/config/02_import_json/import_files02_config.jsonp @@ -14,7 +14,7 @@ //***************************************************************************** { - "[import]": "../import/imported_file01_config.json", + "[import]": "../import/imported_file01_config.jsonp", "Project": "JsonPreprocessor", "WelcomeString": "Hello... JsonPreprocessor selftest is running now!", // Version control information. @@ -24,5 +24,5 @@ "patchversion": "1" }, "TargetName" : "Device@01", - "[import]": "../import/imported_file02_config.json" + "[import]": "../import/imported_file02_config.jsonp" } diff --git a/atest/testdata/config/02_import_json/import_files03_config.json b/atest/testdata/config/02_import_json/import_files03_config.jsonp similarity index 89% rename from atest/testdata/config/02_import_json/import_files03_config.json rename to atest/testdata/config/02_import_json/import_files03_config.jsonp index c715cb6a..d5aa3e1a 100644 --- a/atest/testdata/config/02_import_json/import_files03_config.json +++ b/atest/testdata/config/02_import_json/import_files03_config.jsonp @@ -15,12 +15,12 @@ { "Project": "JsonPreprocessor", - "[import]": "../import/imported_file01_config.json", + "[import]": "../import/imported_file01_config.jsonp", "WelcomeString": "Hello... JsonPreprocessor selftest is running now!", // Version control information. "version": { "majorversion": "0", - "[import]": "../import/imported_file02_config.json", + "[import]": "../import/imported_file02_config.jsonp", "minorversion": "1", "patchversion": "1" }, diff --git a/atest/testdata/config/02_import_json/import_files04_config.json b/atest/testdata/config/02_import_json/import_files04_config.jsonp similarity index 89% rename from atest/testdata/config/02_import_json/import_files04_config.json rename to atest/testdata/config/02_import_json/import_files04_config.jsonp index ef136839..3c84567c 100644 --- a/atest/testdata/config/02_import_json/import_files04_config.json +++ b/atest/testdata/config/02_import_json/import_files04_config.jsonp @@ -19,10 +19,10 @@ // Version control information. "version": { "majorversion": "0", - "[import]": "../import/imported_file01_config.json", + "[import]": "../import/imported_file01_config.jsonp", "minorversion": "1", "patchversion": "1", - "[import]": "../import/imported_file02_config.json" + "[import]": "../import/imported_file02_config.jsonp" }, "TargetName" : "Device@01" } diff --git a/atest/testdata/config/02_import_json/import_one_file02_config.json b/atest/testdata/config/02_import_json/import_one_file01_config.jsonp similarity index 94% rename from atest/testdata/config/02_import_json/import_one_file02_config.json rename to atest/testdata/config/02_import_json/import_one_file01_config.jsonp index 9d3e9151..2f616fe3 100644 --- a/atest/testdata/config/02_import_json/import_one_file02_config.json +++ b/atest/testdata/config/02_import_json/import_one_file01_config.jsonp @@ -14,9 +14,9 @@ //***************************************************************************** { + "[import]": "../import/imported_file01_config.jsonp", "Project": "JsonPreprocessor", "WelcomeString": "Hello... JsonPreprocessor selftest is running now!", - "[import]": "../import/imported_file01_config.json", // Version control information. "version": { "majorversion": "0", diff --git a/atest/testdata/config/02_import_json/import_one_file01_config.json b/atest/testdata/config/02_import_json/import_one_file02_config.jsonp similarity index 94% rename from atest/testdata/config/02_import_json/import_one_file01_config.json rename to atest/testdata/config/02_import_json/import_one_file02_config.jsonp index c4fe810a..fd9cd3ba 100644 --- a/atest/testdata/config/02_import_json/import_one_file01_config.json +++ b/atest/testdata/config/02_import_json/import_one_file02_config.jsonp @@ -14,9 +14,9 @@ //***************************************************************************** { - "[import]": "../import/imported_file01_config.json", "Project": "JsonPreprocessor", "WelcomeString": "Hello... JsonPreprocessor selftest is running now!", + "[import]": "../import/imported_file01_config.jsonp", // Version control information. "version": { "majorversion": "0", diff --git a/atest/testdata/config/02_import_json/import_one_file03_config.json b/atest/testdata/config/02_import_json/import_one_file03_config.jsonp similarity index 94% rename from atest/testdata/config/02_import_json/import_one_file03_config.json rename to atest/testdata/config/02_import_json/import_one_file03_config.jsonp index 55597f86..0a86ef96 100644 --- a/atest/testdata/config/02_import_json/import_one_file03_config.json +++ b/atest/testdata/config/02_import_json/import_one_file03_config.jsonp @@ -24,5 +24,5 @@ "patchversion": "1" }, "TargetName" : "Device@01", - "[import]": "../import/imported_file01_config.json" + "[import]": "../import/imported_file01_config.jsonp" } diff --git a/atest/testdata/config/02_import_json/import_one_file04_config.json b/atest/testdata/config/02_import_json/import_one_file04_config.jsonp similarity index 94% rename from atest/testdata/config/02_import_json/import_one_file04_config.json rename to atest/testdata/config/02_import_json/import_one_file04_config.jsonp index f8ef4be0..92900f14 100644 --- a/atest/testdata/config/02_import_json/import_one_file04_config.json +++ b/atest/testdata/config/02_import_json/import_one_file04_config.jsonp @@ -20,7 +20,7 @@ // Version control information. "version": { "majorversion": "0", - "[import]": "../import/imported_file01_config.json", + "[import]": "../import/imported_file01_config.jsonp", "minorversion": "1", "patchversion": "1" }, diff --git a/atest/testdata/config/03_nested_import/nested_import01_config.json b/atest/testdata/config/03_nested_import/nested_import01_config.jsonp similarity index 94% rename from atest/testdata/config/03_nested_import/nested_import01_config.json rename to atest/testdata/config/03_nested_import/nested_import01_config.jsonp index 3238c868..367622e1 100644 --- a/atest/testdata/config/03_nested_import/nested_import01_config.json +++ b/atest/testdata/config/03_nested_import/nested_import01_config.jsonp @@ -14,7 +14,7 @@ //***************************************************************************** { - "[import]": "../import/nested_imported01_config.json", + "[import]": "../import/nested_imported01_config.jsonp", "Project": "JsonPreprocessor", "WelcomeString": "Hello... JsonPreprocessor selftest is running now!", // Version control information. diff --git a/atest/testdata/config/03_nested_import/nested_import02_config.json b/atest/testdata/config/03_nested_import/nested_import02_config.jsonp similarity index 94% rename from atest/testdata/config/03_nested_import/nested_import02_config.json rename to atest/testdata/config/03_nested_import/nested_import02_config.jsonp index 832e5b2f..7cc67a5c 100644 --- a/atest/testdata/config/03_nested_import/nested_import02_config.json +++ b/atest/testdata/config/03_nested_import/nested_import02_config.jsonp @@ -15,7 +15,7 @@ { "Project": "JsonPreprocessor", - "[import]": "../import/nested_imported01_config.json", + "[import]": "../import/nested_imported01_config.jsonp", "WelcomeString": "Hello... JsonPreprocessor selftest is running now!", // Version control information. "version": { diff --git a/atest/testdata/config/03_nested_import/nested_import03_config.json b/atest/testdata/config/03_nested_import/nested_import03_config.json deleted file mode 100644 index 013d66e1..00000000 --- a/atest/testdata/config/03_nested_import/nested_import03_config.json +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2020-2023 Robert Bosch GmbH -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -//***************************************************************************** - -{ - "Project": "JsonPreprocessor", - "WelcomeString": "Hello... JsonPreprocessor selftest is running now!", - // Version control information. - "version": { - "majorversion": "0", - "[import]": "../import/nested_imported01_config.json", - "minorversion": "1", - "patchversion": "1" - }, - "TargetName" : "Device@01" -} diff --git a/atest/testdata/config/03_nested_import/nested_import03_config.jsonp b/atest/testdata/config/03_nested_import/nested_import03_config.jsonp new file mode 100644 index 00000000..8f70589e --- /dev/null +++ b/atest/testdata/config/03_nested_import/nested_import03_config.jsonp @@ -0,0 +1,27 @@ +// Copyright 2020-2023 Robert Bosch GmbH +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +//***************************************************************************** + +{ + "Project": "JsonPreprocessor", + "WelcomeString": "Hello... JsonPreprocessor selftest is running now!", + // Version control information. + "version": { + "majorversion": "0", + "[import]": "../import/nested_imported01_config.jsonp", + "minorversion": "1", + "patchversion": "1" + }, + "TargetName" : "Device@01" +} diff --git a/atest/testdata/config/03_nested_import/nested_import04_config.json b/atest/testdata/config/03_nested_import/nested_import04_config.jsonp similarity index 94% rename from atest/testdata/config/03_nested_import/nested_import04_config.json rename to atest/testdata/config/03_nested_import/nested_import04_config.jsonp index 928d27ef..a8eb6998 100644 --- a/atest/testdata/config/03_nested_import/nested_import04_config.json +++ b/atest/testdata/config/03_nested_import/nested_import04_config.jsonp @@ -23,5 +23,5 @@ "patchversion": "1" }, "TargetName" : "Device@01", - "[import]": "../import/nested_imported01_config.json" + "[import]": "../import/nested_imported01_config.jsonp" } diff --git a/atest/testdata/config/03_nested_import/nested_import05_config.json b/atest/testdata/config/03_nested_import/nested_import05_config.json deleted file mode 100644 index dc290eb6..00000000 --- a/atest/testdata/config/03_nested_import/nested_import05_config.json +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2020-2023 Robert Bosch GmbH -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -//***************************************************************************** - -{ - "Project": "JsonPreprocessor", - "WelcomeString": "Hello... JsonPreprocessor selftest is running now!", - // Version control information. - "version": { - "majorversion": "0", - "[import]": "../import/nested_imported02_config.json", - "minorversion": "1", - "patchversion": "1" - }, - "TargetName" : "Device@01" -} diff --git a/atest/testdata/config/03_nested_import/nested_import05_config.jsonp b/atest/testdata/config/03_nested_import/nested_import05_config.jsonp new file mode 100644 index 00000000..1cdfb479 --- /dev/null +++ b/atest/testdata/config/03_nested_import/nested_import05_config.jsonp @@ -0,0 +1,27 @@ +// Copyright 2020-2023 Robert Bosch GmbH +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +//***************************************************************************** + +{ + "Project": "JsonPreprocessor", + "WelcomeString": "Hello... JsonPreprocessor selftest is running now!", + // Version control information. + "version": { + "majorversion": "0", + "[import]": "../import/nested_imported02_config.jsonp", + "minorversion": "1", + "patchversion": "1" + }, + "TargetName" : "Device@01" +} diff --git a/atest/testdata/config/03_nested_import/nested_import06_config.json b/atest/testdata/config/03_nested_import/nested_import06_config.jsonp similarity index 94% rename from atest/testdata/config/03_nested_import/nested_import06_config.json rename to atest/testdata/config/03_nested_import/nested_import06_config.jsonp index d76ff59d..82b48445 100644 --- a/atest/testdata/config/03_nested_import/nested_import06_config.json +++ b/atest/testdata/config/03_nested_import/nested_import06_config.jsonp @@ -23,5 +23,5 @@ "patchversion": "1" }, "TargetName" : "Device@01", - "[import]": "../import/nested_imported03_config.json" + "[import]": "../import/nested_imported03_config.jsonp" } diff --git a/atest/testdata/config/03_nested_import/nested_import07_config.json b/atest/testdata/config/03_nested_import/nested_import07_config.json deleted file mode 100644 index 07be53e0..00000000 --- a/atest/testdata/config/03_nested_import/nested_import07_config.json +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2020-2023 Robert Bosch GmbH -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -//***************************************************************************** - -{ - "Project": "JsonPreprocessor", - "[import]": "../import/nested_imported04_config.json", - "WelcomeString": "Hello... JsonPreprocessor selftest is running now!", - // Version control information. - "version": { - "majorversion": "0", - "minorversion": "1", - "patchversion": "1" - }, - "TargetName" : "Device@01" -} diff --git a/atest/testdata/config/03_nested_import/nested_import07_config.jsonp b/atest/testdata/config/03_nested_import/nested_import07_config.jsonp new file mode 100644 index 00000000..c12b2d93 --- /dev/null +++ b/atest/testdata/config/03_nested_import/nested_import07_config.jsonp @@ -0,0 +1,27 @@ +// Copyright 2020-2023 Robert Bosch GmbH +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +//***************************************************************************** + +{ + "Project": "JsonPreprocessor", + "[import]": "../import/nested_imported04_config.jsonp", + "WelcomeString": "Hello... JsonPreprocessor selftest is running now!", + // Version control information. + "version": { + "majorversion": "0", + "minorversion": "1", + "patchversion": "1" + }, + "TargetName" : "Device@01" +} diff --git a/atest/testdata/config/03_nested_import/nested_import08_config.json b/atest/testdata/config/03_nested_import/nested_import08_config.json deleted file mode 100644 index a1780fa7..00000000 --- a/atest/testdata/config/03_nested_import/nested_import08_config.json +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2020-2023 Robert Bosch GmbH -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -//***************************************************************************** - -{ - "Project": "JsonPreprocessor", - "WelcomeString": "Hello... JsonPreprocessor selftest is running now!", - // Version control information. - "version": { - "majorversion": "0", - "[import]": "../import/nested_imported05_config.json", - "minorversion": "1", - "patchversion": "1" - }, - "TargetName" : "Device@01" -} diff --git a/atest/testdata/config/03_nested_import/nested_import08_config.jsonp b/atest/testdata/config/03_nested_import/nested_import08_config.jsonp new file mode 100644 index 00000000..9ae0cf29 --- /dev/null +++ b/atest/testdata/config/03_nested_import/nested_import08_config.jsonp @@ -0,0 +1,27 @@ +// Copyright 2020-2023 Robert Bosch GmbH +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +//***************************************************************************** + +{ + "Project": "JsonPreprocessor", + "WelcomeString": "Hello... JsonPreprocessor selftest is running now!", + // Version control information. + "version": { + "majorversion": "0", + "[import]": "../import/nested_imported05_config.jsonp", + "minorversion": "1", + "patchversion": "1" + }, + "TargetName" : "Device@01" +} diff --git a/atest/testdata/config/03_nested_import/nested_import09_config.json b/atest/testdata/config/03_nested_import/nested_import09_config.json deleted file mode 100644 index 0f10b060..00000000 --- a/atest/testdata/config/03_nested_import/nested_import09_config.json +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2020-2023 Robert Bosch GmbH -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -//***************************************************************************** - -{ - "Project": "JsonPreprocessor", - "WelcomeString": "Hello... JsonPreprocessor selftest is running now!", - // Version control information. - "version": { - "majorversion": "0", - "[import]": "../import/nested_imported06_config.json", - "minorversion": "1", - "patchversion": "1" - }, - "TargetName" : "Device@01" -} diff --git a/atest/testdata/config/03_nested_import/nested_import09_config.jsonp b/atest/testdata/config/03_nested_import/nested_import09_config.jsonp new file mode 100644 index 00000000..19ee8a55 --- /dev/null +++ b/atest/testdata/config/03_nested_import/nested_import09_config.jsonp @@ -0,0 +1,27 @@ +// Copyright 2020-2023 Robert Bosch GmbH +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +//***************************************************************************** + +{ + "Project": "JsonPreprocessor", + "WelcomeString": "Hello... JsonPreprocessor selftest is running now!", + // Version control information. + "version": { + "majorversion": "0", + "[import]": "../import/nested_imported06_config.jsonp", + "minorversion": "1", + "patchversion": "1" + }, + "TargetName" : "Device@01" +} diff --git a/atest/testdata/config/02_import_json/import_files01_config.json b/atest/testdata/config/04_re_import/re_import_file01_config.jsonp similarity index 89% rename from atest/testdata/config/02_import_json/import_files01_config.json rename to atest/testdata/config/04_re_import/re_import_file01_config.jsonp index 9ed94c78..407a5738 100644 --- a/atest/testdata/config/02_import_json/import_files01_config.json +++ b/atest/testdata/config/04_re_import/re_import_file01_config.jsonp @@ -14,10 +14,10 @@ //***************************************************************************** { - "[import]": "../import/imported_file01_config.json", - "[import]": "../import/imported_file02_config.json", + "[import]": "../import/imported_file01_config.jsonp", "Project": "JsonPreprocessor", "WelcomeString": "Hello... JsonPreprocessor selftest is running now!", + "[import]": "../import/imported_file01_config.jsonp", // Version control information. "version": { "majorversion": "0", diff --git a/atest/testdata/config/05_sub_datastructure/json_update_01.json b/atest/testdata/config/05_sub_datastructure/json_update_01.jsonp similarity index 100% rename from atest/testdata/config/05_sub_datastructure/json_update_01.json rename to atest/testdata/config/05_sub_datastructure/json_update_01.jsonp diff --git a/atest/testdata/config/05_sub_datastructure/json_update_02.json b/atest/testdata/config/05_sub_datastructure/json_update_02.jsonp similarity index 100% rename from atest/testdata/config/05_sub_datastructure/json_update_02.json rename to atest/testdata/config/05_sub_datastructure/json_update_02.jsonp diff --git a/atest/testdata/config/05_sub_datastructure/json_update_03.json b/atest/testdata/config/05_sub_datastructure/json_update_03.jsonp similarity index 100% rename from atest/testdata/config/05_sub_datastructure/json_update_03.json rename to atest/testdata/config/05_sub_datastructure/json_update_03.jsonp diff --git a/atest/testdata/config/05_sub_datastructure/json_update_04.json b/atest/testdata/config/05_sub_datastructure/json_update_04.jsonp similarity index 100% rename from atest/testdata/config/05_sub_datastructure/json_update_04.json rename to atest/testdata/config/05_sub_datastructure/json_update_04.jsonp diff --git a/atest/testdata/config/05_sub_datastructure/json_update_05.json b/atest/testdata/config/05_sub_datastructure/json_update_05.jsonp similarity index 100% rename from atest/testdata/config/05_sub_datastructure/json_update_05.json rename to atest/testdata/config/05_sub_datastructure/json_update_05.jsonp diff --git a/atest/testdata/config/05_sub_datastructure/json_update_06.json b/atest/testdata/config/05_sub_datastructure/json_update_06.jsonp similarity index 100% rename from atest/testdata/config/05_sub_datastructure/json_update_06.json rename to atest/testdata/config/05_sub_datastructure/json_update_06.jsonp diff --git a/atest/testdata/config/05_sub_datastructure/sub_data_structure_01.json b/atest/testdata/config/05_sub_datastructure/sub_data_structure_01.jsonp similarity index 100% rename from atest/testdata/config/05_sub_datastructure/sub_data_structure_01.json rename to atest/testdata/config/05_sub_datastructure/sub_data_structure_01.jsonp diff --git a/atest/testdata/config/05_sub_datastructure/sub_data_structure_02.json b/atest/testdata/config/05_sub_datastructure/sub_data_structure_02.jsonp similarity index 100% rename from atest/testdata/config/05_sub_datastructure/sub_data_structure_02.json rename to atest/testdata/config/05_sub_datastructure/sub_data_structure_02.jsonp diff --git a/atest/testdata/config/06_override_params/common/definitions_common.json b/atest/testdata/config/06_override_params/common/definitions_common.jsonp similarity index 100% rename from atest/testdata/config/06_override_params/common/definitions_common.json rename to atest/testdata/config/06_override_params/common/definitions_common.jsonp diff --git a/atest/testdata/config/06_override_params/common/global.json b/atest/testdata/config/06_override_params/common/global.jsonp similarity index 100% rename from atest/testdata/config/06_override_params/common/global.json rename to atest/testdata/config/06_override_params/common/global.jsonp diff --git a/atest/testdata/config/06_override_params/common/overrided_params.json b/atest/testdata/config/06_override_params/common/overrided_params.jsonp similarity index 97% rename from atest/testdata/config/06_override_params/common/overrided_params.json rename to atest/testdata/config/06_override_params/common/overrided_params.jsonp index c158f741..9b79c582 100644 --- a/atest/testdata/config/06_override_params/common/overrided_params.json +++ b/atest/testdata/config/06_override_params/common/overrided_params.jsonp @@ -22,7 +22,7 @@ }, ${params}['global']['dSUT']['tuner']['fm']['frequency']['bSupported'] : false, - "[import]": "./test_config.json", + "[import]": "./test_config.jsonp", "newStruct": { "param01": 1, "param02": "param02" diff --git a/atest/testdata/config/06_override_params/common/test_config.json b/atest/testdata/config/06_override_params/common/test_config.jsonp similarity index 100% rename from atest/testdata/config/06_override_params/common/test_config.json rename to atest/testdata/config/06_override_params/common/test_config.jsonp diff --git a/atest/testdata/config/06_override_params/project_config_01.json b/atest/testdata/config/06_override_params/project_config_01.jsonp similarity index 98% rename from atest/testdata/config/06_override_params/project_config_01.json rename to atest/testdata/config/06_override_params/project_config_01.jsonp index 8ce294cc..d851e942 100644 --- a/atest/testdata/config/06_override_params/project_config_01.json +++ b/atest/testdata/config/06_override_params/project_config_01.jsonp @@ -22,7 +22,7 @@ }, "Project":"JsonPreprocessor", "Descriptioin":"Json Preprocessor Acceptance Test", - "[import]": "./common/definitions_common.json", + "[import]": "./common/definitions_common.jsonp", "params":{ "global":{ "dSUT":{ diff --git a/atest/testdata/config/06_override_params/project_config_02.json b/atest/testdata/config/06_override_params/project_config_02.jsonp similarity index 98% rename from atest/testdata/config/06_override_params/project_config_02.json rename to atest/testdata/config/06_override_params/project_config_02.jsonp index 9287eda7..f8830f0f 100644 --- a/atest/testdata/config/06_override_params/project_config_02.json +++ b/atest/testdata/config/06_override_params/project_config_02.jsonp @@ -22,7 +22,7 @@ }, "Project":"JsonPreprocessor", "Descriptioin":"Json Preprocessor Acceptance Test", - "[import]": "./common/definitions_common.json", + "[import]": "./common/definitions_common.jsonp", ${gPreproString}: "Override string param in imported file.", "params":{ "global":{ diff --git a/atest/testdata/config/06_override_params/project_config_03.json b/atest/testdata/config/06_override_params/project_config_03.jsonp similarity index 87% rename from atest/testdata/config/06_override_params/project_config_03.json rename to atest/testdata/config/06_override_params/project_config_03.jsonp index b63ef36b..dddd956b 100644 --- a/atest/testdata/config/06_override_params/project_config_03.json +++ b/atest/testdata/config/06_override_params/project_config_03.jsonp @@ -22,11 +22,11 @@ }, "Project":"JsonPreprocessor", "Descriptioin":"Json Preprocessor Acceptance Test", - "[import]": "./common/definitions_common.json", + "[import]": "./common/definitions_common.jsonp", "params":{ "global":{ - "[import]": "./common/global.json", - "[import]": "./common/overrided_params.json" + "[import]": "./common/global.jsonp", + "[import]": "./common/overrided_params.jsonp" } }, "YearOfDevelopment": 2021 diff --git a/atest/testdata/config/06_override_params/project_config_04.json b/atest/testdata/config/06_override_params/project_config_04.jsonp similarity index 100% rename from atest/testdata/config/06_override_params/project_config_04.json rename to atest/testdata/config/06_override_params/project_config_04.jsonp diff --git a/atest/testdata/config/07_json_format/json_format_01.json b/atest/testdata/config/07_json_format/json_format_01.jsonp similarity index 100% rename from atest/testdata/config/07_json_format/json_format_01.json rename to atest/testdata/config/07_json_format/json_format_01.jsonp diff --git a/atest/testdata/config/07_json_format/json_format_02.json b/atest/testdata/config/07_json_format/json_format_02.jsonp similarity index 100% rename from atest/testdata/config/07_json_format/json_format_02.json rename to atest/testdata/config/07_json_format/json_format_02.jsonp diff --git a/atest/testdata/config/07_json_format/json_format_03.json b/atest/testdata/config/07_json_format/json_format_03.jsonp similarity index 100% rename from atest/testdata/config/07_json_format/json_format_03.json rename to atest/testdata/config/07_json_format/json_format_03.jsonp diff --git a/atest/testdata/config/07_json_format/json_format_04.json b/atest/testdata/config/07_json_format/json_format_04.jsonp similarity index 100% rename from atest/testdata/config/07_json_format/json_format_04.json rename to atest/testdata/config/07_json_format/json_format_04.jsonp diff --git a/atest/testdata/config/07_json_format/json_format_05.json b/atest/testdata/config/07_json_format/json_format_05.jsonp similarity index 100% rename from atest/testdata/config/07_json_format/json_format_05.json rename to atest/testdata/config/07_json_format/json_format_05.jsonp diff --git a/atest/testdata/config/08_utf8_encoding/utf8_format.json b/atest/testdata/config/08_utf8_encoding/utf8_format.jsonp similarity index 100% rename from atest/testdata/config/08_utf8_encoding/utf8_format.json rename to atest/testdata/config/08_utf8_encoding/utf8_format.jsonp diff --git a/atest/testdata/config/08_utf8_encoding/utf8_format_01.json b/atest/testdata/config/08_utf8_encoding/utf8_format_01.jsonp similarity index 95% rename from atest/testdata/config/08_utf8_encoding/utf8_format_01.json rename to atest/testdata/config/08_utf8_encoding/utf8_format_01.jsonp index 5438e8c0..8f25aec7 100644 --- a/atest/testdata/config/08_utf8_encoding/utf8_format_01.json +++ b/atest/testdata/config/08_utf8_encoding/utf8_format_01.jsonp @@ -22,7 +22,7 @@ "Thai": "นี่คือการทดสอบตัวเอง UTF-8", "Korean": "이것은 UTF-8 자체 테스트입니다", "Chinese": "這是 UTF-8 自測", - "[import]" : "../import/imported_file01_config.json", + "[import]" : "../import/imported_file01_config.jsonp", // Version control information. "version": { "majorversion": "0", diff --git a/atest/testdata/config/08_utf8_encoding/utf8_format_02.json b/atest/testdata/config/08_utf8_encoding/utf8_format_02.jsonp similarity index 100% rename from atest/testdata/config/08_utf8_encoding/utf8_format_02.json rename to atest/testdata/config/08_utf8_encoding/utf8_format_02.jsonp diff --git a/atest/testdata/config/08_utf8_encoding/utf8_format_03.json b/atest/testdata/config/08_utf8_encoding/utf8_format_03.jsonp similarity index 96% rename from atest/testdata/config/08_utf8_encoding/utf8_format_03.json rename to atest/testdata/config/08_utf8_encoding/utf8_format_03.jsonp index 709b23f0..7fa37173 100644 --- a/atest/testdata/config/08_utf8_encoding/utf8_format_03.json +++ b/atest/testdata/config/08_utf8_encoding/utf8_format_03.jsonp @@ -31,5 +31,5 @@ "patchversion": "1" }, "TargetName" : "Device@01", - "[import]": "../import/utf8_format_data_03.json" + "[import]": "../import/utf8_format_data_03.jsonp" } diff --git a/atest/testdata/config/09_dotdict_format/dotdict_format_config_01.json b/atest/testdata/config/09_dotdict_format/dotdict_format_config_01.jsonp similarity index 95% rename from atest/testdata/config/09_dotdict_format/dotdict_format_config_01.json rename to atest/testdata/config/09_dotdict_format/dotdict_format_config_01.jsonp index 7b62b922..77402744 100644 --- a/atest/testdata/config/09_dotdict_format/dotdict_format_config_01.json +++ b/atest/testdata/config/09_dotdict_format/dotdict_format_config_01.jsonp @@ -15,7 +15,7 @@ "WelcomeString": "Hello... JsonPreprocessor selftest is running now!", "params": { "global": { - "[import]" : "./import/dotdict_format_common.json", + "[import]" : "./import/dotdict_format_common.jsonp", "newParam_01" : ${params.global.gPreprol.IntParam}, "newParamStr_01" : "${params.global.gPreprol.IntParam}" }, diff --git a/atest/testdata/config/09_dotdict_format/dotdict_format_config_02.json b/atest/testdata/config/09_dotdict_format/dotdict_format_config_02.jsonp similarity index 94% rename from atest/testdata/config/09_dotdict_format/dotdict_format_config_02.json rename to atest/testdata/config/09_dotdict_format/dotdict_format_config_02.jsonp index 98523269..3d0d4a61 100644 --- a/atest/testdata/config/09_dotdict_format/dotdict_format_config_02.json +++ b/atest/testdata/config/09_dotdict_format/dotdict_format_config_02.jsonp @@ -15,7 +15,7 @@ "WelcomeString": "Hello... JsonPreprocessor selftest is running now!", "params": { "global": { - "[import]" : "./import/dotdict_format_common.json", + "[import]" : "./import/dotdict_format_common.jsonp", "newListParam_01" : ["one", 2, ${params.global.gPreprol.IntParam}, "three"], "newListParam_02" : ["one", 2, ${params.global.g.Prepro.String.test}, "three", ${params.global.gPrepro.Structure.general}] } diff --git a/atest/testdata/config/09_dotdict_format/dotdict_format_config_03.json b/atest/testdata/config/09_dotdict_format/dotdict_format_config_03.jsonp similarity index 94% rename from atest/testdata/config/09_dotdict_format/dotdict_format_config_03.json rename to atest/testdata/config/09_dotdict_format/dotdict_format_config_03.jsonp index 85ac6770..37674139 100644 --- a/atest/testdata/config/09_dotdict_format/dotdict_format_config_03.json +++ b/atest/testdata/config/09_dotdict_format/dotdict_format_config_03.jsonp @@ -15,7 +15,7 @@ "WelcomeString": "Hello... JsonPreprocessor selftest is running now!", "params": { "global": { - "[import]" : "./import/dotdict_format_common.json" + "[import]" : "./import/dotdict_format_common.jsonp" } }, ${params.global.gPrepro.Float.Param} : 9.999, diff --git a/atest/testdata/config/09_dotdict_format/dotdict_format_config_04.json b/atest/testdata/config/09_dotdict_format/dotdict_format_config_04.jsonp similarity index 94% rename from atest/testdata/config/09_dotdict_format/dotdict_format_config_04.json rename to atest/testdata/config/09_dotdict_format/dotdict_format_config_04.jsonp index 72eea708..79ccc42b 100644 --- a/atest/testdata/config/09_dotdict_format/dotdict_format_config_04.json +++ b/atest/testdata/config/09_dotdict_format/dotdict_format_config_04.jsonp @@ -15,7 +15,7 @@ "WelcomeString": "Hello... JsonPreprocessor selftest is running now!", "params": { "global": { - "[import]" : "./import/dotdict_format_common.json" + "[import]" : "./import/dotdict_format_common.jsonp" } }, ${params.global.gPrepro.Float.Param} : ${params.global.gPreprol.IntParam}, diff --git a/atest/testdata/config/09_dotdict_format/import/dotdict_format_common.json b/atest/testdata/config/09_dotdict_format/import/dotdict_format_common.jsonp similarity index 100% rename from atest/testdata/config/09_dotdict_format/import/dotdict_format_common.json rename to atest/testdata/config/09_dotdict_format/import/dotdict_format_common.jsonp diff --git a/atest/testdata/config/import/imported_file01_config.json b/atest/testdata/config/import/imported_file01_config.jsonp similarity index 100% rename from atest/testdata/config/import/imported_file01_config.json rename to atest/testdata/config/import/imported_file01_config.jsonp diff --git a/atest/testdata/config/import/imported_file02_config.json b/atest/testdata/config/import/imported_file02_config.jsonp similarity index 100% rename from atest/testdata/config/import/imported_file02_config.json rename to atest/testdata/config/import/imported_file02_config.jsonp diff --git a/atest/testdata/config/import/nested_import/nested_file01_config.json b/atest/testdata/config/import/nested_import/nested_file01_config.jsonp similarity index 100% rename from atest/testdata/config/import/nested_import/nested_file01_config.json rename to atest/testdata/config/import/nested_import/nested_file01_config.jsonp diff --git a/atest/testdata/config/import/nested_import/nested_file02_config.json b/atest/testdata/config/import/nested_import/nested_file02_config.jsonp similarity index 100% rename from atest/testdata/config/import/nested_import/nested_file02_config.json rename to atest/testdata/config/import/nested_import/nested_file02_config.jsonp diff --git a/atest/testdata/config/import/nested_import/nested_file03_config.json b/atest/testdata/config/import/nested_import/nested_file03_config.jsonp similarity index 93% rename from atest/testdata/config/import/nested_import/nested_file03_config.json rename to atest/testdata/config/import/nested_import/nested_file03_config.jsonp index 0a0fdc56..d702974a 100644 --- a/atest/testdata/config/import/nested_import/nested_file03_config.json +++ b/atest/testdata/config/import/nested_import/nested_file03_config.jsonp @@ -17,7 +17,7 @@ "iParam1" : 9999, "oParam2": { - "[Import]": "./nested_file01_config.json", + "[Import]": "./nested_file01_config.jsonp", "paramObject2": "paramObject2" } } diff --git a/atest/testdata/config/import/nested_imported01_config.json b/atest/testdata/config/import/nested_imported01_config.jsonp similarity index 92% rename from atest/testdata/config/import/nested_imported01_config.json rename to atest/testdata/config/import/nested_imported01_config.jsonp index dec2ab6c..30d15762 100644 --- a/atest/testdata/config/import/nested_imported01_config.json +++ b/atest/testdata/config/import/nested_imported01_config.jsonp @@ -14,7 +14,7 @@ //***************************************************************************** { - "[import]" : "./nested_import/nested_file01_config.json", + "[import]" : "./nested_import/nested_file01_config.jsonp", "gPreprolIntParam" : 11, diff --git a/atest/testdata/config/import/nested_imported02_config.json b/atest/testdata/config/import/nested_imported02_config.jsonp similarity index 92% rename from atest/testdata/config/import/nested_imported02_config.json rename to atest/testdata/config/import/nested_imported02_config.jsonp index ea741581..c5399251 100644 --- a/atest/testdata/config/import/nested_imported02_config.json +++ b/atest/testdata/config/import/nested_imported02_config.jsonp @@ -17,7 +17,7 @@ "gPreprolIntParam" : 11, "gPreproStructure": { - "[import]" : "./nested_import/nested_file01_config.json", + "[import]" : "./nested_import/nested_file01_config.jsonp", "general": "general" }, diff --git a/atest/testdata/config/import/nested_imported03_config.json b/atest/testdata/config/import/nested_imported03_config.jsonp similarity index 93% rename from atest/testdata/config/import/nested_imported03_config.json rename to atest/testdata/config/import/nested_imported03_config.jsonp index 7b1da0a3..faee03ef 100644 --- a/atest/testdata/config/import/nested_imported03_config.json +++ b/atest/testdata/config/import/nested_imported03_config.jsonp @@ -22,5 +22,5 @@ "gPreproString" : "This is a string", - "[import]" : "./nested_import/nested_file01_config.json" + "[import]" : "./nested_import/nested_file01_config.jsonp" } diff --git a/atest/testdata/config/import/nested_imported04_config.json b/atest/testdata/config/import/nested_imported04_config.jsonp similarity index 86% rename from atest/testdata/config/import/nested_imported04_config.json rename to atest/testdata/config/import/nested_imported04_config.jsonp index 5cc92981..1a6429fc 100644 --- a/atest/testdata/config/import/nested_imported04_config.json +++ b/atest/testdata/config/import/nested_imported04_config.jsonp @@ -14,8 +14,8 @@ //***************************************************************************** { - "[import]" : "./nested_import/nested_file01_config.json", - "[import]" : "./nested_import/nested_file02_config.json", + "[import]" : "./nested_import/nested_file01_config.jsonp", + "[import]" : "./nested_import/nested_file02_config.jsonp", "gPreprolIntParam" : 11, "gPreproStructure": { diff --git a/atest/testdata/config/import/nested_imported05_config.json b/atest/testdata/config/import/nested_imported05_config.jsonp similarity index 86% rename from atest/testdata/config/import/nested_imported05_config.json rename to atest/testdata/config/import/nested_imported05_config.jsonp index 6a4a4a9a..619a38e8 100644 --- a/atest/testdata/config/import/nested_imported05_config.json +++ b/atest/testdata/config/import/nested_imported05_config.jsonp @@ -15,9 +15,9 @@ { "gPreprolIntParam" : 11, - "[import]" : "./nested_import/nested_file01_config.json", + "[import]" : "./nested_import/nested_file01_config.jsonp", "gPreproStructure": { - "[import]" : "./nested_import/nested_file02_config.json", + "[import]" : "./nested_import/nested_file02_config.jsonp", "general": "general" }, diff --git a/atest/testdata/config/import/nested_imported06_config.json b/atest/testdata/config/import/nested_imported06_config.json deleted file mode 100644 index 41b30c1e..00000000 --- a/atest/testdata/config/import/nested_imported06_config.json +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2020-2023 Robert Bosch GmbH -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -//***************************************************************************** - -{ - "gPreprolIntParam" : 11, - "[import]" : "./nested_import/nested_file03_config.json", - "gPreproStructure": { - "[import]" : "./nested_import/nested_file02_config.json", - "general": "general" - }, - - "gPreproString" : "This is a string" -} diff --git a/atest/testdata/config/import/nested_imported06_config.jsonp b/atest/testdata/config/import/nested_imported06_config.jsonp new file mode 100644 index 00000000..2a3eba08 --- /dev/null +++ b/atest/testdata/config/import/nested_imported06_config.jsonp @@ -0,0 +1,25 @@ +// Copyright 2020-2023 Robert Bosch GmbH +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +//***************************************************************************** + +{ + "gPreprolIntParam" : 11, + "[import]" : "./nested_import/nested_file03_config.jsonp", + "gPreproStructure": { + "[import]" : "./nested_import/nested_file02_config.jsonp", + "general": "general" + }, + + "gPreproString" : "This is a string" +} diff --git a/atest/testdata/config/import/utf8_format_data.json b/atest/testdata/config/import/utf8_format_data.jsonp similarity index 100% rename from atest/testdata/config/import/utf8_format_data.json rename to atest/testdata/config/import/utf8_format_data.jsonp diff --git a/atest/testdata/config/import/utf8_format_data_01.json b/atest/testdata/config/import/utf8_format_data_01.jsonp similarity index 100% rename from atest/testdata/config/import/utf8_format_data_01.json rename to atest/testdata/config/import/utf8_format_data_01.jsonp diff --git a/atest/testdata/config/import/utf8_format_data_02.json b/atest/testdata/config/import/utf8_format_data_02.jsonp similarity index 100% rename from atest/testdata/config/import/utf8_format_data_02.json rename to atest/testdata/config/import/utf8_format_data_02.jsonp diff --git a/atest/testdata/config/import/utf8_format_data_03.json b/atest/testdata/config/import/utf8_format_data_03.jsonp similarity index 100% rename from atest/testdata/config/import/utf8_format_data_03.json rename to atest/testdata/config/import/utf8_format_data_03.jsonp diff --git a/atest/testdata/config/testsuites_config.json b/atest/testdata/config/testsuites_config.jsonp similarity index 68% rename from atest/testdata/config/testsuites_config.json rename to atest/testdata/config/testsuites_config.jsonp index 9965db1d..41e27d86 100644 --- a/atest/testdata/config/testsuites_config.json +++ b/atest/testdata/config/testsuites_config.jsonp @@ -16,93 +16,93 @@ //***************************************************************************** // The file configures the access to all variant dependent on test purpose. // -// The path to the *.json files depends on the test file location. A +// The path to the *.jsonp files depends on the test file location. A // different number of ../ is required dependend on the directory depth of the test // case location. //***************************************************************************** { "proper_file": { - "name": "proper_file_config.json", + "name": "proper_file_config.jsonp", "path": "./01_proper_json" }, "one_file_01": { - "name": "import_one_file01_config.json", + "name": "import_one_file01_config.jsonp", "path": "./02_import_json" }, "one_file_02": { - "name": "import_one_file02_config.json", + "name": "import_one_file02_config.jsonp", "path": "./02_import_json" }, "one_file_03": { - "name": "import_one_file03_config.json", + "name": "import_one_file03_config.jsonp", "path": "./02_import_json" }, "one_file_04": { - "name": "import_one_file04_config.json", + "name": "import_one_file04_config.jsonp", "path": "./02_import_json" }, "files_01": { - "name": "import_files01_config.json", + "name": "import_files01_config.jsonp", "path": "./02_import_json" }, "files_02": { - "name": "import_files02_config.json", + "name": "import_files02_config.jsonp", "path": "./02_import_json" }, "files_03": { - "name": "import_files03_config.json", + "name": "import_files03_config.jsonp", "path": "./02_import_json" }, "files_04": { - "name": "import_files04_config.json", + "name": "import_files04_config.jsonp", "path": "./02_import_json" }, "nested_01": { - "name": "nested_import01_config.json", + "name": "nested_import01_config.jsonp", "path": "./03_nested_import" }, "nested_02": { - "name": "nested_import02_config.json", + "name": "nested_import02_config.jsonp", "path": "./03_nested_import" }, "nested_03": { - "name": "nested_import03_config.json", + "name": "nested_import03_config.jsonp", "path": "./03_nested_import" }, "nested_04": { - "name": "nested_import04_config.json", + "name": "nested_import04_config.jsonp", "path": "./03_nested_import" }, "nested_05": { - "name": "nested_import05_config.json", + "name": "nested_import05_config.jsonp", "path": "./03_nested_import" }, "nested_06": { - "name": "nested_import06_config.json", + "name": "nested_import06_config.jsonp", "path": "./03_nested_import" }, "nested_07": { - "name": "nested_import07_config.json", + "name": "nested_import07_config.jsonp", "path": "./03_nested_import" }, "nested_08": { - "name": "nested_import08_config.json", + "name": "nested_import08_config.jsonp", "path": "./03_nested_import" }, "nested_09": { - "name": "nested_import09_config.json", + "name": "nested_import09_config.jsonp", "path": "./03_nested_import" }, "re_import_01": { - "name": "re_import_file01_config.json", + "name": "re_import_file01_config.jsonp", "path": "./04_re_import" }, "sub_datastructure_01": { - "name": "sub_data_structure_01.json", + "name": "sub_data_structure_01.jsonp", "path": "./05_sub_datastructure" }, "sub_datastructure_02": { - "name": "sub_data_structure_02.json", + "name": "sub_data_structure_02.jsonp", "path": "./05_sub_datastructure" } } From a72f3d09e6d953bfcd023fbefb44c7d32294c97e Mon Sep 17 00:00:00 2001 From: qth2hi Date: Wed, 18 Oct 2023 17:41:55 +0200 Subject: [PATCH 2/3] JPP_0900 renamed to JPP_0600 and extended; JPP_0510 added --- test/JPP_TestUsecases.csv | 3 +- test/JPP_TestUsecases.html | 63 ++++++++++++++----- test/JPP_TestUsecases.rst | 18 ++++-- test/JPP_TestUsecases.txt | 10 ++- test/component_test.py | 4 +- .../test_07_COMPOSITE_EXPRESSIONS_GOODCASE.py | 10 ++- ...E.py => test_09_CODE_COMMENTS_GOODCASE.py} | 12 ++-- test/testconfig/TestConfig.py | 45 ++++++++++--- test/testfiles/jpp-test_config_0510.jsonp | 42 +++++++++++++ ..._0900.jsonp => jpp-test_config_0600.jsonp} | 23 ++++++- 10 files changed, 189 insertions(+), 41 deletions(-) rename test/pytest/pytestfiles/{test_09_COMMON_SYNTAX_VIOLATIONS_GOODCASE.py => test_09_CODE_COMMENTS_GOODCASE.py} (84%) create mode 100644 test/testfiles/jpp-test_config_0510.jsonp rename test/testfiles/{jpp-test_config_0900.jsonp => jpp-test_config_0600.jsonp} (52%) diff --git a/test/JPP_TestUsecases.csv b/test/JPP_TestUsecases.csv index 0848c255..e7ce6900 100644 --- a/test/JPP_TestUsecases.csv +++ b/test/JPP_TestUsecases.csv @@ -50,8 +50,9 @@ JPP_0506|COMPOSITE_EXPRESSIONS|GOODCASE|JSON file with composite strings contain JPP_0507|COMPOSITE_EXPRESSIONS|GOODCASE|JSON file containing several string concatenations in separate lines (1) JPP_0508|COMPOSITE_EXPRESSIONS|GOODCASE|JSON file containing several string concatenations in separate lines (2) JPP_0509|COMPOSITE_EXPRESSIONS|GOODCASE|JSON file containing several parameter assignments in separate lines (different syntax) +JPP_0510|COMPOSITE_EXPRESSIONS|GOODCASE|JSON file containing several parameter assignments in separate lines (extended string concatenation) JPP_0550|COMPOSITE_EXPRESSIONS|BADCASE|JSON file with composite data structure (nested lists and dictionaries / some key names with dots inside) -JPP_0900|COMMON_SYNTAX_VIOLATIONS|GOODCASE|JSON file with syntax error, that is commented out +JPP_0600|CODE_COMMENTS|GOODCASE|JSON file with several combinations of code comments JPP_0950|COMMON_SYNTAX_VIOLATIONS|BADCASE|JSON file with syntax error (1) JPP_0951|COMMON_SYNTAX_VIOLATIONS|BADCASE|JSON file with syntax error (2) JPP_0952|COMMON_SYNTAX_VIOLATIONS|BADCASE|JSON file with syntax error (3) diff --git a/test/JPP_TestUsecases.html b/test/JPP_TestUsecases.html index b49b032d..d092480f 100644 --- a/test/JPP_TestUsecases.html +++ b/test/JPP_TestUsecases.html @@ -1707,6 +1707,39 @@ 51 + + + +JPP_0510 + + + + +COMPOSITE_EXPRESSIONS + + + + +GOODCASE + + + + +JSON file containing several parameter assignments in separate lines (extended string concatenation)
+Expected: JsonPreprocessor returns expected value + + +
+ + + + + + + +52 + + @@ -1738,18 +1771,18 @@ -52 +53 -JPP_0900 +JPP_0600 -COMMON_SYNTAX_VIOLATIONS +CODE_COMMENTS @@ -1759,7 +1792,7 @@ -JSON file with syntax error, that is commented out
+JSON file with several combinations of code comments
Expected: JsonPreprocessor returns remaining content of JSON file (valid parameters) @@ -1771,7 +1804,7 @@ -53 +54 @@ -1804,7 +1837,7 @@ -54 +55 @@ -1837,7 +1870,7 @@ -55 +56 @@ -1870,7 +1903,7 @@ -56 +57 @@ -1903,7 +1936,7 @@ -57 +58 @@ -1936,7 +1969,7 @@ -58 +59 @@ -1969,7 +2002,7 @@ -59 +60 @@ -2002,7 +2035,7 @@ -60 +61 @@ -2035,7 +2068,7 @@ -61 +62 @@ -2068,7 +2101,7 @@ -62 +63 @@ -2102,7 +2135,7 @@
 

-
Generated: 10.10.2023 - 13:31:11
+
Generated: 18.10.2023 - 17:37:45
 
diff --git a/test/JPP_TestUsecases.rst b/test/JPP_TestUsecases.rst index e8fee5b9..7c806efd 100644 --- a/test/JPP_TestUsecases.rst +++ b/test/JPP_TestUsecases.rst @@ -561,6 +561,16 @@ Test Use Cases ---- +* **Test JPP_0510** + + [COMPOSITE_EXPRESSIONS / GOODCASE] + + **JSON file containing several parameter assignments in separate lines (extended string concatenation)** + + Expected: JsonPreprocessor returns expected value + +---- + * **Test JPP_0550** [COMPOSITE_EXPRESSIONS / BADCASE] @@ -573,11 +583,11 @@ Test Use Cases ---- -* **Test JPP_0900** +* **Test JPP_0600** - [COMMON_SYNTAX_VIOLATIONS / GOODCASE] + [CODE_COMMENTS / GOODCASE] - **JSON file with syntax error, that is commented out** + **JSON file with several combinations of code comments** Expected: JsonPreprocessor returns remaining content of JSON file (valid parameters) @@ -685,5 +695,5 @@ Test Use Cases ---- -Generated: 10.10.2023 - 13:31:11 +Generated: 18.10.2023 - 17:37:45 diff --git a/test/JPP_TestUsecases.txt b/test/JPP_TestUsecases.txt index 04b2fa9d..c1646d12 100644 --- a/test/JPP_TestUsecases.txt +++ b/test/JPP_TestUsecases.txt @@ -238,13 +238,17 @@ Test JPP_0509 / COMPOSITE_EXPRESSIONS / GOODCASE Description: JSON file containing several parameter assignments in separate lines (different syntax) Expectation: JsonPreprocessor returns expected value ------------------------------------------------------------------------------------------------------------------------ +Test JPP_0510 / COMPOSITE_EXPRESSIONS / GOODCASE +Description: JSON file containing several parameter assignments in separate lines (extended string concatenation) +Expectation: JsonPreprocessor returns expected value +------------------------------------------------------------------------------------------------------------------------ Test JPP_0550 / COMPOSITE_EXPRESSIONS / BADCASE Description: JSON file with composite data structure (nested lists and dictionaries / some key names with dots inside) Expectation: No values are returned, and JsonPreprocessor throws an exception Hint.......: Dotdict notation (ambiguous in this case) ------------------------------------------------------------------------------------------------------------------------ -Test JPP_0900 / COMMON_SYNTAX_VIOLATIONS / GOODCASE -Description: JSON file with syntax error, that is commented out +Test JPP_0600 / CODE_COMMENTS / GOODCASE +Description: JSON file with several combinations of code comments Expectation: JsonPreprocessor returns remaining content of JSON file (valid parameters) ------------------------------------------------------------------------------------------------------------------------ Test JPP_0950 / COMMON_SYNTAX_VIOLATIONS / BADCASE @@ -288,5 +292,5 @@ Description: Relative path to JSON file Expectation: JsonPreprocessor resolves the relative path and returns values from JSON file Hint.......: Works with raw path to JSON file (path not normalized internally) ------------------------------------------------------------------------------------------------------------------------ -Generated: 10.10.2023 - 13:31:11 +Generated: 18.10.2023 - 17:37:45 diff --git a/test/component_test.py b/test/component_test.py index 9a09499c..6e285531 100644 --- a/test/component_test.py +++ b/test/component_test.py @@ -22,8 +22,8 @@ # # -------------------------------------------------------------------------------------------------------------- # -VERSION = "0.17.0" -VERSION_DATE = "11.10.2023" +VERSION = "0.18.0" +VERSION_DATE = "18.10.2023" # # -------------------------------------------------------------------------------------------------------------- #TM*** diff --git a/test/pytest/pytestfiles/test_07_COMPOSITE_EXPRESSIONS_GOODCASE.py b/test/pytest/pytestfiles/test_07_COMPOSITE_EXPRESSIONS_GOODCASE.py index 9d8bf3bd..95f0ff5b 100644 --- a/test/pytest/pytestfiles/test_07_COMPOSITE_EXPRESSIONS_GOODCASE.py +++ b/test/pytest/pytestfiles/test_07_COMPOSITE_EXPRESSIONS_GOODCASE.py @@ -18,7 +18,7 @@ # # XC-CT/ECA3-Queckenstedt # -# 10.10.2023 - 13:31:11 +# 18.10.2023 - 17:37:45 # # -------------------------------------------------------------------------------------------------------------- @@ -93,4 +93,12 @@ def test_JPP_0508(self, Description): def test_JPP_0509(self, Description): nReturn = CExecute.Execute("JPP_0509") assert nReturn == 0 +# -------------------------------------------------------------------------------------------------------------- + # Expected: JsonPreprocessor returns expected value + @pytest.mark.parametrize( + "Description", ["JSON file containing several parameter assignments in separate lines (extended string concatenation)",] + ) + def test_JPP_0510(self, Description): + nReturn = CExecute.Execute("JPP_0510") + assert nReturn == 0 # -------------------------------------------------------------------------------------------------------------- diff --git a/test/pytest/pytestfiles/test_09_COMMON_SYNTAX_VIOLATIONS_GOODCASE.py b/test/pytest/pytestfiles/test_09_CODE_COMMENTS_GOODCASE.py similarity index 84% rename from test/pytest/pytestfiles/test_09_COMMON_SYNTAX_VIOLATIONS_GOODCASE.py rename to test/pytest/pytestfiles/test_09_CODE_COMMENTS_GOODCASE.py index ac77dc18..4a314c92 100644 --- a/test/pytest/pytestfiles/test_09_COMMON_SYNTAX_VIOLATIONS_GOODCASE.py +++ b/test/pytest/pytestfiles/test_09_CODE_COMMENTS_GOODCASE.py @@ -14,11 +14,11 @@ # limitations under the License. # -------------------------------------------------------------------------------------------------------------- # -# test_09_COMMON_SYNTAX_VIOLATIONS_GOODCASE.py +# test_09_CODE_COMMENTS_GOODCASE.py # # XC-CT/ECA3-Queckenstedt # -# 10.10.2023 - 13:31:11 +# 18.10.2023 - 17:37:45 # # -------------------------------------------------------------------------------------------------------------- @@ -27,14 +27,14 @@ # -------------------------------------------------------------------------------------------------------------- -class Test_COMMON_SYNTAX_VIOLATIONS_GOODCASE: +class Test_CODE_COMMENTS_GOODCASE: # -------------------------------------------------------------------------------------------------------------- # Expected: JsonPreprocessor returns remaining content of JSON file (valid parameters) @pytest.mark.parametrize( - "Description", ["JSON file with syntax error, that is commented out",] + "Description", ["JSON file with several combinations of code comments",] ) - def test_JPP_0900(self, Description): - nReturn = CExecute.Execute("JPP_0900") + def test_JPP_0600(self, Description): + nReturn = CExecute.Execute("JPP_0600") assert nReturn == 0 # -------------------------------------------------------------------------------------------------------------- diff --git a/test/testconfig/TestConfig.py b/test/testconfig/TestConfig.py index db57660c..c98cbb8a 100644 --- a/test/testconfig/TestConfig.py +++ b/test/testconfig/TestConfig.py @@ -22,7 +22,7 @@ # # -------------------------------------------------------------------------------------------------------------- # -# 11.10.2023 +# 18.10.2023 # # !!! Temporarily tests are deactivated by the following line commented out: # # # listofdictUsecases.append(dictUsecase) @@ -1970,6 +1970,25 @@ listofdictUsecases.append(dictUsecase) del dictUsecase # -------------------------------------------------------------------------------------------------------------- +dictUsecase = {} +# can be combined with previous test cases after issue is solved +dictUsecase['TESTID'] = "JPP_0510" +dictUsecase['DESCRIPTION'] = "JSON file containing several parameter assignments in separate lines (extended string concatenation)" +dictUsecase['EXPECTATION'] = "JsonPreprocessor returns expected value" +dictUsecase['SECTION'] = "COMPOSITE_EXPRESSIONS" +dictUsecase['SUBSECTION'] = "GOODCASE" +dictUsecase['HINT'] = None +dictUsecase['COMMENT'] = None +dictUsecase['JSONFILE'] = r"..\testfiles\jpp-test_config_0510.jsonp" +dictUsecase['EXPECTEDEXCEPTION'] = None +dictUsecase['EXPECTEDRETURN'] = """ +[DICT] (1/1) > {params} [DICT] (1/1) > {global} [DICT] (4/1) > {teststring_1} [STR] : 'prefix.teststring_1.value.suffix_1.suffix_2.suffix_3' +[DICT] (1/1) > {params} [DICT] (1/1) > {global} [DICT] (4/2) > {teststring_2} [STR] : 'teststring_2.value.suffix_1' +[DICT] (1/1) > {params} [DICT] (1/1) > {global} [DICT] (4/3) > {teststring_3} [STR] : 'teststring_3.value.5' +[DICT] (1/1) > {params} [DICT] (1/1) > {global} [DICT] (4/4) > {testdict} [DICT] (1/1) > {key} [DICT] (1/1) > {teststring_4} [STR] : 'teststring_4.initial_value.suffix_1.suffix_2'""" +listofdictUsecases.append(dictUsecase) +del dictUsecase +# -------------------------------------------------------------------------------------------------------------- # -------------------------------------------------------------------------------------------------------------- dictUsecase = {} dictUsecase['TESTID'] = "JPP_0550" @@ -1987,16 +2006,28 @@ # -------------------------------------------------------------------------------------------------------------- # -------------------------------------------------------------------------------------------------------------- dictUsecase = {} -dictUsecase['TESTID'] = "JPP_0900" -dictUsecase['DESCRIPTION'] = "JSON file with syntax error, that is commented out" +dictUsecase['TESTID'] = "JPP_0600" +dictUsecase['DESCRIPTION'] = "JSON file with several combinations of code comments" dictUsecase['EXPECTATION'] = "JsonPreprocessor returns remaining content of JSON file (valid parameters)" -dictUsecase['SECTION'] = "COMMON_SYNTAX_VIOLATIONS" +dictUsecase['SECTION'] = "CODE_COMMENTS" dictUsecase['SUBSECTION'] = "GOODCASE" dictUsecase['HINT'] = None dictUsecase['COMMENT'] = None -dictUsecase['JSONFILE'] = r"..\testfiles\jpp-test_config_0900.jsonp" +dictUsecase['JSONFILE'] = r"..\testfiles\jpp-test_config_0600.jsonp" dictUsecase['EXPECTEDEXCEPTION'] = None -dictUsecase['EXPECTEDRETURN'] = "[DICT] (1/1) > {param} [STR] : 'value'" +dictUsecase['EXPECTEDRETURN'] = """ +[DICT] (6/1) > {param1} [STR] : 'value1' +[DICT] (6/2) > {param2} [STR] : 'value2' +[DICT] (6/3) > {testdict1} [DICT] (3/1) > {A} [INT] : 1 +[DICT] (6/3) > {testdict1} [DICT] (3/2) > {B} [INT] : 2 +[DICT] (6/3) > {testdict1} [DICT] (3/3) > {C} [INT] : 3 +[DICT] (6/4) > {testdict2} [DICT] (2/1) > {A} [INT] : 1 +[DICT] (6/4) > {testdict2} [DICT] (2/2) > {C} [INT] : 3 +[DICT] (6/5) > {testdict3} [DICT] (2/1) > {A} [INT] : 1 +[DICT] (6/5) > {testdict3} [DICT] (2/2) > {D} [INT] : 4 +[DICT] (6/6) > {testlist} [LIST] (2/1) > [STR] : 'A1' +[DICT] (6/6) > {testlist} [LIST] (2/2) > [STR] : 'D4' +""" listofdictUsecases.append(dictUsecase) del dictUsecase # -------------------------------------------------------------------------------------------------------------- @@ -2182,7 +2213,7 @@ listofdictUsecases.append(dictUsecase) del dictUsecase # -------------------------------------------------------------------------------------------------------------- - +# -------------------------------------------------------------------------------------------------------------- diff --git a/test/testfiles/jpp-test_config_0510.jsonp b/test/testfiles/jpp-test_config_0510.jsonp new file mode 100644 index 00000000..fcf1558a --- /dev/null +++ b/test/testfiles/jpp-test_config_0510.jsonp @@ -0,0 +1,42 @@ +// Copyright 2020-2023 Robert Bosch GmbH +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +//************************************************************************** +{ + "params" : { + "global" : { + "teststring_1" : "teststring_1.value", + ${params.global.teststring_1} : "${params.global.teststring_1}.suffix_1", + ${params.global.teststring_1} : "${params.global.teststring_1}.suffix_2", + ${params.global.teststring_1} : "prefix.${params.global.teststring_1}.suffix_3", + // + "teststring_2" : "teststring_2.value", + "teststring_2" : "${params.global.teststring_2}.suffix_1", + // + "teststring_3" : "teststring_3.value.1", + ${params.global.teststring_3} : "teststring_3.value.2", + "teststring_3" : "teststring_3.value.3", + ${params.global.teststring_3} : "teststring_3.value.4", + "teststring_3" : "teststring_3.value.5", + // + "testdict" : { + "key" : { + "teststring_4" : "teststring_4.initial_value" + } + }, + ${params.global.testdict.key.teststring_4} : "${params.global.testdict.key.teststring_4}.suffix_1", + ${params.global.testdict.key.teststring_4} : "${params.global.testdict.key.teststring_4}.suffix_2" + } + } +} + diff --git a/test/testfiles/jpp-test_config_0900.jsonp b/test/testfiles/jpp-test_config_0600.jsonp similarity index 52% rename from test/testfiles/jpp-test_config_0900.jsonp rename to test/testfiles/jpp-test_config_0600.jsonp index ce3e55ca..f9bbf7d9 100644 --- a/test/testfiles/jpp-test_config_0900.jsonp +++ b/test/testfiles/jpp-test_config_0600.jsonp @@ -13,6 +13,25 @@ // limitations under the License. //************************************************************************** { - // "I am" "syntax" "error" :: not ,,, detected - "param" : "value" + // "I am" "syntax" "error 1" :: not ,,, detected + // + /* "I am" "syntax" "error 2" :: not ,,, detected */ + // + "param1" : "value1", // comment + "param2" : "value2", /* comment */ + // + "testdict1" : {"A" : 1, // comment 1 + "B" : 2, // comment 2 + "C" : 3}, // comment 3 + + "testdict2" : {"A" : 1, // comment 1 + /* "B" : 2, */ + "C" : 3}, // comment 3 + + "testdict3" : {"A" : 1, // comment 1 + /* "B" : 2, + "C" : 3, */ + "D" : 4}, // comment 3 + // + "testlist" : ["A1", /*"B2", "C3",*/ "D4"] } \ No newline at end of file From 45cb44b8147bb280b77db0fcc4aa1c010d983d76 Mon Sep 17 00:00:00 2001 From: mas2hc Date: Thu, 19 Oct 2023 21:00:35 +0700 Subject: [PATCH 3/3] Fixed bug 223 - parameter substitution doesn't work properly --- JsonPreprocessor/CJsonPreprocessor.py | 72 +++++++++++++++++---------- 1 file changed, 45 insertions(+), 27 deletions(-) diff --git a/JsonPreprocessor/CJsonPreprocessor.py b/JsonPreprocessor/CJsonPreprocessor.py index cf200f5c..9adadca8 100644 --- a/JsonPreprocessor/CJsonPreprocessor.py +++ b/JsonPreprocessor/CJsonPreprocessor.py @@ -63,6 +63,7 @@ class CSyntaxType(): class CNameMangling(Enum): AVOIDDATATYPE = "JPavoidDataType_" COLONS = "__handleColonsInLine__" + DUPLICATEDKEY_00 = "__rootDuplicatedKey__" DUPLICATEDKEY_01 = "__handleDuplicatedKey__" DUPLICATEDKEY_02 = "__RecursiveInitialValue__" @@ -257,9 +258,6 @@ def __processImportFiles(self, input_data : dict) -> dict: else: tmpOutdict = copy.deepcopy(out_dict) for k1, v1 in tmpOutdict.items(): - pattern1 = "\${\s*[0-9A-Za-z_]+[0-9A-Za-z\.\-_]*\s*}(\[+\s*'.+'\s*\]+|\[+\s*\d+\s*\]+)*" - if re.search(pattern1, k1): - continue pattern2 = "\${\s*[0-9A-Za-z\.\-_]*\.*" + k1 + "\s*}$|\[\s*'" + k1 + "'\s*\]$" if re.search(pattern2, key): key = k1 @@ -599,6 +597,10 @@ def __loadNestedValue(initValue: str, sInputStr: str): pattern = "\${\s*[0-9A-Za-z_]+[0-9A-Za-z\.\-_]*\s*}(\[+\s*'.+'\s*\]+|\[+\s*\d+\s*\]+)*" for k, v in tmpJson.items(): keyNested = '' + if CNameMangling.DUPLICATEDKEY_00.value in k: + del oJson[k] + k = k.replace(CNameMangling.DUPLICATEDKEY_00.value, '') + oJson[k] = v if re.search("(str\(" + pattern + "\))", k.lower()): keyNested = k bNested = True @@ -828,36 +830,52 @@ def __handleDuplicatedKey(dInput : dict) -> dict: tmpDict = copy.deepcopy(dInput) for k, v in tmpDict.items(): if isinstance(v, list) and v[0]==CNameMangling.DUPLICATEDKEY_01.value: - tmpPattern = "\${\s*" + k + "\s*}|\${\s*" + k + "\.|\[\s*'"+ k + "'\s*\]|\." + k + "\.*" + i=1 + dupKey = '' + if re.search(pattern, k): + varPattern = "[0-9A-Za-z_]+[0-9A-Za-z\-_]*" + dupKey = re.search("\.(" + varPattern + ")\s*}\s*$|\['(" + varPattern + ")'\]\s*$", k)[1] + if dupKey != '': + tmpKey = dupKey + else: + tmpKey = k + tmpPattern = "\${\s*" + tmpKey + "\s*}|\${\s*" + tmpKey + "\.|\[\s*'"+ tmpKey + "'\s*\]|\." + tmpKey + "\.*" if not re.search(pattern, str(v[-1])) or not re.search(tmpPattern, str(v[-1])): dInput[k] = v[-1] continue - else: - i=1 - while i < len(v): - bRecursiveKey = False - if re.search(pattern, str(v[i])): - if isinstance(v[i], str): - if re.search(tmpPattern, v[i]): - v[i] = re.sub(k, k + CNameMangling.DUPLICATEDKEY_02.value + str(i-1), v[i]) + while i < len(v): + bRecursiveKey = False + if re.search(pattern, str(v[i])) and i>1: + if isinstance(v[i], str): + if re.search(tmpPattern, v[i]) or tmpKey in v[i]: + v[i] = re.sub(tmpKey, tmpKey + CNameMangling.DUPLICATEDKEY_02.value + str(i-1), v[i]) + bRecursiveKey = True + if isinstance(v[i], list): + newList = [] + for item in v[i]: + if re.search(tmpPattern, item) or tmpKey in item: + item = re.sub(tmpKey, tmpKey + CNameMangling.DUPLICATEDKEY_02.value + str(i-1), item) bRecursiveKey = True - if isinstance(v[i], list): - newList = [] - for item in v[i]: - if re.search(tmpPattern, item): - item = re.sub(k, k + CNameMangling.DUPLICATEDKEY_02.value + str(i-1), item) - bRecursiveKey = True - newList.append(item) - v[i] = newList - del newList - if bRecursiveKey: + newList.append(item) + v[i] = newList + del newList + if bRecursiveKey: + if dupKey == '': k1 = k + CNameMangling.DUPLICATEDKEY_02.value + str(i) - dInput[k1] = v[i] - else: + else: + k1 = re.sub(dupKey, dupKey + CNameMangling.DUPLICATEDKEY_02.value + str(i), k) + dInput[k1] = v[i] + else: + if dupKey == '': k1 = k + CNameMangling.DUPLICATEDKEY_02.value + str(i) - dInput[k1] = v[i] - i+=1 - dInput[k] = v[1] if len(v)==2 else v + else: + k1 = re.sub(dupKey, dupKey + CNameMangling.DUPLICATEDKEY_02.value + str(i), k) + dInput[k1] = v[i] + i+=1 + if dupKey != '' and CNameMangling.DUPLICATEDKEY_02.value in str(v): + del dInput[k] + k = re.sub(dupKey, dupKey + CNameMangling.DUPLICATEDKEY_00.value, k) + dInput[k] = v[1] if len(v)==2 else v if isinstance(v, dict): dInput[k] = __handleDuplicatedKey(v) del tmpDict