Jagger
 All Classes Namespaces Files Functions Variables Groups Pages
JLoadScenario.java
Go to the documentation of this file.
1 package com.griddynamics.jagger.user.test.configurations;
2 
3 import com.griddynamics.jagger.user.test.configurations.aux.Id;
4 
5 import java.util.ArrayList;
6 import java.util.Collections;
7 import java.util.List;
8 
26 public class JLoadScenario {
27 
28  private final String id;
29  private final List<JParallelTestsGroup> testGroups;
30 
38  public static Builder builder(Id id, List<JParallelTestsGroup> testGroups) {
39  return new Builder(id, testGroups);
40  }
41 
50  public static Builder builder(Id id, JParallelTestsGroup testGroup, JParallelTestsGroup... testGroups) {
51 
52  List<JParallelTestsGroup> jParallelTestsGroupList = new ArrayList<>();
53  jParallelTestsGroupList.add(testGroup);
54  Collections.addAll(jParallelTestsGroupList, testGroups);
55 
56  return new Builder(id, jParallelTestsGroupList);
57  }
58 
59  private JLoadScenario(Builder builder) {
60  this.id = builder.id.value();
61  this.testGroups = builder.testGroups;
62  }
63 
64  public static class Builder {
65  private final Id id;
66  private final List<JParallelTestsGroup> testGroups;
67 
68  public Builder(Id id, List<JParallelTestsGroup> testGroups) {
69  this.id = id;
70  this.testGroups = testGroups;
71  }
72 
78  public JLoadScenario build() {
79  return new JLoadScenario(this);
80  }
81 
82  }
83 
84  public List<JParallelTestsGroup> getTestGroups() {
85  return testGroups;
86  }
87 
88  public String getId() {
89  return id;
90  }
91 }