use of org.jbehave.core.configuration.MostUsefulConfiguration in project jbehave-core by jbehave.
the class ConfigurationProducer method getConfiguration.
@Produces
@WeldConfiguration
public Configuration getConfiguration() {
LoadFromClasspath resourceLoader = new LoadFromClasspath(getClass().getClassLoader());
TableTransformers tableTransformers = new TableTransformers();
return new MostUsefulConfiguration().useStoryControls(new StoryControls().doDryRun(false).doSkipScenariosAfterFailure(false)).useStoryLoader(resourceLoader).useStoryReporterBuilder(new StoryReporterBuilder().withDefaultFormats().withFormats(CONSOLE, HTML, TXT, XML)).useParameterConverters(new ParameterConverters(resourceLoader, tableTransformers).addConverters(new DateConverter(new SimpleDateFormat("yyyy-MM-dd")))).useTableTransformers(tableTransformers);
}
use of org.jbehave.core.configuration.MostUsefulConfiguration in project jbehave-core by jbehave.
the class PicoAnnotationBuilderBehaviour method shouldBuildDefaultConfigurationIfAnnotationOrAnnotatedValuesNotPresent.
@Test
public void shouldBuildDefaultConfigurationIfAnnotationOrAnnotatedValuesNotPresent() {
PicoAnnotationBuilder builderNotAnnotated = new PicoAnnotationBuilder(NotAnnotated.class);
assertThatConfigurationIs(builderNotAnnotated.buildConfiguration(), new MostUsefulConfiguration());
PicoAnnotationBuilder builderAnnotatedWithoutLocations = new PicoAnnotationBuilder(AnnotatedWithoutModules.class);
assertThatConfigurationIs(builderAnnotatedWithoutLocations.buildConfiguration(), new MostUsefulConfiguration());
}
use of org.jbehave.core.configuration.MostUsefulConfiguration in project jbehave-core by jbehave.
the class PicoStepsFactoryBehaviour method assertThatStepsWithMissingDependenciesCannotBeCreated.
@Test(expected = AbstractInjector.UnsatisfiableDependenciesException.class)
public void assertThatStepsWithMissingDependenciesCannotBeCreated() throws NoSuchFieldException, IllegalAccessException {
MutablePicoContainer parent = createPicoContainer();
parent.as(Characteristics.USE_NAMES).addComponent(FooStepsWithDependency.class);
PicoStepsFactory factory = new PicoStepsFactory(new MostUsefulConfiguration(), parent);
// When
factory.createInstanceOfType(FooStepsWithDependency.class);
// Then ... expected exception is thrown
}
use of org.jbehave.core.configuration.MostUsefulConfiguration in project jbehave-core by jbehave.
the class PicoStepsFactoryBehaviour method assertThatStepsWithStepsWithDependencyCanBeCreated.
@Test
public void assertThatStepsWithStepsWithDependencyCanBeCreated() throws NoSuchFieldException, IllegalAccessException {
MutablePicoContainer parent = createPicoContainer();
parent.as(Characteristics.USE_NAMES).addComponent(FooStepsWithDependency.class);
parent.addComponent(Integer.class, 42);
// When
PicoStepsFactory factory = new PicoStepsFactory(new MostUsefulConfiguration(), parent);
List<CandidateSteps> steps = factory.createCandidateSteps();
// Then
assertFooStepsFound(steps);
assertThat((int) ((FooStepsWithDependency) stepsInstance(steps.get(0))).integer, equalTo(42));
}
use of org.jbehave.core.configuration.MostUsefulConfiguration in project jbehave-core by jbehave.
the class SpringStepsFactoryBehaviour method stepsWithMissingDependenciesCannotBeCreated.
@Test(expected = BeanDefinitionStoreException.class)
public void stepsWithMissingDependenciesCannotBeCreated() {
// Given
ApplicationContext context = createApplicationContext("org/jbehave/core/steps/spring/steps-with-missing-depedency.xml");
SpringStepsFactory factory = new SpringStepsFactory(new MostUsefulConfiguration(), context);
// When
factory.createCandidateSteps();
// Then ... expected exception is thrown
}
Aggregations