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