Add test for JSONFmt method
Add dumpBuffer to output test buffer when test fails