How to use useEmbedderFailureStrategy method of net.serenitybdd.jbehave.embedders.ExtendedEmbedder class

Best Serenity jBehave code snippet using net.serenitybdd.jbehave.embedders.ExtendedEmbedder.useEmbedderFailureStrategy

Run Serenity jBehave automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

copy
1package net.serenitybdd.jbehave.embedders;
2
3import net.serenitybdd.jbehave.embedders.monitors.CompositeEmbedderMonitor;
4import org.jbehave.core.configuration.Configuration;
5import org.jbehave.core.embedder.*;
6import org.jbehave.core.model.Story;
7import org.jbehave.core.steps.CandidateSteps;
8import org.jbehave.core.steps.InjectableStepsFactory;
9
10import java.io.File;
11import java.util.List;
12import java.util.Map;
13import java.util.Properties;
14import java.util.concurrent.ConcurrentHashMap;
15import java.util.concurrent.ExecutorService;
16
17/**
18 * User: YamStranger
19 * Date: 3/25/16
20 * Time: 12:02 AM
21 */
22public class ExtendedEmbedder extends Embedder {
23    final Embedder embedder;
24    final Map<String, Story> stories = new ConcurrentHashMap<>();
25
26    public ExtendedEmbedder(Embedder embedder) {
27        this.embedder = embedder;
28        this.embedder.useEmbedderMonitor(new CompositeEmbedderMonitor(
29            embedder.embedderMonitor()!=null?embedder.embedderMonitor():embedderMonitor));
30    }
31
32    public CompositeEmbedderMonitor getEmbedderMonitor() {
33        return (CompositeEmbedderMonitor) this.embedder.embedderMonitor();
34    }
35
36    public void registerStory(final String path, final Story story) {
37        this.stories.put(path, story);
38    }
39
40    public Story findStory(final String path){
41        return this.stories.get(path);
42    }
43
44    @Override
45    public void mapStoriesAsPaths(List<String> storyPaths) {
46        embedder.mapStoriesAsPaths(storyPaths);
47    }
48
49    @Override
50    public void runAsEmbeddables(List<String> classNames) {
51        embedder.runAsEmbeddables(classNames);
52    }
53
54    @Override
55    public void runStoriesWithAnnotatedEmbedderRunner(List<String> classNames) {
56        embedder.runStoriesWithAnnotatedEmbedderRunner(classNames);
57    }
58
59    @Override
60    public void runStoriesAsPaths(List<String> storyPaths) {
61        embedder.runStoriesAsPaths(storyPaths);
62    }
63
64    @Override
65    public void generateReportsView() {
66        embedder.generateReportsView();
67    }
68
69    @Override
70    public void generateReportsView(File outputDirectory, List<String> formats, Properties viewResources) {
71        embedder.generateReportsView(outputDirectory, formats, viewResources);
72    }
73
74    @Override
75    public void generateCrossReference() {
76        embedder.generateCrossReference();
77    }
78
79    @Override
80    public void reportStepdocs() {
81        embedder.reportStepdocs();
82    }
83
84    @Override
85    public void reportStepdocsAsEmbeddables(List<String> classNames) {
86        embedder.reportStepdocsAsEmbeddables(classNames);
87    }
88
89    @Override
90    public void reportStepdocs(Configuration configuration, List<CandidateSteps> candidateSteps) {
91        embedder.reportStepdocs(configuration, candidateSteps);
92    }
93
94    @Override
95    public void reportMatchingStepdocs(String stepAsString) {
96        embedder.reportMatchingStepdocs(stepAsString);
97    }
98
99    @Override
100    public void processSystemProperties() {
101        embedder.processSystemProperties();
102    }
103
104    @Override
105    public EmbedderClassLoader classLoader() {
106        return embedder.classLoader();
107    }
108
109    @Override
110    public Configuration configuration() {
111        return embedder.configuration();
112    }
113
114    @Override
115    public List<CandidateSteps> candidateSteps() {
116        return embedder.candidateSteps();
117    }
118
119    @Override
120    public InjectableStepsFactory stepsFactory() {
121        return embedder.stepsFactory();
122    }
123
124    @Override
125    public EmbedderControls embedderControls() {
126        return embedder.embedderControls();
127    }
128
129    @Override
130    public EmbedderMonitor embedderMonitor() {
131        return embedder.embedderMonitor();
132    }
133
134    @Override
135    public EmbedderFailureStrategy embedderFailureStrategy() {
136        return embedder.embedderFailureStrategy();
137    }
138
139    @Override
140    public boolean hasExecutorService() {
141        return embedder.hasExecutorService();
142    }
143
144    @Override
145    public ExecutorService executorService() {
146        return embedder.executorService();
147    }
148
149    @Override
150    public StoryManager storyManager() {
151        return embedder.storyManager();
152    }
153
154    @Override
155    public List<String> metaFilters() {
156        return embedder.metaFilters();
157    }
158
159    @Override
160    public Map<String, MetaFilter.MetaMatcher> metaMatchers() {
161        return embedder.metaMatchers();
162    }
163
164    @Override
165    public MetaFilter metaFilter() {
166        return embedder.metaFilter();
167    }
168
169    @Override
170    public PerformableTree performableTree() {
171        return embedder.performableTree();
172    }
173
174    @Override
175    public Properties systemProperties() {
176        return embedder.systemProperties();
177    }
178
179    @Override
180    public StoryTimeouts.TimeoutParser[] timeoutParsers() {
181        return embedder.timeoutParsers();
182    }
183
184    @Override
185    public void useClassLoader(EmbedderClassLoader classLoader) {
186        embedder.useClassLoader(classLoader);
187    }
188
189    @Override
190    public void useConfiguration(Configuration configuration) {
191        embedder.useConfiguration(configuration);
192    }
193
194    @Override
195    public void useCandidateSteps(List<CandidateSteps> candidateSteps) {
196        embedder.useCandidateSteps(candidateSteps);
197    }
198
199    @Override
200    public void useStepsFactory(InjectableStepsFactory stepsFactory) {
201        embedder.useStepsFactory(stepsFactory);
202    }
203
204    @Override
205    public void useEmbedderControls(EmbedderControls embedderControls) {
206        embedder.useEmbedderControls(embedderControls);
207    }
208
209    @Override
210    public void useEmbedderFailureStrategy(EmbedderFailureStrategy failureStategy) {
211        embedder.useEmbedderFailureStrategy(failureStategy);
212    }
213
214    @Override
215    public void useEmbedderMonitor(EmbedderMonitor embedderMonitor) {
216        embedder.useEmbedderMonitor(embedderMonitor);
217    }
218
219    @Override
220    public void useExecutorService(ExecutorService executorService) {
221        embedder.useExecutorService(executorService);
222    }
223
224    @Override
225    public void useMetaFilters(List<String> metaFilters) {
226        embedder.useMetaFilters(metaFilters);
227    }
228
229    @Override
230    public void useMetaMatchers(Map<String, MetaFilter.MetaMatcher> metaMatchers) {
231        embedder.useMetaMatchers(metaMatchers);
232    }
233
234    @Override
235    public void usePerformableTree(PerformableTree performableTree) {
236        embedder.usePerformableTree(performableTree);
237    }
238
239    @Override
240    public void useSystemProperties(Properties systemProperties) {
241        embedder.useSystemProperties(systemProperties);
242    }
243
244    @Override
245    public void useTimeoutParsers(StoryTimeouts.TimeoutParser... timeoutParsers) {
246        embedder.useTimeoutParsers(timeoutParsers);
247    }
248
249    @Override
250    public String toString() {
251        return embedder.toString();
252    }
253}
254
Full Screen

Accelerate Your Automation Test Cycles With LambdaTest

Leverage LambdaTest’s cloud-based platform to execute your automation tests in parallel and trim down your test execution time significantly. Your first 100 automation testing minutes are on us.

Try LambdaTest
LambdaTestX

We use cookies to give you the best experience. Cookies help to provide a more personalized experience and relevant advertising for you, and web analytics for us. Learn More in our Cookies policy, Privacy & Terms of service

Allow Cookie
Sarah

I hope you find the best code examples for your project.

If you want to accelerate automated browser testing, try LambdaTest. Your first 100 automation testing minutes are FREE.

Sarah Elson (Product & Growth Lead)