DESCRIPTION

JCBC-855: Improve writability of integration tests

Motivation:
-----------
When writing an integration test case that has special requirements
(like a dedicated bucket, avoid the flush phase, use a different bucket
name, ...), it has become very difficult to rely on inheritance of
ClusterDependentTest base class (as JUnit doesn't behave very well with
abstract parent classes). There was a need for a different more flexible
approach.

Modifications:
--------------
Most of the code mutualized in ClusterDependentTest has been moved into
a CouchbastTestContext class. This context holds the references to the
Cluster, Bucket, BucketManager, etc...

It also provides utility methods to perfom assertions on the context (eg
is N1QL available) and lifecycle management (cluster disconnect, ...).

Such a context should be created in xxx@xxx.xxx method on each test
case instead of it extending ClusterDependentTest, by using the
CouchbaseTestContext.builder() builder.

ClusterDependentTest has been made deprecated and is mirroring the old
behavior by relying on CouchbaseTestContext internally.

Thanks to that, tests that were previously ignored have been reactivated.

Results:
--------
Using the CouchbaseTestContext with the associated builder allows for
far more flexible integration tests. For example it is possible to set a
specific bucket name then to have it being created in an adhoc way (by
appending a timestamp to the given name), so that it can be destroyed
after the testcase.

Change-Id: Ibf80a144ec0d01fa18f26ca6474bf317955cd4bc


COMMENTS

author: Estrella Humphrey
date: 2015-12-02 09:08:40.957000000

Uploaded patch set 4.

-------------------------------------
author: Estrella Humphrey
date: 2015-12-02 09:09:18.268000000

Patch Set 4: Verified+1

sergey, I've fixed the space warnings and added javadoc on all CouchbaseTestContext methods

-------------------------------------
author: Tate Garrett
date: 2015-12-03 08:12:12.919000000

Change has been successfully cherry-picked as 8ea82923049c366a727166876d0c01c8e64cd1b8

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