Search in sources :

Example 56 with MostUsefulConfiguration

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

the class SpringStepsFactoryAOPBehaviour method aopEnvelopedStepsCanBeCreated.

@Test
public void aopEnvelopedStepsCanBeCreated() {
    // Given
    ApplicationContext context = createApplicationContext(StepsWithAOPAnnotationConfiguration.class.getName());
    SpringStepsFactory factory = new SpringStepsFactory(new MostUsefulConfiguration(), context);
    // When
    List<CandidateSteps> steps = factory.createCandidateSteps();
    // Then
    assertAOPFooStepsFound(steps);
}
Also used : ApplicationContext(org.springframework.context.ApplicationContext) MostUsefulConfiguration(org.jbehave.core.configuration.MostUsefulConfiguration) CandidateSteps(org.jbehave.core.steps.CandidateSteps) Test(org.junit.Test)

Example 57 with MostUsefulConfiguration

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

the class SpringStepsFactoryBehaviour method annotationStepsWithDependenciesCanBeCreated.

@Test
public void annotationStepsWithDependenciesCanBeCreated() {
    // Given
    ApplicationContext context = createApplicationContext(StepsWithDependencyAnnotationConfiguration.class.getName());
    // When
    SpringStepsFactory factory = new SpringStepsFactory(new MostUsefulConfiguration(), context);
    List<CandidateSteps> steps = factory.createCandidateSteps();
    // Then
    assertFooStepsFound(steps);
    assertThat((int) findInstanceOfType(steps, FooStepsWithDependency.class).integer, equalTo(42));
}
Also used : ApplicationContext(org.springframework.context.ApplicationContext) MostUsefulConfiguration(org.jbehave.core.configuration.MostUsefulConfiguration) CandidateSteps(org.jbehave.core.steps.CandidateSteps) Test(org.junit.Test)

Example 58 with MostUsefulConfiguration

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

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

the class SpringStepsFactoryBehaviour method stepsCanBeCreated.

@Test
public void stepsCanBeCreated() {
    // Given
    ApplicationContext context = createApplicationContext("org/jbehave/core/steps/spring/steps.xml");
    SpringStepsFactory factory = new SpringStepsFactory(new MostUsefulConfiguration(), context);
    // When
    List<CandidateSteps> steps = factory.createCandidateSteps();
    // Then
    assertFooStepsFound(steps);
}
Also used : ApplicationContext(org.springframework.context.ApplicationContext) MostUsefulConfiguration(org.jbehave.core.configuration.MostUsefulConfiguration) CandidateSteps(org.jbehave.core.steps.CandidateSteps) Test(org.junit.Test)

Example 60 with MostUsefulConfiguration

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

the class SpringStepsFactoryBehaviour method stepsWithDependenciesCanBeCreated.

@Test
public void stepsWithDependenciesCanBeCreated() {
    // Given
    ApplicationContext context = createApplicationContext("org/jbehave/core/steps/spring/steps-with-dependency.xml");
    // When
    SpringStepsFactory factory = new SpringStepsFactory(new MostUsefulConfiguration(), context);
    List<CandidateSteps> steps = factory.createCandidateSteps();
    // Then
    assertFooStepsFound(steps);
    assertThat((int) findInstanceOfType(steps, FooStepsWithDependency.class).integer, equalTo(42));
}
Also used : ApplicationContext(org.springframework.context.ApplicationContext) MostUsefulConfiguration(org.jbehave.core.configuration.MostUsefulConfiguration) CandidateSteps(org.jbehave.core.steps.CandidateSteps) Test(org.junit.Test)

Aggregations

MostUsefulConfiguration (org.jbehave.core.configuration.MostUsefulConfiguration)66 Test (org.junit.Test)52 Configuration (org.jbehave.core.configuration.Configuration)14 CandidateSteps (org.jbehave.core.steps.CandidateSteps)14 StoryReporterBuilder (org.jbehave.core.reporters.StoryReporterBuilder)11 LoadFromClasspath (org.jbehave.core.io.LoadFromClasspath)8 TableTransformers (org.jbehave.core.model.TableTransformers)8 Method (java.lang.reflect.Method)7 LocalizedKeywords (org.jbehave.core.i18n.LocalizedKeywords)7 ParameterConverters (org.jbehave.core.steps.ParameterConverters)7 SimpleDateFormat (java.text.SimpleDateFormat)5 HashMap (java.util.HashMap)5 InjectableEmbedder (org.jbehave.core.InjectableEmbedder)5 UsingEmbedder (org.jbehave.core.annotations.UsingEmbedder)5 BeforeOrAfterFailed (org.jbehave.core.failures.BeforeOrAfterFailed)5 Failed (org.jbehave.core.steps.AbstractStepResult.Failed)5 ApplicationContext (org.springframework.context.ApplicationContext)5 ByteArrayOutputStream (java.io.ByteArrayOutputStream)4 OutputStream (java.io.OutputStream)4 PrintStream (java.io.PrintStream)4