Hi, 
I'm implementing my own Reporter by extending StoryReporter.

The thing is , each override method being executed 3 times (one after 
another) before the the execution moves to next method in the execution flow

For example : *beforeStory (3 executions) ---> beforeScenario (3 
executions) ---> afterScenario (3 executions)*


The running file looks like :


*public abstract class GenericScenario extends JUnitStories {*
*    //set system time property in order to be appended to the log file*
*    static {*
*        SimpleDateFormat dateFormat = new SimpleDateFormat("dd MMM yyyy - 
HH:mm:ss");*
*        System.setProperty("systemDate" , dateFormat.format(new Date()));*
*    }*

*    public GenericScenario(){*
*        Embedder embedder = configuredEmbedder();*
*        
embedder.embedderControls().useStoryTimeouts(PropertiesSingelton.getInstance().getProperty("timeout"));*
*        embedder.useTimeoutParsers(new MyParser());*
*        embedder.configuration().useParameterConverters(*
*                configuration().parameterConverters().addConverters(*
*                        new ParameterConverters.EnumConverter()));*

*        //adding skip support*
*        configuredEmbedder().useMetaFilters(Arrays.asList("-skip"));*
*    }*
*    public class MyParser implements StoryTimeouts.TimeoutParser{*
*        public boolean isValid(String timeout) {*
*            return timeout.matches("(\\d+)sec");*
*        }*

*        public long asSeconds(String timeout) {*
*            return Long.parseLong(StringUtils.substringBefore(timeout, 
"sec"));*
*        }*
*    }*

*    @Override*
*    public Configuration configuration(){*
*        return new MostUsefulConfiguration().useStoryLoader(*
*                    new LoadFromClasspath(this.getClass()))*
*                
.useStoryReporterBuilder(storyReporter.withDefaultFormats()*
*                        .withFormats(Format.TXT , Format.CONSOLE )*
*                        .withReporters(new MyStoryReporter()))*
*                .useStoryControls(new 
StoryControls().doSkipScenariosAfterFailure(true));*
*    }*


*    StoryReporterBuilder storyReporter = new StoryReporterBuilder() {*
*        /***
*         * The builder is configured to build with the*
*         * StoryReporterBuilder.Format.STATS as default format. To change*
*         * the default formats the user can override the method:*
*         */*
*        @Override*
*        public StoryReporterBuilder withDefaultFormats() {*
*            return withFormats(Format.CONSOLE);*
*        }*
*    };*

*    @Override*
*    public InjectableStepsFactory stepsFactory(){*
*        return new InstanceStepsFactory(configuration(), new classes .... 
);*
*    }*

*    @Override*
*    protected abstract List<String> storyPaths();*
*}*


Any idea how to overcome the issue ?

Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"JBehave User" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send an email to [email protected].
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/jbehave-user/1c86948b-c814-43cd-8bfb-809d3eeda697%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to