public RestMiauJbehave() {
    super();
    configuration = new Configuration() {};

    // configuration.doDryRun(false); "no dry run" is implicit by using
    // default StoryControls

    // configuration.useDefaultStoryReporter(new ConsoleOutput());
    // deprecated -- rather use StoryReportBuilder

    configuration.useFailureStrategy(new RethrowingFailure());
    configuration.useKeywords(new LocalizedKeywords(Locale.ENGLISH));
    configuration.usePathCalculator(new AbsolutePathCalculator());
    configuration.useParameterControls(new ParameterControls());
    configuration.useParameterConverters(new ParameterConverters());
    configuration.useParanamer(new NullParanamer());
    configuration.usePendingStepStrategy(new PassingUponPendingStep());
    configuration.useStepCollector(new MarkUnmatchedStepsAsPending());
    configuration.useStepdocReporter(new PrintStreamStepdocReporter());
    configuration.useStepFinder(new StepFinder());
    configuration.useStepMonitor(new SilentStepMonitor());
    configuration.useStepPatternParser(new RegexPrefixCapturingPatternParser());
    configuration.useStoryControls(new StoryControls());
    configuration.useStoryLoader(new LoadFromClasspath());
    configuration.useStoryParser(new RegexStoryParser(configuration.keywords()));
    configuration.useStoryPathResolver(new UnderscoredCamelCaseResolver());
    configuration.useStoryReporterBuilder(new StoryReporterBuilder());
    configuration.useViewGenerator(new FreemarkerViewGenerator());

    EmbedderControls embedderControls = configuredEmbedder().embedderControls();
    embedderControls.doBatch(false);
    embedderControls.doGenerateViewAfterStories(true);
    embedderControls.doIgnoreFailureInStories(false);
    embedderControls.doIgnoreFailureInView(false);
    embedderControls.doSkip(false);
    embedderControls.doVerboseFailures(false);
    embedderControls.doVerboseFiltering(false);
    embedderControls.useStoryTimeoutInSecs(300);
    embedderControls.useThreads(1);
  }
Ejemplo n.º 2
0
 @Test
 public void shouldCreateNewEmbedderWithGivenControls() {
   // Given
   AbstractEmbedderTask task = new AbstractEmbedderTask() {};
   // When
   task.setBatch(true);
   task.setGenerateViewAfterStories(false);
   task.setIgnoreFailureInStories(true);
   task.setIgnoreFailureInView(true);
   task.setVerboseFailures(true);
   task.setVerboseFiltering(true);
   task.setSkip(true);
   task.setStoryTimeoutInSecs(60);
   task.setFailOnStoryTimeout(true);
   task.setThreads(2);
   Embedder embedder = task.newEmbedder();
   // Then
   EmbedderControls embedderControls = embedder.embedderControls();
   assertThat(embedderControls.batch(), is(true));
   assertThat(embedderControls.generateViewAfterStories(), is(false));
   assertThat(embedderControls.ignoreFailureInStories(), is(true));
   assertThat(embedderControls.ignoreFailureInView(), is(true));
   assertThat(embedderControls.verboseFailures(), is(true));
   assertThat(embedderControls.verboseFiltering(), is(true));
   assertThat(embedderControls.skip(), is(true));
   assertThat(embedderControls.storyTimeoutInSecs(), equalTo(60L));
   assertThat(embedderControls.failOnStoryTimeout(), is(true));
   assertThat(embedderControls.threads(), equalTo(2));
 }