Last active
August 29, 2015 13:56
-
-
Save eliasnogueira/9097811 to your computer and use it in GitHub Desktop.
StoryBase para JBehave em Java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.List; | |
import org.jbehave.core.configuration.Configuration; | |
import org.jbehave.core.configuration.MostUsefulConfiguration; | |
import org.jbehave.core.io.CodeLocations; | |
import org.jbehave.core.io.LoadFromClasspath; | |
import org.jbehave.core.io.StoryFinder; | |
import org.jbehave.core.junit.JUnitStory; | |
import org.jbehave.core.reporters.StoryReporterBuilder; | |
import org.jbehave.core.steps.InstanceStepsFactory; | |
public class StoryBase extends JUnitStory { | |
@Override | |
public Configuration configuration() { | |
return new MostUsefulConfiguration() | |
.useStoryLoader(new LoadFromClasspath(this.getClass())) | |
.useStoryReporterBuilder(new StoryReporterBuilder() | |
.withDefaultFormats()); | |
} | |
@SuppressWarnings({ "unchecked", "rawtypes" }) | |
@Override | |
public List candidateSteps() { | |
return new InstanceStepsFactory(configuration(), this).createCandidateSteps(); | |
} | |
protected List<String> storyPaths() { | |
return new StoryFinder().findPaths(CodeLocations.codeLocationFromClass(this.getClass()), "**/*.story", ""); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment