1 package com.griddynamics.jagger.user.test.configurations;
3 import com.google.common.collect.Lists;
4 import com.griddynamics.jagger.engine.e1.Provider;
5 import com.griddynamics.jagger.engine.e1.collector.ResponseValidatorProvider;
6 import com.griddynamics.jagger.engine.e1.collector.invocation.InvocationListener;
7 import com.griddynamics.jagger.invoker.Invoker;
8 import com.griddynamics.jagger.invoker.QueryPoolLoadBalancer;
9 import com.griddynamics.jagger.invoker.RandomLoadBalancer;
10 import com.griddynamics.jagger.invoker.RoundRobinPairSupplierFactory;
11 import com.griddynamics.jagger.invoker.v2.DefaultHttpInvoker;
12 import com.griddynamics.jagger.invoker.v2.DefaultInvokerProvider;
13 import com.griddynamics.jagger.user.test.configurations.auxiliary.Id;
14 import com.griddynamics.jagger.user.test.configurations.loadbalancer.JLoadBalancer;
16 import java.util.List;
18 import static com.griddynamics.jagger.user.test.configurations.loadbalancer.JLoadBalancer.DefaultLoadBalancer.ROUND_ROBIN;
40 private final String id;
41 private final Iterable endpoints;
43 private final String comment;
44 private final Iterable queries;
45 private final Provider<Invoker> invoker;
46 private final List<ResponseValidatorProvider> validators;
47 private final List<Provider<InvocationListener>> listeners;
48 private final QueryPoolLoadBalancer loadBalancer;
51 this.
id = builder.id.
value();
52 this.endpoints = builder.endpointsProvider;
54 this.comment = (builder.comment == null) ?
"" : builder.comment;
55 this.queries = builder.queries;
56 this.invoker = builder.invoker;
57 this.validators = builder.validators;
58 this.listeners = builder.listeners;
59 this.loadBalancer = builder.loadBalancer;
72 return new Builder(
id, endpointsProvider);
77 private final Iterable endpointsProvider;
79 private String comment =
"";
80 private Iterable queries;
82 private List<ResponseValidatorProvider> validators = Lists.newArrayList();
83 private List<Provider<InvocationListener>> listeners = Lists.newArrayList();
84 private QueryPoolLoadBalancer loadBalancer;
86 private Builder(
Id id, Iterable endpointsProvider) {
88 this.endpointsProvider = endpointsProvider;
98 this.comment = comment;
109 this.queries = queryProvider;
122 this.loadBalancer = loadBalancer;
136 this.invoker = invoker;
150 this.validators.addAll(validators);
165 this.validators.add(validator);
182 this.listeners.addAll(listeners);
199 this.listeners.add(listener);