Jagger
 All Classes Namespaces Files Functions Variables Groups Pages
JParallelTestsGroup.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.auxiliary.Id;
4 
5 import java.util.ArrayList;
6 import java.util.Collections;
7 import java.util.List;
8 
22 public class JParallelTestsGroup {
23  private final String id;
24  private final List<JLoadTest> tests;
25 
33  public static Builder builder(Id id, List<JLoadTest> tests) {
34  return new Builder(id, tests);
35  }
36 
45  public static Builder builder(Id id, JLoadTest test, JLoadTest... tests) {
46 
47  List<JLoadTest> testList = new ArrayList<>();
48  testList.add(test);
49  Collections.addAll(testList, tests);
50 
51  return new Builder(id, testList);
52  }
53 
54  private JParallelTestsGroup(Builder builder) {
55  this.id = builder.id.value();
56  this.tests = builder.tests;
57  }
58 
59  public static class Builder {
60  private final Id id;
61 
62  private final List<JLoadTest> tests;
63 
64  public Builder(Id id, List<JLoadTest> tests) {
65  this.id = id;
66  this.tests = tests;
67  }
68 
75  return new JParallelTestsGroup(this);
76  }
77 
78  }
79 
80  public List<JLoadTest> getTests() {
81  return tests;
82  }
83 
84  public String getId() {
85  return id;
86  }
87 }