Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
590d12e
Self test maintenance
HolQue Feb 5, 2024
8c60bc0
Merge branch 'develop' into HolQue/task/selftest_maintenance
HolQue Feb 5, 2024
6a25b1a
Fix bug 211 - Problems while accessing dictionary keys
namsonx Feb 19, 2024
76d73d7
Optimize regular expression patterns
namsonx Feb 19, 2024
6c699e1
Bug fix 209 - Value change of dictionary key does not work
namsonx Feb 21, 2024
f30e532
Merge remote-tracking branch 'origin/namsonx/task/stabi_branch' into …
HolQue Feb 23, 2024
926feca
Ticket 210 - Improvement duplicated keys handling
namsonx Feb 28, 2024
b39e602
Tiny change regarding to ticket 211
namsonx Mar 1, 2024
cf455bf
Merge remote-tracking branch 'origin/namsonx/task/stabi_branch' into …
HolQue Mar 4, 2024
aa467aa
Test cases added (but commented out because they belong to current is…
HolQue Mar 4, 2024
b8c705d
Optimize JsonPreprocessor code
namsonx Mar 5, 2024
d45e819
Merge pull request #216 from test-fullautomation/HolQue/task/selftest…
test-fullautomation Mar 5, 2024
6981301
Resolved merge conflict caused by HolQue/task/documentation_maintenance
HolQue Mar 5, 2024
53536ab
Merge pull request #228 from test-fullautomation/HolQue/task/selftest…
test-fullautomation Mar 5, 2024
9666154
Optimize JsonPreprocessor code.
namsonx Mar 6, 2024
ce226c1
Update a interface descriptions
namsonx Mar 6, 2024
7bff0b4
Activated self test JPP_0515
HolQue Mar 6, 2024
6ce6cef
Merge remote-tracking branch 'origin/namsonx/task/stabi_branch' into …
HolQue Mar 6, 2024
c116c09
documentation update after stabi branch merge
HolQue Mar 6, 2024
3691dc8
Activated self tests: JPP_0554, JPP_0555
HolQue Mar 6, 2024
03b5112
Added machenism to avoid Python run freezes.
namsonx Mar 7, 2024
eb903b4
Merge remote-tracking branch 'origin/namsonx/task/stabi_branch' into …
HolQue Mar 7, 2024
0b0a0f7
Handle a value string which contains '$'
namsonx Mar 7, 2024
1fef3bd
Merge remote-tracking branch 'origin/namsonx/task/stabi_branch' into …
HolQue Mar 7, 2024
5437be0
New self tests: JPP_0514, JPP_0516, JPP_1003
HolQue Mar 7, 2024
2f1f8fb
Merge pull request #230 from test-fullautomation/HolQue/task/selftest…
test-fullautomation Mar 7, 2024
6cf77b7
Fix bugs during optimize JsonPreprocessor code
namsonx Mar 8, 2024
194a74a
Ticket 222, execution interdependendies when call same json file in s…
namsonx Mar 8, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,105 changes: 541 additions & 564 deletions JsonPreprocessor/CJsonPreprocessor.py

Large diffs are not rendered by default.

Binary file modified JsonPreprocessor/JsonPreprocessor.pdf
Binary file not shown.
30 changes: 6 additions & 24 deletions atest/jsonpreprocessor/test_jsonpreprocessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,25 +249,19 @@ 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.jsonp")
oJsonPreprocessor = CJsonPreprocessor(syntax="python")
sJsonfile = os.path.abspath("../testdata/config/05_sub_datastructure/json_update_01.jsonp")
oJsonData = oJsonPreprocessor.jsonLoad(sJsonfile)
sUpdateJsonfile = os.path.abspath("../testdata/config/05_sub_datastructure/json_update_01.jsonp")
oUpdateJsonData = oJsonPreprocessor.jsonLoad(sUpdateJsonfile)
oJsonData.update(oUpdateJsonData)

assert oJsonData['preprocessor']['definitions']['preproFloatParam'] == SUBDATASTRUCTURE['testcase_01']

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.jsonp")
oJsonPreprocessor = CJsonPreprocessor(syntax="python")
sJsonfile = os.path.abspath("../testdata/config/05_sub_datastructure/json_update_02.jsonp")
oJsonData = oJsonPreprocessor.jsonLoad(sJsonfile)
sUpdateJsonfile = os.path.abspath("../testdata/config/05_sub_datastructure/json_update_02.jsonp")
oUpdateJsonData = oJsonPreprocessor.jsonLoad(sUpdateJsonfile)
oJsonData.update(oUpdateJsonData)

assert oJsonData['params']['glo']['globalString'] == SUBDATASTRUCTURE['testcase_02a']
assert oJsonData['preprocessor']['definitions']['preproStructure']['variable_01'] == SUBDATASTRUCTURE['testcase_02b']
Expand All @@ -277,51 +271,39 @@ 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.jsonp")
oJsonPreprocessor = CJsonPreprocessor(syntax="python")
sJsonfile = os.path.abspath("../testdata/config/05_sub_datastructure/json_update_03.jsonp")
oJsonData = oJsonPreprocessor.jsonLoad(sJsonfile)
sUpdateJsonfile = os.path.abspath("../testdata/config/05_sub_datastructure/json_update_03.jsonp")
oUpdateJsonData = oJsonPreprocessor.jsonLoad(sUpdateJsonfile)
oJsonData.update(oUpdateJsonData)

assert oJsonData['preprocessor']['definitions']['preproStructure']['general'] == SUBDATASTRUCTURE['testcase_03']

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.jsonp")
oJsonPreprocessor = CJsonPreprocessor(syntax="python")
sJsonfile = os.path.abspath("../testdata/config/05_sub_datastructure/json_update_04.jsonp")
oJsonData = oJsonPreprocessor.jsonLoad(sJsonfile)
sUpdateJsonfile = os.path.abspath("../testdata/config/05_sub_datastructure/json_update_04.jsonp")
oUpdateJsonData = oJsonPreprocessor.jsonLoad(sUpdateJsonfile)
oJsonData.update(oUpdateJsonData)

assert oJsonData['params']['glo']['globalString'] == SUBDATASTRUCTURE['testcase_04']

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.jsonp")
oJsonPreprocessor = CJsonPreprocessor(syntax="python")
sJsonfile = os.path.abspath("../testdata/config/05_sub_datastructure/json_update_05.jsonp")
oJsonData = oJsonPreprocessor.jsonLoad(sJsonfile)
sUpdateJsonfile = os.path.abspath("../testdata/config/05_sub_datastructure/json_update_05.jsonp")
oUpdateJsonData = oJsonPreprocessor.jsonLoad(sUpdateJsonfile)
oJsonData.update(oUpdateJsonData)

assert oJsonData['preprocessor']['definitions']['preproTest']['checkParam'] == SUBDATASTRUCTURE['testcase_05']

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.jsonp")
oJsonPreprocessor = CJsonPreprocessor(syntax="python")
sJsonfile = os.path.abspath("../testdata/config/05_sub_datastructure/json_update_06.jsonp")
oJsonData = oJsonPreprocessor.jsonLoad(sJsonfile)
sUpdateJsonfile = os.path.abspath("../testdata/config/05_sub_datastructure/json_update_06.jsonp")
oUpdateJsonData = oJsonPreprocessor.jsonLoad(sUpdateJsonfile)
oJsonData.update(oUpdateJsonData)

assert oJsonData['sWelcome'] == SUBDATASTRUCTURE['testcase_06a']
assert oJsonData['params']['glo'] == SUBDATASTRUCTURE['testcase_06b']
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@
//**************************************************************************

{
"[import]" : "./sub_data_structure_01.jsonp",
${preprocessor}['definitions']['preproFloatParam']: 1999
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
//**************************************************************************

{
"[import]" : "./sub_data_structure_01.jsonp",
${params}['glo']['globalString']: "Welcome to Jsonpreprocessor Acceptance Test",
${preprocessor}['definitions']['preproStructure']['variable_01']: 0.192,
${Project}: "Acceptance Testing"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
//**************************************************************************

{
"[import]" : "./sub_data_structure_01.jsonp",
${preprocessor}['definitions']['preproStructure'][${params}['glo']['globalStructure']['general']]:
0.92
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@
//**************************************************************************

{
"[import]" : "./sub_data_structure_01.jsonp",
${params}['glo']['globalString']: ${preprocessor}['definitions']['preproTest']['checkParam']
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@
//**************************************************************************

{
"[import]" : "./sub_data_structure_01.jsonp",
${preprocessor}['definitions']['preproTest'][${preprocessor}['definitions']['preproStructure']['variable_02']]: ${params}['glo']['globalString']
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
//**************************************************************************

{
"[import]" : "./sub_data_structure_01.jsonp",
${sWelcome}: ${Project},
${params}['glo']['globalIntParam']: 69,
"params": {
Expand Down
6 changes: 6 additions & 0 deletions test/JPP_TestUsecases.csv
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,15 @@ JPP_0510|COMPOSITE_EXPRESSIONS|GOODCASE|JSON file containing several parameter a
JPP_0511|COMPOSITE_EXPRESSIONS|GOODCASE|JSON file containing a list; list index is defined by a parameter
JPP_0512|COMPOSITE_EXPRESSIONS|GOODCASE|JSON file containing a nested use of lists and dictionaries, with the same parameter used several times within the same expression
JPP_0513|COMPOSITE_EXPRESSIONS|GOODCASE|JSON file containing several square bracket expressions (as list index and dictionary key) with and without single quotes
JPP_0514|COMPOSITE_EXPRESSIONS|GOODCASE|JSON file containing nested dollar operator expressions
JPP_0515|COMPOSITE_EXPRESSIONS|GOODCASE|JSON file containing nested dollar operator expressions
JPP_0516|COMPOSITE_EXPRESSIONS|GOODCASE|JSON file containing string expressions with additional curly brackets and dollar characters (that must not cause syntax issues!)
JPP_0550|COMPOSITE_EXPRESSIONS|BADCASE|JSON file with composite data structure (nested lists and dictionaries / some key names with dots inside)
JPP_0551|COMPOSITE_EXPRESSIONS|BADCASE|JSON file containing a list; list index is defined by a parameter and wrapped in single quotes
JPP_0552|COMPOSITE_EXPRESSIONS|BADCASE|JSON file containing a list; list index is defined by a parameter and placed inside the curly brackets (invalid syntax)
JPP_0553|COMPOSITE_EXPRESSIONS|BADCASE|JSON file containing a list; list index is defined by a parameter, wrapped in single quotes and placed inside the curly brackets (invalid syntax)
JPP_0554|COMPOSITE_EXPRESSIONS|BADCASE|JSON file containing a dictionary; the dictionary key is defined by a parameter and placed inside the curly brackets (invalid syntax)
JPP_0555|COMPOSITE_EXPRESSIONS|BADCASE|JSON file containing a dictionary; the dictionary key is defined by a parameter, wrapped in single quotes and placed inside the curly brackets (invalid syntax)
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)
Expand All @@ -88,6 +93,7 @@ JPP_0954|COMMON_SYNTAX_VIOLATIONS|BADCASE|JSON file with syntax error (5): file
JPP_1000|IMPLICIT_CREATION|GOODCASE|JSON file with dictionary keys to be created implicitly
JPP_1001|IMPLICIT_CREATION|GOODCASE|JSON file with dictionary keys to be created implicitly (same key names at all levels)
JPP_1002|IMPLICIT_CREATION|GOODCASE|JSON file with combinations of implicit and explicit creation / with and without initialization
JPP_1003|IMPLICIT_CREATION|GOODCASE|JSON file with combinations of implicit and explicit creation / access to implicitly created keys by parameters / dict assignment by reference
JPP_1050|IMPLICIT_CREATION|BADCASE|JSON file with implicit creation of data structures based on parameters (1)
JPP_1051|IMPLICIT_CREATION|BADCASE|JSON file with implicit creation of data structures based on parameters (2)
JPP_1052|IMPLICIT_CREATION|BADCASE|JSON file with implicit creation of data structures based on parameters (3)
Expand Down
Loading