1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.javagen.funcgen.model;
17
18 import java.util.ArrayList;
19 import java.util.List;
20
21 import javax.xml.bind.annotation.XmlRootElement;
22 import javax.xml.bind.annotation.XmlTransient;
23
24 import org.javagen.agile.core.model.Model;
25
26 /***
27 * Suite can hold Test instances, a set of permutations for generating Tests or additional Suites.
28 *
29 * @author Richard Easterling
30 */
31 @XmlRootElement
32 public class Suite extends TestHolder {
33
34 public static final String DEFAULT_MODEL_TYPE = "suite";
35
36 public Suite() {
37 super();
38 this.setModelType(DEFAULT_MODEL_TYPE);
39 }
40
41 public Suite(String name) {
42 this();
43 this.setName(name);
44 }
45
46 @XmlTransient
47 public List<Permutations> getPermutations() {
48 List<Permutations> permutations = new ArrayList<Permutations>();
49 for(Model child : getChildModels()) {
50 if (child instanceof Permutations)
51 permutations.add( (Permutations)child );
52 }
53 return permutations;
54 }
55
56 public void addPermutations(Permutations permutation) {
57 this.addChildModel(permutation);
58 }
59
60 @XmlTransient
61 public List<PermutationsGroup> getPermutationsGroups() {
62 List<PermutationsGroup> permutationsGroups = new ArrayList<PermutationsGroup>();
63 for(Model child : getChildModels()) {
64 if (child instanceof PermutationsGroup)
65 permutationsGroups.add( (PermutationsGroup)child );
66 }
67 return permutationsGroups;
68 }
69
70 public void addPermutationsGroup(PermutationsGroup permutationsGroup) {
71 this.addChildModel(permutationsGroup);
72 }
73
74 }