Search in sources :

Example 21 with AnnotationBuilder

use of org.jbehave.core.configuration.AnnotationBuilder in project jbehave-core by jbehave.

the class NeedleAnnotationBuilderBehaviour method shouldBuildConfigurationFromAnnotationsUsingConfigureAndGuiceConverters.

@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"));
    assertThatExamplesTableIsConverted(configuration.parameterConverters());
}
Also used : Configuration(org.jbehave.core.configuration.Configuration) MostUsefulConfiguration(org.jbehave.core.configuration.MostUsefulConfiguration) AnnotationBuilder(org.jbehave.core.configuration.AnnotationBuilder) SimpleDateFormat(java.text.SimpleDateFormat) Test(org.junit.Test)

Example 22 with AnnotationBuilder

use of org.jbehave.core.configuration.AnnotationBuilder in project jbehave-core by jbehave.

the class NeedleAnnotationBuilderBehaviour method shouldBuildCandidateStepsFromAnnotationsUsingNeedle.

@Test
public void shouldBuildCandidateStepsFromAnnotationsUsingNeedle() {
    final AnnotationBuilder builderAnnotated = new NeedleAnnotationBuilder(AnnotatedUsingNeedle.class);
    final Configuration configuration = builderAnnotated.buildConfiguration();
    assertThat(builderAnnotated.buildCandidateSteps(configuration).isEmpty(), is(true));
}
Also used : Configuration(org.jbehave.core.configuration.Configuration) MostUsefulConfiguration(org.jbehave.core.configuration.MostUsefulConfiguration) AnnotationBuilder(org.jbehave.core.configuration.AnnotationBuilder) Test(org.junit.Test)

Example 23 with AnnotationBuilder

use of org.jbehave.core.configuration.AnnotationBuilder in project jbehave-core by jbehave.

the class WeldAnnotationBuilderBehaviour method createBuilder.

private AnnotationBuilder createBuilder(Class<?> type) {
    WeldBootstrap bootstrap = new WeldBootstrap();
    bootstrap.initialize();
    AnnotationBuilder builder = bootstrap.findAnnotationBuilder(type);
    assertThat(builder, is(AnnotationBuilder.class));
    return builder;
}
Also used : AnnotationBuilder(org.jbehave.core.configuration.AnnotationBuilder) WeldBootstrap(org.jbehave.core.configuration.weld.WeldBootstrap)

Example 24 with AnnotationBuilder

use of org.jbehave.core.configuration.AnnotationBuilder in project jbehave-core by jbehave.

the class PicoAnnotationBuilderBehaviour method shouldBuildCandidateStepsFromAnnotationsUsingStepsAndInheritingPicoFromParent.

@Test
public void shouldBuildCandidateStepsFromAnnotationsUsingStepsAndInheritingPicoFromParent() {
    AnnotationBuilder builderAnnotated = new PicoAnnotationBuilder(InheritingAnnotatedUsingSteps.class);
    Configuration configuration = builderAnnotated.buildConfiguration();
    assertThatStepsInstancesAre(builderAnnotated.buildCandidateSteps(configuration), FooSteps.class);
}
Also used : Configuration(org.jbehave.core.configuration.Configuration) MostUsefulConfiguration(org.jbehave.core.configuration.MostUsefulConfiguration) AnnotationBuilder(org.jbehave.core.configuration.AnnotationBuilder) Test(org.junit.Test)

Example 25 with AnnotationBuilder

use of org.jbehave.core.configuration.AnnotationBuilder in project jbehave-core by jbehave.

the class WeldAnnotationBuilderBehaviour method shouldBuildCandidateStepsFromAnnotationsUsingStepsAndWeldSteps.

@Test
public void shouldBuildCandidateStepsFromAnnotationsUsingStepsAndWeldSteps() {
    AnnotationBuilder builderAnnotated = createBuilder(AnnotatedUsingWeldWithSteps.class);
    Configuration configuration = builderAnnotated.buildConfiguration();
    assertThatStepsInstancesAre(builderAnnotated.buildCandidateSteps(configuration), WeldStepBean.class, FooSteps.class);
}
Also used : Configuration(org.jbehave.core.configuration.Configuration) MostUsefulConfiguration(org.jbehave.core.configuration.MostUsefulConfiguration) AnnotationBuilder(org.jbehave.core.configuration.AnnotationBuilder) Test(org.junit.Test)

Aggregations

AnnotationBuilder (org.jbehave.core.configuration.AnnotationBuilder)26 Test (org.junit.Test)25 MostUsefulConfiguration (org.jbehave.core.configuration.MostUsefulConfiguration)21 Configuration (org.jbehave.core.configuration.Configuration)18 SimpleDateFormat (java.text.SimpleDateFormat)6 Keywords (org.jbehave.core.configuration.Keywords)2 SilentlyAbsorbingFailure (org.jbehave.core.failures.SilentlyAbsorbingFailure)2 LocalizedKeywords (org.jbehave.core.i18n.LocalizedKeywords)2 LoadFromURL (org.jbehave.core.io.LoadFromURL)2 RegexPrefixCapturingPatternParser (org.jbehave.core.parsers.RegexPrefixCapturingPatternParser)2 ParseException (java.text.ParseException)1 List (java.util.List)1 AnnotationMonitor (org.jbehave.core.configuration.AnnotationMonitor)1 WeldBootstrap (org.jbehave.core.configuration.weld.WeldBootstrap)1 CandidateSteps (org.jbehave.core.steps.CandidateSteps)1