1 package com.griddynamics.jagger.user.test.configurations;
3 import com.griddynamics.jagger.engine.e1.Provider;
4 import com.griddynamics.jagger.engine.e1.collector.testgroup.TestGroupDecisionMakerListener;
5 import com.griddynamics.jagger.engine.e1.collector.testgroup.TestGroupListener;
6 import com.griddynamics.jagger.user.test.configurations.auxiliary.Id;
8 import com.google.common.collect.Lists;
10 import java.util.ArrayList;
11 import java.util.Collections;
12 import java.util.List;
13 import java.util.stream.Collectors;
30 private final String id;
31 private final List<JLoadTest> tests;
32 private final List<Provider<TestGroupListener>> listeners;
33 private final List<Provider<TestGroupDecisionMakerListener>> decisionMakerListeners;
58 List<JLoadTest> testList =
new ArrayList<>();
60 Collections.addAll(testList, tests);
62 return new Builder(
id, testList);
66 this.
id = builder.id.value();
67 this.tests = builder.tests;
68 this.listeners = builder.listeners;
69 this.decisionMakerListeners = builder.decisionMakerListeners;
75 private final List<JLoadTest> tests;
76 private List<Provider<TestGroupListener>> listeners = Lists.newArrayList();
77 private List<Provider<TestGroupDecisionMakerListener>> decisionMakerListeners = Lists.newArrayList();
94 this.listeners.add(listener);
108 this.listeners.addAll(listeners);
123 this.decisionMakerListeners.add(listener);
138 this.decisionMakerListeners.addAll(listeners);
149 if (tests.stream().map(
JLoadTest::getId).collect(Collectors.toSet()).size() < tests.size()) {
150 throw new IllegalStateException(
"JLoadTest ids inside one JParallelTestsGroup are not all unique");
171 return decisionMakerListeners;