1 | |
package org.jbehave.core.model; |
2 | |
|
3 | |
import static java.util.Collections.unmodifiableList; |
4 | |
|
5 | |
import java.util.Arrays; |
6 | |
import java.util.List; |
7 | |
|
8 | |
import org.apache.commons.lang.builder.ToStringBuilder; |
9 | |
import org.apache.commons.lang.builder.ToStringStyle; |
10 | |
|
11 | |
public class Scenario { |
12 | |
|
13 | |
private final String title; |
14 | |
private final Meta meta; |
15 | |
private final List<String> givenStoryPaths; |
16 | |
private final List<String> steps; |
17 | |
private final ExamplesTable examplesTable; |
18 | |
|
19 | |
public Scenario() { |
20 | 9 | this(Arrays.<String>asList()); |
21 | 9 | } |
22 | |
|
23 | |
public Scenario(List<String> steps) { |
24 | 16 | this("", steps); |
25 | 16 | } |
26 | |
|
27 | |
public Scenario(String title, Meta meta) { |
28 | 2 | this(title, meta, Arrays.<String>asList(), new ExamplesTable(""), Arrays.<String>asList()); |
29 | 2 | } |
30 | |
|
31 | |
public Scenario(String title, List<String> steps) { |
32 | 23 | this(title, Arrays.<String>asList(), new ExamplesTable(""), steps); |
33 | 23 | } |
34 | |
|
35 | |
public Scenario(String title, List<String> givenStoryPaths, List<String> steps) { |
36 | 1 | this(title, givenStoryPaths, new ExamplesTable(""), steps); |
37 | 1 | } |
38 | |
|
39 | |
public Scenario(String title, List<String> givenStoryPaths, ExamplesTable examplesTable, List<String> steps) { |
40 | 25 | this(title, Meta.EMPTY, givenStoryPaths, examplesTable, steps); |
41 | 25 | } |
42 | |
|
43 | 153 | public Scenario(String title, Meta meta, List<String> givenStoryPaths, ExamplesTable examplesTable, List<String> steps) { |
44 | 153 | this.title = title; |
45 | 153 | this.meta = meta; |
46 | 153 | this.givenStoryPaths = givenStoryPaths; |
47 | 153 | this.steps = steps; |
48 | 153 | this.examplesTable = examplesTable; |
49 | 153 | } |
50 | |
|
51 | |
public Meta getMeta(){ |
52 | 38 | return meta; |
53 | |
} |
54 | |
|
55 | |
public List<String> getGivenStoryPaths() { |
56 | 23 | return unmodifiableList(givenStoryPaths); |
57 | |
} |
58 | |
|
59 | |
public List<String> getSteps() { |
60 | 122 | return unmodifiableList(steps); |
61 | |
} |
62 | |
|
63 | |
public String getTitle() { |
64 | 29 | return title; |
65 | |
} |
66 | |
|
67 | |
public ExamplesTable getExamplesTable() { |
68 | 19 | return examplesTable; |
69 | |
} |
70 | |
|
71 | |
@Override |
72 | |
public String toString() { |
73 | 15 | return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE); |
74 | |
} |
75 | |
|
76 | |
} |