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

Classes in this File | Line Coverage | Branch Coverage | Complexity
UnmodifiableEmbedderControls |
100% | 23/23
N/A | N/A
| 1.4090909090909092;1.409
UnmodifiableEmbedderControls$ModificationNotAllowed |
100% | 2/2
N/A | N/A
| 1.4090909090909092;1.409

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 |  |
     public class UnmodifiableEmbedderControls extends EmbedderControls {
7 |  |
8 |  |
         private EmbedderControls delegate;
9 |  |
10 | 1 |
         public UnmodifiableEmbedderControls(EmbedderControls delegate) {
11 | 1 |
             this.delegate = delegate;
12 | 1 |
         }
13 |  |
14 |  |
         @Override
15 |  |
         public boolean batch() {
16 | 1 |
             return delegate.batch();
17 |  |
         }
18 |  |
19 |  |
         @Override
20 |  |
         public boolean ignoreFailureInView() {
21 | 1 |
             return delegate.ignoreFailureInView();
22 |  |
         }
23 |  |
24 |  |
         @Override
25 |  |
         public boolean ignoreFailureInStories() {
26 | 1 |
             return delegate.ignoreFailureInStories();
27 |  |
         }
28 |  |
29 |  |
         @Override
30 |  |
         public boolean generateViewAfterStories() {
31 | 1 |
             return delegate.generateViewAfterStories();
32 |  |
         }
33 |  |
34 |  |
         @Override
35 |  |
         public boolean skip() {
36 | 1 |
             return delegate.skip();
37 |  |
         }
38 |  |
39 |  |
         @Override
40 |  |
         public boolean verboseFailures() {
41 | 1 |
             return delegate.verboseFailures();
42 |  |
         }
43 |  |
44 |  |
         @Override
45 |  |
         public boolean verboseFiltering() {
46 | 1 |
             return delegate.verboseFiltering();
47 |  |
         }
48 |  |
49 |  |
         @Override
50 |  |
         public long storyTimeoutInSecs() {
51 | 1 |
             return delegate.storyTimeoutInSecs();
52 |  |
         }
53 |  |
54 |  |
         @Override
55 |  |
         public int threads() {
56 | 1 |
             return delegate.threads();
57 |  |
         }
58 |  |
59 |  |
         @Override
60 |  |
         public EmbedderControls doBatch(boolean batch) {
61 | 1 |
             throw notAllowed();
62 |  |
         }
63 |  |
64 |  |
         @Override
65 |  |
         public EmbedderControls doIgnoreFailureInView(boolean ignoreFailureInReports) {
66 | 1 |
             throw notAllowed();
67 |  |
         }
68 |  |
69 |  |
         @Override
70 |  |
         public EmbedderControls doIgnoreFailureInStories(boolean ignoreFailureInStories) {
71 | 1 |
             throw notAllowed();
72 |  |
         }
73 |  |
74 |  |
         @Override
75 |  |
         public EmbedderControls doGenerateViewAfterStories(boolean generateViewAfterStories) {
76 | 1 |
             throw notAllowed();
77 |  |
         }
78 |  |
79 |  |
         @Override
80 |  |
         public EmbedderControls doSkip(boolean skip) {
81 | 1 |
             throw notAllowed();
82 |  |
         }
83 |  |
84 |  |
         @Override
85 |  |
         public EmbedderControls doVerboseFailures(boolean verboseFailures) {
86 | 1 |
             throw notAllowed();
87 |  |
         }
88 |  |
89 |  |
         @Override
90 |  |
         public EmbedderControls doVerboseFiltering(boolean verboseFiltering) {
91 | 1 |
             throw notAllowed();
92 |  |
         }
93 |  |
94 |  |
         @Override
95 |  |
         public EmbedderControls useStoryTimeoutInSecs(long storyTimeoutInSecs) {
96 | 1 |
             throw notAllowed();
97 |  |
         }
98 |  |
99 |  |
         @Override
100 |  |
         public EmbedderControls useThreads(int threads) {
101 | 1 |
             throw notAllowed();
102 |  |
         }
103 |  |
104 |  |
         private RuntimeException notAllowed() {
105 | 9 |
             return new ModificationNotAllowed();
106 |  |
         }
107 |  |
108 |  |
         @Override
109 |  |
         public String toString() {
110 | 1 |
             return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).append(delegate).toString();
111 |  |
         }
112 |  |
113 |  |
         @SuppressWarnings("serial")
114 |  |
         public static class ModificationNotAllowed extends RuntimeException {
115 |  |
             public ModificationNotAllowed() {
116 | 9 |
                 super("Configuration elements are unmodifiable");
117 | 9 |
             }
118 |  |
         }
119 |  |
120 |  |
     }