Search in sources :

Example 16 with AnnotationBuilder

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

the class GuiceAnnotationBuilderBehaviour method shouldBuildCandidateStepsFromAnnotationsUsingStepsAndGuiceAndConverters.

@Test
public void shouldBuildCandidateStepsFromAnnotationsUsingStepsAndGuiceAndConverters() {
    AnnotationBuilder builderAnnotated = new GuiceAnnotationBuilder(AnnotatedUsingConfigureAndGuiceConverters.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 17 with AnnotationBuilder

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

the class NeedleAnnotationBuilderBehaviour method shouldBuildDefaultConfigurationIfAnnotationOrAnnotatedValuesNotPresent.

@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());
}
Also used : AnnotationBuilder(org.jbehave.core.configuration.AnnotationBuilder) MostUsefulConfiguration(org.jbehave.core.configuration.MostUsefulConfiguration) Test(org.junit.Test)

Example 18 with AnnotationBuilder

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

the class NeedleAnnotationBuilderBehaviour method shouldBuildCandidateStepsFromAnnotationsUsingStepsAndGuiceAndConverters.

@Test
public void shouldBuildCandidateStepsFromAnnotationsUsingStepsAndGuiceAndConverters() {
    final AnnotationBuilder builderAnnotated = new NeedleAnnotationBuilder(AnnotatedUsingConfigureAndNeedleConverters.class);
    final 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 19 with AnnotationBuilder

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

the class NeedleAnnotationBuilderBehaviour method shouldBuildEmptyStepsListIfAnnotationOrAnnotatedValuesNotPresent.

@Test
public void shouldBuildEmptyStepsListIfAnnotationOrAnnotatedValuesNotPresent() {
    final AnnotationBuilder builderNotAnnotated = new NeedleAnnotationBuilder(NotAnnotated.class);
    assertThatStepsInstancesAre(builderNotAnnotated.buildCandidateSteps());
    final AnnotationBuilder builderAnnotatedWithoutLocations = new NeedleAnnotationBuilder(AnnotatedWithoutInjectors.class);
    assertThatStepsInstancesAre(builderAnnotatedWithoutLocations.buildCandidateSteps());
}
Also used : AnnotationBuilder(org.jbehave.core.configuration.AnnotationBuilder) Test(org.junit.Test)

Example 20 with AnnotationBuilder

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

the class NeedleAnnotationBuilderBehaviour method shouldBuildStepsList.

@Test
public void shouldBuildStepsList() {
    final AnnotationBuilder builderAnnotated = new NeedleAnnotationBuilder(AnnotatedMultipleSteps.class);
    final List<CandidateSteps> actual = builderAnnotated.buildCandidateSteps();
    assertThatStepsInstancesAre(actual, FooStepsWithDependency.class, FooSteps.class);
}
Also used : AnnotationBuilder(org.jbehave.core.configuration.AnnotationBuilder) CandidateSteps(org.jbehave.core.steps.CandidateSteps) 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