Details
Description
I stumbled upon a beheavior of this method:
org.jbehave.core.ConfigurableEmbedder.configuredEmbedder()
It always calls these methods when being called:
embedder.useConfiguration(configuration()); embedder.useCandidateSteps(candidateSteps()); embedder.useStepsFactory(stepsFactory());
This had some unexpected side effects for me. For example I am logging which steps are being used. Since I call "configuredEmbeder()" multiple times, the method "stepsFactory()" is called multiple times. Even if I use just one instance of embedder it is called many times since the JBehave framework calls "configuredEmbedder()" many times.
Maybe it would be good if there is another method added to "org.jbehave.core.ConfigurableEmbedder" called "configureEmbedder" which actually configures the embedder every time when it is called.
But the method "configuredEmbedder" should maybe be implemented with lazy initialization, so that the calls in its method are just executed once. I tried this in the class which I extend from "JUnitStories". But then the meta-filtering does not work for some strange reason. So I could not find a solution for this.
Activity
Field | Original Value | New Value |
---|---|---|
Affects Version/s | 3.x [ 16979 ] | |
Affects Version/s | 3.9 [ 19035 ] | |
Fix Version/s | 4.0 [ 18486 ] | |
Fix Version/s | 3.9.2 [ 20180 ] | |
Assignee | Mauro Talevi [ maurotalevi ] |
Summary | Method being called many times: ConfigurableEmbedder.configuredEmbedder() | Ensure lazy initialisation in ConfigurableEmbedder.configuredEmbedder() |
Issue Type | Bug [ 1 ] | Improvement [ 4 ] |
Resolution | Fixed [ 1 ] | |
Status | Open [ 1 ] | Resolved [ 5 ] |