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: Natasha Sullivan
date: 2014-12-29 12:17:35.808000000

Uploaded patch set 1.

-------------------------------------
author: Natasha Sullivan
date: 2014-12-29 12:51:40.442000000

Patch Set 1: Verified+1

-------------------------------------
author: Estrella Humphrey
date: 2014-12-29 13:33:07.238000000

Patch Set 1: Code-Review+2

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