elasticsearch/elasticsearch — pull request #5630 by javanna (2014-03-31 19:57:49+00:00)
Title: [TEST] added ExternalTestCluster that allows to run tests against an external cluster

All the ordinary test operations happen based on the `ImmutableTestCluster` base class and are executed via transport client. Will be used especially for the REST tests once migrated to the standard randomized runner.

Added new httpAddresses method to ImmutableTestCluster to be able to retrieve the http addresses to connect to for the REST tests. Both versions will look inside the cluster to figure out which nodes are available for http calls and their addresses.

The external cluster is used as global cluster if the `tests.cluster` system property is available. The property needs to contain a comma separated list of available elasticsearch nodes that will be used to connect to the cluster (e.g. localhost:9300,localhost:9301).

Only a subset of the integration tests can currently be run successfully against the external cluster, for more precision the ones that don't modify the cluster layout (don't require `cluster()` functionalities but rely only on `immutableCluster()`). Also at least two data nodes are required otherwise the `ensureGreen` calls cannot succeed.