##### Coverage Report - org.jbehave.core.embedder.EmbedderControls

Classes in this File | Line Coverage | Branch Coverage | Complexity
EmbedderControls |
100% | 39/39
N/A | N/A
| 1.0;1

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 |  |
      * Holds values used by the Embedder to control execution flow.
8 |  |
      */
9 |  |
     public class EmbedderControls {
10 |  |
11 | 113 |
         private boolean batch = false;
12 | 113 |
         private boolean skip = false;
13 | 113 |
         private boolean generateViewAfterStories = true;
14 | 113 |
         private boolean ignoreFailureInStories = false;
15 | 113 |
         private boolean ignoreFailureInView = false;
16 | 113 |
         private boolean verboseFailures = false;
17 | 113 |
         private boolean verboseFiltering = false;
18 | 113 |
         private long storyTimeoutInSecs = 300; // 5 mins is default.
19 | 113 |
         private int threads = 1;
20 |  |
21 | 113 |
         public EmbedderControls() {
22 | 113 |
         }
23 |  |
24 |  |
         public boolean batch() {
25 | 19 |
             return batch;
26 |  |
         }
27 |  |
28 |  |
         public boolean skip() {
29 | 49 |
             return skip;
30 |  |
         }
31 |  |
32 |  |
         public boolean generateViewAfterStories() {
33 | 22 |
             return generateViewAfterStories;
34 |  |
         }
35 |  |
36 |  |
         public boolean ignoreFailureInStories() {
37 | 31 |
             return ignoreFailureInStories;
38 |  |
         }
39 |  |
40 |  |
         public boolean ignoreFailureInView() {
41 | 14 |
             return ignoreFailureInView;
42 |  |
         }
43 |  |
44 |  |
         public boolean verboseFailures(){
45 | 27 |
             return verboseFailures;
46 |  |
         }
47 |  |
48 |  |
         public boolean verboseFiltering() {
49 | 6 |
             return verboseFiltering;
50 |  |
         }
51 |  |
52 |  |
         public long storyTimeoutInSecs() {
53 | 77 |
             return storyTimeoutInSecs;
54 |  |
         }
55 |  |
56 |  |
         public int threads() {
57 | 121 |
            return threads;
58 |  |
         }
59 |  |
60 |  |
         public EmbedderControls doBatch(boolean batch) {
61 | 15 |
             this.batch = batch;
62 | 15 |
             return this;
63 |  |
         }
64 |  |
65 |  |
         public EmbedderControls doSkip(boolean skip) {
66 | 12 |
             this.skip = skip;
67 | 12 |
             return this;
68 |  |
         }
69 |  |
70 |  |
         public EmbedderControls doGenerateViewAfterStories(boolean generateViewAfterStories) {
71 | 14 |
             this.generateViewAfterStories = generateViewAfterStories;
72 | 14 |
             return this;
73 |  |
         }
74 |  |
75 |  |
         public EmbedderControls doIgnoreFailureInStories(boolean ignoreFailureInStories) {
76 | 13 |
             this.ignoreFailureInStories = ignoreFailureInStories;
77 | 13 |
             return this;
78 |  |
         }
79 |  |
80 |  |
         public EmbedderControls doIgnoreFailureInView(boolean ignoreFailureInView) {
81 | 12 |
             this.ignoreFailureInView = ignoreFailureInView;
82 | 12 |
             return this;
83 |  |
         }
84 |  |
85 |  |
         public EmbedderControls doVerboseFailures(boolean verboseFailures){
86 | 9 |
             this.verboseFailures = verboseFailures;
87 | 9 |
             return this;
88 |  |
         }
89 |  |
90 |  |
         public EmbedderControls doVerboseFiltering(boolean verboseFiltering){
91 | 9 |
             this.verboseFiltering = verboseFiltering;
92 | 9 |
             return this;
93 |  |
         }
94 |  |
95 |  |
         public EmbedderControls useStoryTimeoutInSecs(long storyTimeoutInSecs) {
96 | 12 |
             this.storyTimeoutInSecs = storyTimeoutInSecs;
97 | 12 |
             return this;
98 |  |
         }
99 |  |
100 |  |
         public EmbedderControls useThreads(int threads) {
101 | 9 |
             this.threads = threads;
102 | 9 |
             return this;
103 |  |
         }
104 |  |
105 |  |
         @Override
106 |  |
         public String toString() {
107 | 24 |
             return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE);
108 |  |
         }
109 |  |
110 |  |
     }