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


COMMENTS

author: Estrella Humphrey
date: 2014-12-22 11:09:30.320000000

Change has been successfully cherry-picked as 9f81c850578cb29fa233d9220839508ff477853a

-------------------------------------
author: Estrella Humphrey
date: 2014-12-22 11:15:36.782000000

Patch Set 2: Reverted

This patchset was reverted in change: I46a13b57b379532de8047176c11d8e3f3fd1c126

-------------------------------------
author: Estrella Humphrey
date: 2014-12-23 08:34:03.127000000

Patch Set 2:

not reverted (revert changeset abandonned)
mind the bad jira issue number, it's JCBC-663

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