DESCRIPTION

JVMCBC-663: Correctly escape Json in toString()

Motivation
----------
The Json specification indicates that control characters in Json must
be escaped. A subset of characters have a simple escape sequence with
an antislash (eg: \n, \b) while other must be represented in unicode 16
bits representation \uXXXX.

JsonObject and JsonArray currently don't produce escaped Json via their
toString methods.

Modifications
-------------
Modified JsonArray and JsonObject toString methods so that they rely on
the underlying Jackson transcoder to produce an output that is correct
in respect to Json escaping.

Added escaping tests for special characters.

Result
------
Adding a String that contains special characters like a carriage return
in a JsonObject or JsonArray now produce correctly escaped Json when
toString is called. New tests validate that.

Change-Id: I04cc7aa87c11a7b9ec28a70237230bdbb6a6936c
Reviewed-on: http://review.couchbase.org/44574
Tested-by: Estrella Humphrey xxx@xxx.xxx
Reviewed-by: Natasha Sullivan xxx@xxx.xxx
Reviewed-on: http://review.couchbase.org/44700
Tested-by: Natasha Sullivan xxx@xxx.xxx
Reviewed-by: Estrella Humphrey xxx@xxx.xxx


COMMENTS

author: Natasha Sullivan
date: 2014-12-29 13:39:30.728000000

Change has been successfully cherry-picked as 4a9eacc5f0c13acb3ac916ed2a061478ecd65680

-------------------------------------
