1 | |
package org.jbehave.core.embedder; |
2 | |
|
3 | |
import org.apache.commons.lang.builder.ToStringBuilder; |
4 | |
import org.apache.commons.lang.builder.ToStringStyle; |
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
public class EmbedderControls { |
10 | |
|
11 | 107 | private boolean batch = false; |
12 | 107 | private boolean skip = false; |
13 | 107 | private boolean generateViewAfterStories = true; |
14 | 107 | private boolean ignoreFailureInStories = false; |
15 | 107 | private boolean ignoreFailureInView = false; |
16 | 107 | private long storyTimeoutInSecs = 300; |
17 | 107 | private int threads = 1; |
18 | |
|
19 | 107 | public EmbedderControls() { |
20 | 107 | } |
21 | |
|
22 | |
public boolean batch() { |
23 | 43 | return batch; |
24 | |
} |
25 | |
|
26 | |
public boolean skip() { |
27 | 54 | return skip; |
28 | |
} |
29 | |
|
30 | |
public boolean generateViewAfterStories() { |
31 | 22 | return generateViewAfterStories; |
32 | |
} |
33 | |
|
34 | |
public boolean ignoreFailureInStories() { |
35 | 16 | return ignoreFailureInStories; |
36 | |
} |
37 | |
|
38 | |
public boolean ignoreFailureInView() { |
39 | 22 | return ignoreFailureInView; |
40 | |
} |
41 | |
|
42 | |
public long storyTimeoutInSecs() { |
43 | 6 | return storyTimeoutInSecs; |
44 | |
} |
45 | |
|
46 | |
public int threads() { |
47 | 39 | return threads; |
48 | |
} |
49 | |
|
50 | |
public EmbedderControls doBatch(boolean batch) { |
51 | 13 | this.batch = batch; |
52 | 13 | return this; |
53 | |
} |
54 | |
|
55 | |
public EmbedderControls doSkip(boolean skip) { |
56 | 10 | this.skip = skip; |
57 | 10 | return this; |
58 | |
} |
59 | |
|
60 | |
public EmbedderControls doGenerateViewAfterStories(boolean generateViewAfterStories) { |
61 | 10 | this.generateViewAfterStories = generateViewAfterStories; |
62 | 10 | return this; |
63 | |
} |
64 | |
|
65 | |
public EmbedderControls doIgnoreFailureInStories(boolean ignoreFailureInStories) { |
66 | 11 | this.ignoreFailureInStories = ignoreFailureInStories; |
67 | 11 | return this; |
68 | |
} |
69 | |
|
70 | |
public EmbedderControls doIgnoreFailureInView(boolean ignoreFailureInView) { |
71 | 8 | this.ignoreFailureInView = ignoreFailureInView; |
72 | 8 | return this; |
73 | |
} |
74 | |
|
75 | |
public EmbedderControls useStoryTimeoutInSecs(long storyTimeoutInSecs) { |
76 | 7 | this.storyTimeoutInSecs = storyTimeoutInSecs; |
77 | 7 | return this; |
78 | |
} |
79 | |
|
80 | |
public EmbedderControls useThreads(int threads) { |
81 | 7 | this.threads = threads; |
82 | 7 | return this; |
83 | |
} |
84 | |
|
85 | |
@Override |
86 | |
public String toString() { |
87 | 2 | return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE); |
88 | |
} |
89 | |
|
90 | |
} |