- Added TestCluster#getInstances(Class) method.
This commit is contained in:
parent
f6c2d9caf3
commit
846b833539
|
@ -475,6 +475,14 @@ public class TestCluster implements Closeable, Iterable<Client> {
|
||||||
return getInstance(ClusterService.class);
|
return getInstance(ClusterService.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public synchronized <T> Iterable<T> getInstances(Class<T> clazz) {
|
||||||
|
List<T> instances = new ArrayList<T>(nodes.size());
|
||||||
|
for (NodeAndClient nodeAndClient : nodes.values()) {
|
||||||
|
instances.add(getInstanceFromNode(clazz, nodeAndClient.node));
|
||||||
|
}
|
||||||
|
return instances;
|
||||||
|
}
|
||||||
|
|
||||||
public synchronized <T> T getInstance(Class<T> clazz, final String node) {
|
public synchronized <T> T getInstance(Class<T> clazz, final String node) {
|
||||||
final Predicate<TestCluster.NodeAndClient> predicate;
|
final Predicate<TestCluster.NodeAndClient> predicate;
|
||||||
if (node != null) {
|
if (node != null) {
|
||||||
|
|
Loading…
Reference in New Issue