Package org.jbehave.core.configuration

Examples of org.jbehave.core.configuration.AnnotationBuilder


public class NeedleAnnotationBuilderBehaviour {

  @Test
  public void shouldBuildConfigurationFromAnnotationsUsingConfigureAndGuiceConverters() {
    final AnnotationBuilder builderAnnotated = new NeedleAnnotationBuilder(
        AnnotatedUsingConfigureAndNeedleConverters.class);
    final Configuration configuration = builderAnnotated
        .buildConfiguration();
    assertThatCustomObjectIsConverted(configuration.parameterConverters());
    assertThatDateIsConvertedWithFormat(
        configuration.parameterConverters(), new SimpleDateFormat(
            "yyyy-MM-dd"));
View Full Code Here


    assertThat(table.getHeaders(), hasItems("one", "two"));
  }

  @Test
  public void shouldBuildDefaultConfigurationIfAnnotationOrAnnotatedValuesNotPresent() {
    final AnnotationBuilder builderNotAnnotated = new NeedleAnnotationBuilder(
        NotAnnotated.class);
    assertThatConfigurationIs(builderNotAnnotated.buildConfiguration(),
        new MostUsefulConfiguration());
    final AnnotationBuilder builderAnnotatedWithoutModules = new NeedleAnnotationBuilder(
        AnnotatedWithoutInjectors.class);
    assertThatConfigurationIs(
        builderAnnotatedWithoutModules.buildConfiguration(),
        new MostUsefulConfiguration());
  }
View Full Code Here

        .storyReporterBuilder().reportFailureTrace()));
  }

  @Test
  public void shouldBuildCandidateStepsFromAnnotationsUsingNeedle() {
    final AnnotationBuilder builderAnnotated = new NeedleAnnotationBuilder(
        AnnotatedUsingNeedle.class);
    final Configuration configuration = builderAnnotated
        .buildConfiguration();
    assertTrue(builderAnnotated.buildCandidateSteps(configuration)
        .isEmpty());
  }
View Full Code Here

        .isEmpty());
  }

  @Test
  public void shouldBuildCandidateStepsFromAnnotationsUsingStepsAndNeedle() {
    final AnnotationBuilder builderAnnotated = new NeedleAnnotationBuilder(
        AnnotatedUsingStepsAndNeedle.class);
    final Configuration configuration = builderAnnotated
        .buildConfiguration();
    assertThatStepsInstancesAre(
        builderAnnotated.buildCandidateSteps(configuration),
        FooSteps.class);
  }
View Full Code Here

        FooSteps.class);
  }

  @Test
  public void shouldBuildCandidateStepsFromAnnotationsUsingStepsAndGuiceAndConverters() {
    final AnnotationBuilder builderAnnotated = new NeedleAnnotationBuilder(
        AnnotatedUsingConfigureAndNeedleConverters.class);
    final Configuration configuration = builderAnnotated
        .buildConfiguration();
    assertThatStepsInstancesAre(
        builderAnnotated.buildCandidateSteps(configuration),
        FooSteps.class);
  }
View Full Code Here

        FooSteps.class);
  }

  @Test
  public void shouldBuildEmptyStepsListIfAnnotationOrAnnotatedValuesNotPresent() {
    final AnnotationBuilder builderNotAnnotated = new NeedleAnnotationBuilder(
        NotAnnotated.class);
    assertThatStepsInstancesAre(builderNotAnnotated.buildCandidateSteps());

    final AnnotationBuilder builderAnnotatedWithoutLocations = new NeedleAnnotationBuilder(
        AnnotatedWithoutInjectors.class);
    assertThatStepsInstancesAre(builderAnnotatedWithoutLocations
        .buildCandidateSteps());
  }
View Full Code Here

        .buildCandidateSteps());
  }

  @Test
  public void shouldBuildStepsList() {
    final AnnotationBuilder builderAnnotated = new NeedleAnnotationBuilder(
        AnnotatedMultipleSteps.class);
    final List<CandidateSteps> actual = builderAnnotated
        .buildCandidateSteps();
    assertThatStepsInstancesAre(actual, FooStepsWithDependency.class,
        FooSteps.class);
  }
View Full Code Here

        FooSteps.class);
  }

  @Test
  public void shouldBuildCandidateStepsFromAnnotationsUsingStepsAndInheritingPicoFromParent() {
    AnnotationBuilder builderAnnotated = new SpringAnnotationBuilder(
        InheritingAnnotatedUsingSteps.class);
    Configuration configuration = builderAnnotated.buildConfiguration();
    assertThatStepsInstancesAre(
        builderAnnotated.buildCandidateSteps(configuration),
        FooSteps.class);
  }
View Full Code Here

  }

  @Test
  public void shouldNotBuildContainerIfResourceNotLoadable() {
    AnnotationMonitor annotationMonitor = mock(AnnotationMonitor.class);
    AnnotationBuilder builderUnloadableResource = new SpringAnnotationBuilder(
        AnnotatedWithUnloadableResource.class, annotationMonitor);
    try {
      assertThatStepsInstancesAre(builderUnloadableResource
          .buildCandidateSteps());
      fail("Exception expected");
    } catch (AnnotationBuilder.InstantiationFailed e) {
      // expected
    }
View Full Code Here

public class GuiceAnnotationBuilderBehaviour {

    @Test
    public void shouldBuildConfigurationFromAnnotations() {
        AnnotationBuilder builder = new GuiceAnnotationBuilder(AnnotatedUsingGuice.class);
        Configuration configuration = builder.buildConfiguration();
        assertThat(configuration.storyControls().dryRun(), is(true));
        assertThat(configuration.storyControls().skipScenariosAfterFailure(), is(true));
        assertThat(configuration.failureStrategy(), instanceOf(SilentlyAbsorbingFailure.class));
        assertThat(configuration.storyLoader(), instanceOf(LoadFromURL.class));
        assertThat(configuration.stepPatternParser(), instanceOf(RegexPrefixCapturingPatternParser.class));
View Full Code Here

TOP

Related Classes of org.jbehave.core.configuration.AnnotationBuilder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.