---
test case: 'Test 1: simple object'
in:
json: '{"a": "b"}'
out:
return: SUCCEED
xml: 'b'
---
test case: 'Test 2: combination of objects and arrays'
in:
json: '{"xml":{"a":["A","B","A"],"foo":["BAR",{"@attr":"eee","#text":"ATR"},{"baz":"BAZ"},"QUX"],"zoo":"XUQ"}}'
out:
return: SUCCEED
xml: 'ABABARATRBAZQUXXUQ'
---
test case: 'Test 3: incorrect json'
in:
json: '{"a","b"}'
out:
return: FAIL
xml: ''
---
test case: 'Test 4: hierarchy of objects'
in:
json: '{"c":{"a":"b"}}'
out:
return: SUCCEED
xml: 'b'
---
test case: 'Test 5: null value'
in:
json: '{"a":null}'
out:
return: SUCCEED
xml: ''
---
test case: 'Test 6: hierarchy with null'
in:
json: '{"c":{"a":null}}'
out:
return: SUCCEED
xml: ''
---
test case: 'Test 7: attribute'
in:
json: '{"c":{"@a":"b"}}'
out:
return: SUCCEED
xml: ''
---
test case: 'Test 8: attribute with text'
in:
json: '{"c":{"@a":"b","#text":"d"}}'
out:
return: SUCCEED
xml: 'd'
---
test case: 'Test 9: several roots in json'
in:
json: '{"e":{"c": "d"},"f":{"a":"b"}}'
out:
return: SUCCEED
xml: 'd'
---
test case: 'Test 10: no root in json'
in:
json: '{"e":[{"c": "d"},{"a":"b"}]}'
out:
return: SUCCEED
xml: ''
---
test case: 'Test 11: root with no value'
in:
json: '{"a":{}}'
out:
return: SUCCEED
xml: ''
---
test case: 'Test 12: deep hierarchy'
in:
json: '{"x1":{"x2":{"x3":{"x4":{"x5":{"x6":{"x7":{"x8":{"x9":{"x10":"end"}}}}}}}}}}'
out:
return: SUCCEED
xml: 'end'
---
test case: 'Test 13: incorrect attribute format -> empty attribute'
in:
json: '{"xml":{"@attr":{"aaa": "eee"},"#text": "ATR"}}'
out:
return: SUCCEED
xml: 'ATR'
---
test case: 'Test 14: empty attribute'
in:
json: '{"xml":{"@attr":null,"#text": "ATR"}}'
out:
return: SUCCEED
xml: 'ATR'
---
test case: 'Test 15: use special symbols'
in:
json: '{"xml":{"@attr":"atr","#text": "10 > 9 & 8 < 9"}}'
out:
return: SUCCEED
xml: '10 > 9 & 8 < 9'
---
test case: 'Test 16: several roots with text'
in:
json: '{"a":"b","c":"d"}'
out:
return: SUCCEED
xml: 'b'
...