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.testgroup.TestGroupDecisionMakerListener;
6 import com.griddynamics.jagger.engine.e1.collector.testgroup.TestGroupListener;
7 import com.griddynamics.jagger.user.test.configurations.auxiliary.Id;
9 import java.util.ArrayList;
10 import java.util.Collections;
11 import java.util.List;
12 import java.util.stream.Collectors;
29 private final String id;
30 private final List<JLoadTest> tests;
31 private final List<Provider<TestGroupListener>> listeners;
32 private final List<Provider<TestGroupDecisionMakerListener>> decisionMakerListeners;
57 List<JLoadTest> testList =
new ArrayList<>();
59 Collections.addAll(testList, tests);
61 return new Builder(
id, testList);
65 this.
id = builder.id.value();
66 this.tests = builder.tests;
67 this.listeners = builder.listeners;
68 this.decisionMakerListeners = builder.decisionMakerListeners;
74 private final List<JLoadTest> tests;
75 private List<Provider<TestGroupListener>> listeners = Lists.newArrayList();
76 private List<Provider<TestGroupDecisionMakerListener>> decisionMakerListeners = Lists.newArrayList();
93 this.listeners.add(listener);
107 this.listeners.addAll(listeners);
122 this.decisionMakerListeners.add(listener);
137 this.decisionMakerListeners.addAll(listeners);
148 if (tests.stream().map(
JLoadTest::getId).collect(Collectors.toSet()).size() < tests.size()) {
149 throw new IllegalStateException(
"JLoadTest ids inside one JParallelTestsGroup are not all unique");
170 return decisionMakerListeners;