DESCRIPTION

JCBC-597: Refactor View mapping into distinct class.

Motivation
----------
This changeset refactors the view result mapping logic into a
separate class, making it easier to grasp and also preparing it
for future enhancements (like transparent retries).

Modifications
-------------
The view query handling is moved into a separate class and extensive
integration tests have been added.

Along the way, a small bug with document() calls on reduced rows has been
fixed as well as better toString() printing on rows.

Result
------
Better readability and testability in the view mapping process.

Change-Id: Ic07d4f93be1176f0e47754203426575e75f57b80


COMMENTS

author: Natasha Sullivan
date: 2014-10-21 14:27:51.297000000

Uploaded patch set 1.

-------------------------------------
author: Natasha Sullivan
date: 2014-10-21 14:29:25.908000000

Patch Set 1: Verified+1

-------------------------------------
author: Cory Peck
date: 2014-10-21 16:57:40.877000000

Patch Set 1:

(1 comment)

Line:123, src/main/java/com/couchbase/client/java/view/ViewQueryResponseMapper.java -> Maybe it good time to integrate my changes from http://review.couchbase.org/#/c/41369


    JsonArray errors = jsonInfo.getArray("errors");
    if (error != null) {
        if (query.stopOnError()) {
            ViewQueryException ex = new ViewQueryException();
            for (Object err : errors) {
                JsonObject obj = (JsonObject)err;
                ex.addError(obj.getString("error"), obj.getString("from"));
            }
            throw ex;
        } else {
            error = JsonObject.create().put("errors", errors);
        }
    }

-------------------------------------
author: Cory Peck
date: 2014-10-21 16:58:08.899000000

Patch Set 1: Code-Review+2

Or just let it go, and then I will reimplement my patch atop of it

-------------------------------------
author: Estrella Humphrey
date: 2014-10-21 22:18:45.247000000

Patch Set 1: Code-Review+2

-------------------------------------
author: Natasha Sullivan
date: 2014-10-22 05:03:18.681000000

Patch Set 1:

yes, let's first to the move with tests & apply larger changes separately.

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