Coverage Report - org.jbehave.core.embedder.EmbedderControls
 
Classes in this File Line Coverage Branch Coverage Complexity
EmbedderControls
100%
47/47
N/A
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  71
     private boolean batch = false;
 12  71
     private boolean skip = false;
 13  71
     private boolean generateViewAfterStories = true;
 14  71
     private boolean ignoreFailureInStories = false;
 15  71
     private boolean ignoreFailureInView = false;
 16  71
     private boolean verboseFailures = false;
 17  71
     private boolean verboseFiltering = false;
 18  71
     private long storyTimeoutInSecs = 300; // 5 mins is default.
 19  71
     private String storyTimeoutInSecsByPath = ""; // If not specified or specified as blank, storyTimeoutInSecs's default is used 
 20  71
         private boolean failOnStoryTimeout = false;
 21  71
     private int threads = 1;
 22  
 
 23  71
     public EmbedderControls() {
 24  71
     }
 25  
 
 26  
     public boolean batch() {
 27  35
         return batch;
 28  
     }
 29  
 
 30  
     public boolean skip() {
 31  87
         return skip;
 32  
     }
 33  
 
 34  
     public boolean generateViewAfterStories() {
 35  43
         return generateViewAfterStories;
 36  
     }
 37  
 
 38  
     public boolean ignoreFailureInStories() {
 39  102
         return ignoreFailureInStories;
 40  
     }
 41  
 
 42  
     public boolean ignoreFailureInView() {
 43  15
         return ignoreFailureInView;
 44  
     }
 45  
 
 46  
     public boolean verboseFailures(){
 47  54
         return verboseFailures;
 48  
     }
 49  
 
 50  
     public boolean verboseFiltering() {
 51  8
         return verboseFiltering;
 52  
     }
 53  
 
 54  
     public long storyTimeoutInSecs() {
 55  37
         return storyTimeoutInSecs;
 56  
     }
 57  
     
 58  
     public String storyTimeoutInSecsByPath() {
 59  42
         return storyTimeoutInSecsByPath;
 60  
     }
 61  
 
 62  
         public boolean failOnStoryTimeout() {
 63  14
                 return failOnStoryTimeout;
 64  
         }
 65  
 
 66  
         public int threads() {
 67  237
        return threads;
 68  
     }
 69  
 
 70  
     public EmbedderControls doBatch(boolean batch) {
 71  14
         this.batch = batch;
 72  14
         return this;
 73  
     }
 74  
 
 75  
     public EmbedderControls doSkip(boolean skip) {
 76  12
         this.skip = skip;
 77  12
         return this;
 78  
     }
 79  
 
 80  
     public EmbedderControls doGenerateViewAfterStories(boolean generateViewAfterStories) {
 81  14
         this.generateViewAfterStories = generateViewAfterStories;
 82  14
         return this;
 83  
     }
 84  
 
 85  
     public EmbedderControls doIgnoreFailureInStories(boolean ignoreFailureInStories) {
 86  13
         this.ignoreFailureInStories = ignoreFailureInStories;
 87  13
         return this;
 88  
     }
 89  
 
 90  
     public EmbedderControls doIgnoreFailureInView(boolean ignoreFailureInView) {
 91  12
         this.ignoreFailureInView = ignoreFailureInView;
 92  12
         return this;
 93  
     }
 94  
 
 95  
     public EmbedderControls doVerboseFailures(boolean verboseFailures){
 96  10
         this.verboseFailures = verboseFailures;
 97  10
         return this;        
 98  
     }
 99  
 
 100  
     public EmbedderControls doVerboseFiltering(boolean verboseFiltering){
 101  9
         this.verboseFiltering = verboseFiltering;
 102  9
         return this;        
 103  
     }
 104  
 
 105  
     public EmbedderControls useStoryTimeoutInSecs(long storyTimeoutInSecs) {
 106  16
         this.storyTimeoutInSecs = storyTimeoutInSecs;
 107  16
         return this;
 108  
     }
 109  
     
 110  
     public EmbedderControls useStoryTimeoutInSecsByPath(String storyTimeoutInSecsByPath) {
 111  23
         this.storyTimeoutInSecsByPath = storyTimeoutInSecsByPath;
 112  23
         return this;
 113  
     }
 114  
 
 115  
     public EmbedderControls doFailOnStoryTimeout(boolean failOnStoryTimeout) {
 116  23
         this.failOnStoryTimeout = failOnStoryTimeout;
 117  23
         return this;
 118  
     }
 119  
 
 120  
     public EmbedderControls useThreads(int threads) {
 121  10
         this.threads = threads;
 122  10
         return this;
 123  
     }
 124  
     
 125  
     @Override
 126  
     public String toString() {
 127  52
         return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE);
 128  
     }
 129  
 }