Package org.jbehave.examples.core.spring

Source Code of org.jbehave.examples.core.spring.AnnotatedEmbedderUsingSpring

package org.jbehave.examples.core.spring;

import static org.jbehave.core.io.CodeLocations.codeLocationFromPath;

import java.util.List;

import org.jbehave.core.InjectableEmbedder;
import org.jbehave.core.annotations.Configure;
import org.jbehave.core.annotations.UsingEmbedder;
import org.jbehave.core.annotations.spring.UsingSpring;
import org.jbehave.core.embedder.Embedder;
import org.jbehave.core.io.StoryFinder;
import org.jbehave.core.junit.spring.SpringAnnotatedEmbedderRunner;
import org.junit.Test;
import org.junit.runner.RunWith;

/**
* Run stories via annotated embedder configuration and steps using Spring. The
* textual core stories are exactly the same ones found in the
* jbehave-core-example. Here we are only concerned with using the container
* to compose the configuration and the steps instances.
*/
@RunWith(SpringAnnotatedEmbedderRunner.class)
@Configure()
@UsingEmbedder(embedder = Embedder.class, generateViewAfterStories = true, ignoreFailureInStories = true, ignoreFailureInView = true)
@UsingSpring(resources = { "org/jbehave/examples/core/spring/configuration.xml",
        "org/jbehave/examples/core/spring/steps.xml" })
public class AnnotatedEmbedderUsingSpring extends InjectableEmbedder {

    @Test
    public void run() {
        injectedEmbedder().runStoriesAsPaths(storyPaths());
    }

    protected List<String> storyPaths() {
        return new StoryFinder().findPaths(codeLocationFromPath("../core/src/main/java"), "**/*.story", "");
    }

}
TOP

Related Classes of org.jbehave.examples.core.spring.AnnotatedEmbedderUsingSpring

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.