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> steps; |
16 | |
private final ExamplesTable examplesTable; |
17 | |
private final GivenStories givenStories; |
18 | |
|
19 | |
public Scenario() { |
20 | 11 | this(Arrays.<String>asList()); |
21 | 11 | } |
22 | |
|
23 | |
public Scenario(List<String> steps) { |
24 | 18 | this("", steps); |
25 | 18 | } |
26 | |
|
27 | |
public Scenario(String title, Meta meta) { |
28 | 2 | this(title, meta, GivenStories.EMPTY, ExamplesTable.EMPTY, Arrays.<String>asList()); |
29 | 2 | } |
30 | |
|
31 | |
public Scenario(String title, List<String> steps) { |
32 | 26 | this(title, Meta.EMPTY, GivenStories.EMPTY, ExamplesTable.EMPTY, steps); |
33 | 26 | } |
34 | |
|
35 | 158 | public Scenario(String title, Meta meta, GivenStories givenStories, ExamplesTable examplesTable, List<String> steps) { |
36 | 158 | this.title = title; |
37 | 158 | this.meta = meta; |
38 | 158 | this.givenStories = givenStories; |
39 | 158 | this.steps = steps; |
40 | 158 | this.examplesTable = examplesTable; |
41 | 158 | } |
42 | |
|
43 | |
public Meta getMeta(){ |
44 | 45 | return meta; |
45 | |
} |
46 | |
|
47 | |
public GivenStories getGivenStories() { |
48 | 28 | return givenStories; |
49 | |
} |
50 | |
|
51 | |
public List<String> getSteps() { |
52 | 122 | return unmodifiableList(steps); |
53 | |
} |
54 | |
|
55 | |
public String getTitle() { |
56 | 33 | return title; |
57 | |
} |
58 | |
|
59 | |
public ExamplesTable getExamplesTable() { |
60 | 22 | return examplesTable; |
61 | |
} |
62 | |
|
63 | |
@Override |
64 | |
public String toString() { |
65 | 15 | return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE); |
66 | |
} |
67 | |
|
68 | |
} |