Search in sources :

Example 1 with AnnotatedEmbedderRunner

use of org.jbehave.core.junit.AnnotatedEmbedderRunner in project jbehave-core by jbehave.

the class GuiceAnnotatedEmbedderRunnerBehaviour method shouldCreateWithGuiceAnnotatedBuilder.

@Test
public void shouldCreateWithGuiceAnnotatedBuilder() throws InitializationError {
    AnnotatedEmbedderRunner runner = new GuiceAnnotatedEmbedderRunner(RunningWithAnnotatedEmbedderRunner.class);
    assertThat(runner.annotationBuilder(), instanceOf(GuiceAnnotationBuilder.class));
}
Also used : AnnotatedEmbedderRunner(org.jbehave.core.junit.AnnotatedEmbedderRunner) GuiceAnnotationBuilder(org.jbehave.core.configuration.guice.GuiceAnnotationBuilder) Test(org.junit.Test)

Example 2 with AnnotatedEmbedderRunner

use of org.jbehave.core.junit.AnnotatedEmbedderRunner in project jbehave-core by jbehave.

the class WeldAnnotatedEmbedderRunnerBehaviour method shouldCreateWithGuiceAnnotatedBuilder.

@Test
public void shouldCreateWithGuiceAnnotatedBuilder() throws InitializationError {
    AnnotatedEmbedderRunner runner = new WeldAnnotatedEmbedderRunner(RunningWithAnnotatedEmbedderRunner.class);
    assertThat(runner.annotationBuilder(), instanceOf(WeldAnnotationBuilder.class));
}
Also used : AnnotatedEmbedderRunner(org.jbehave.core.junit.AnnotatedEmbedderRunner) WeldAnnotatedEmbedderRunner(org.jbehave.core.junit.weld.WeldAnnotatedEmbedderRunner) WeldAnnotationBuilder(org.jbehave.core.configuration.weld.WeldAnnotationBuilder) WeldAnnotatedEmbedderRunner(org.jbehave.core.junit.weld.WeldAnnotatedEmbedderRunner) Test(org.junit.Test)

Example 3 with AnnotatedEmbedderRunner

use of org.jbehave.core.junit.AnnotatedEmbedderRunner in project jbehave-core by jbehave.

the class NeedleAnnotatedEmbedderRunnerBehaviour method shouldCreateWithGuiceAnnotatedBuilder.

@Test
public void shouldCreateWithGuiceAnnotatedBuilder() throws InitializationError {
    AnnotatedEmbedderRunner runner = new NeedleAnnotatedEmbedderRunner(RunningWithAnnotatedEmbedderRunner.class);
    assertThat(runner.annotationBuilder(), instanceOf(NeedleAnnotationBuilder.class));
}
Also used : AnnotatedEmbedderRunner(org.jbehave.core.junit.AnnotatedEmbedderRunner) NeedleAnnotationBuilder(org.jbehave.core.configuration.needle.NeedleAnnotationBuilder) Test(org.junit.Test)

Example 4 with AnnotatedEmbedderRunner

use of org.jbehave.core.junit.AnnotatedEmbedderRunner in project jbehave-core by jbehave.

the class GroovyAnnotatedEmbedderRunnerBehaviour method shouldCreateWithSpringAnnotatedBuilder.

@Test
public void shouldCreateWithSpringAnnotatedBuilder() throws InitializationError {
    AnnotatedEmbedderRunner runner = new GroovyAnnotatedEmbedderRunner(RunningWithAnnotatedEmbedderRunner.class);
    assertThat(runner.annotationBuilder(), instanceOf(GroovyAnnotationBuilder.class));
}
Also used : AnnotatedEmbedderRunner(org.jbehave.core.junit.AnnotatedEmbedderRunner) GroovyAnnotationBuilder(org.jbehave.core.configuration.groovy.GroovyAnnotationBuilder) Test(org.junit.Test)

Example 5 with AnnotatedEmbedderRunner

use of org.jbehave.core.junit.AnnotatedEmbedderRunner in project jbehave-core by jbehave.

the class Embedder method runStoriesWithAnnotatedEmbedderRunner.

public void runStoriesWithAnnotatedEmbedderRunner(List<String> classNames) {
    EmbedderClassLoader classLoader = classLoader();
    for (String className : classNames) {
        embedderMonitor.runningWithAnnotatedEmbedderRunner(className);
        AnnotatedEmbedderRunner runner = AnnotatedEmbedderUtils.annotatedEmbedderRunner(className, classLoader);
        try {
            Object annotatedInstance = runner.createTest();
            if (annotatedInstance instanceof Embeddable) {
                ((Embeddable) annotatedInstance).run();
            } else {
                embedderMonitor.annotatedInstanceNotOfType(annotatedInstance, Embeddable.class);
            }
        } catch (Throwable e) {
            throw new AnnotatedEmbedderRunFailed(runner, e);
        }
    }
}
Also used : AnnotatedEmbedderRunner(org.jbehave.core.junit.AnnotatedEmbedderRunner) Embeddable(org.jbehave.core.Embeddable)

Aggregations

AnnotatedEmbedderRunner (org.jbehave.core.junit.AnnotatedEmbedderRunner)7 Test (org.junit.Test)6 Embeddable (org.jbehave.core.Embeddable)1 GroovyAnnotationBuilder (org.jbehave.core.configuration.groovy.GroovyAnnotationBuilder)1 GuiceAnnotationBuilder (org.jbehave.core.configuration.guice.GuiceAnnotationBuilder)1 NeedleAnnotationBuilder (org.jbehave.core.configuration.needle.NeedleAnnotationBuilder)1 PicoAnnotationBuilder (org.jbehave.core.configuration.pico.PicoAnnotationBuilder)1 SpringAnnotationBuilder (org.jbehave.core.configuration.spring.SpringAnnotationBuilder)1 WeldAnnotationBuilder (org.jbehave.core.configuration.weld.WeldAnnotationBuilder)1 WeldAnnotatedEmbedderRunner (org.jbehave.core.junit.weld.WeldAnnotatedEmbedderRunner)1