Search in sources :

Example 56 with Configuration

use of org.jbehave.core.configuration.Configuration 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 57 with Configuration

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

the class Embedder method reportMatchingStepdocs.

public void reportMatchingStepdocs(String stepAsString) {
    Configuration configuration = configuration();
    List<CandidateSteps> candidateSteps = candidateSteps();
    StepFinder finder = configuration.stepFinder();
    StepdocReporter reporter = configuration.stepdocReporter();
    List<Stepdoc> matching = finder.findMatching(stepAsString, candidateSteps);
    List<Object> stepsInstances = finder.stepsInstances(candidateSteps);
    reporter.stepdocsMatching(stepAsString, matching, stepsInstances);
}
Also used : StepFinder(org.jbehave.core.steps.StepFinder) Configuration(org.jbehave.core.configuration.Configuration) MostUsefulConfiguration(org.jbehave.core.configuration.MostUsefulConfiguration) Stepdoc(org.jbehave.core.steps.Stepdoc) CandidateSteps(org.jbehave.core.steps.CandidateSteps) StepdocReporter(org.jbehave.core.reporters.StepdocReporter)

Example 58 with Configuration

use of org.jbehave.core.configuration.Configuration 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 59 with Configuration

use of org.jbehave.core.configuration.Configuration 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 60 with Configuration

use of org.jbehave.core.configuration.Configuration 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)

Aggregations

Configuration (org.jbehave.core.configuration.Configuration)64 MostUsefulConfiguration (org.jbehave.core.configuration.MostUsefulConfiguration)61 Test (org.junit.Test)55 AnnotationBuilder (org.jbehave.core.configuration.AnnotationBuilder)18 StoryReporter (org.jbehave.core.reporters.StoryReporter)15 ConcurrentStoryReporter (org.jbehave.core.reporters.ConcurrentStoryReporter)13 StoryPathResolver (org.jbehave.core.io.StoryPathResolver)11 ByteArrayOutputStream (java.io.ByteArrayOutputStream)10 OutputStream (java.io.OutputStream)10 PrintStream (java.io.PrintStream)10 Matchers.containsString (org.hamcrest.Matchers.containsString)10 InjectableEmbedder (org.jbehave.core.InjectableEmbedder)10 UsingEmbedder (org.jbehave.core.annotations.UsingEmbedder)10 AbstractStep (org.jbehave.core.steps.StepCreator.AbstractStep)10 ArrayList (java.util.ArrayList)9 HashMap (java.util.HashMap)8 JUnitStory (org.jbehave.core.junit.JUnitStory)8 Story (org.jbehave.core.model.Story)8 SimpleDateFormat (java.text.SimpleDateFormat)7 RunContext (org.jbehave.core.embedder.PerformableTree.RunContext)7