本文整理汇总了Java中org.jbehave.core.io.StoryFinder类的典型用法代码示例。如果您正苦于以下问题:Java StoryFinder类的具体用法?Java StoryFinder怎么用?Java StoryFinder使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
StoryFinder类属于org.jbehave.core.io包,在下文中一共展示了StoryFinder类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: runTests
import org.jbehave.core.io.StoryFinder; //导入依赖的package包/类
public void runTests(final long timeOut,StepDefinition... stepDefinitions){
JBehaveSettings jBehaveSettings = new JBehaveSettings();
jBehaveSettings.setEmbedder(timeOut, stepDefinitions);
List<String>s=new StoryFinder ( ).
findPaths ( CodeLocations.codeLocationFromClass(this.getClass()),
"**/*.story", null );
jBehaveSettings.getEmbedder().runStoriesAsPaths(s);
}
示例2: storyPaths
import org.jbehave.core.io.StoryFinder; //导入依赖的package包/类
@Override
protected List<String> storyPaths() {
return new StoryFinder().
findPaths(CodeLocations.codeLocationFromClass(
this.getClass()),
Arrays.asList("**/*.story"),
Arrays.asList(""));
}
示例3: storyPaths
import org.jbehave.core.io.StoryFinder; //导入依赖的package包/类
@Override
protected List<String> storyPaths() {
return new StoryFinder().findPaths(
"src/test/resources",
Collections.singletonList("**/*.story"), // 全部的story
// Collections.singletonList("**/漢字/*.story"), // 漢字底下的story
null
);
}
示例4: getStoryPaths
import org.jbehave.core.io.StoryFinder; //导入依赖的package包/类
/**
* Recursively searches for files in the given <tt>storiesDirectory</tt>,
* using the given <tt>storyPathInclusion</tt>.
*
* @param storiesDirectory
* the directory to recursively search. Cannot be <tt>null</tt>.
* @param storyPathInclusion
* the inclusion regex expression. Cannot be <tt>null</tt>.
*
* @return the story paths
*/
protected List<String> getStoryPaths(final String storiesDirectory, final String storyPathInclusion)
{
Objects.requireNonNull(storiesDirectory, "storiesDirectory cannot be null.");
Objects.requireNonNull(storyPathInclusion, "storyPathInclusion cannot be null.");
System.out.println("Looking for stories in: " + storiesDirectory);
LOG.debug("Looking for stories in: {}", storiesDirectory);
LOG.debug("Using story path inclusion: {}", storyPathInclusion);
final List<String> storyPaths = new StoryFinder().findPaths(storiesDirectory, storyPathInclusion, "**/partial_*,**/givenstory_*");
LOG.info("Found {} stories: {}", storyPaths.size(), storyPaths);
return storyPaths;
}
示例5: storyPaths
import org.jbehave.core.io.StoryFinder; //导入依赖的package包/类
@Override
protected List<String> storyPaths() {
String story = System.getProperty("story");
if (story != null && !story.isEmpty()) {
return new StoryFinder().findPaths(codeLocationFromClass(this.getClass()), "**/" + story + ".story", "**/excluded*.story");
} else {
return new StoryFinder().findPaths(codeLocationFromClass(this.getClass()), "**/*.story", "**/excluded*.story");
}
}
示例6: storyPaths
import org.jbehave.core.io.StoryFinder; //导入依赖的package包/类
@Override
protected List<String> storyPaths() {
return new StoryFinder().findPaths(
CodeLocations.codeLocationFromClass(this.getClass()),
Arrays.asList("**/*.story"), Arrays.asList(""));
}
示例7: run
import org.jbehave.core.io.StoryFinder; //导入依赖的package包/类
@Test
@Override
public void run() throws Throwable {
List<String> paths = new StoryFinder().findPaths(CodeLocations
.codeLocationFromClass(this.getClass()).getFile(),
asList("**/*story.en.txt"), null);
injectedEmbedder().runStoriesAsPaths(paths);
// injectedEmbedder().configuration().;
}
示例8: run
import org.jbehave.core.io.StoryFinder; //导入依赖的package包/类
@Test
@Override
public void run() throws Throwable {
List<String> paths = new StoryFinder().findPaths(CodeLocations
.codeLocationFromClass(this.getClass()).getFile(),
asList("**/*story.hy.txt"), null);
injectedEmbedder().runStoriesAsPaths(paths);
// injectedEmbedder().configuration().;
}
示例9: storyPaths
import org.jbehave.core.io.StoryFinder; //导入依赖的package包/类
@Override
protected List<String> storyPaths() {
return new StoryFinder().findPaths(
codeLocationFromClass(this.getClass()), "**/*.story",
"**/excluded*.story");
}
示例10: mapStories
import org.jbehave.core.io.StoryFinder; //导入依赖的package包/类
@Test
public void mapStories() {
Embedder embedder = new Embedder();
embedder.useMetaFilters(asList("+author *", "+theme *", "-skip"));
List<String> storyPaths = new StoryFinder().findPaths(codeLocationFromClass(this.getClass()), "**/*.story", "");
embedder.mapStoriesAsPaths(storyPaths);
}
示例11: runClasspathLoadedStoriesAsJUnit
import org.jbehave.core.io.StoryFinder; //导入依赖的package包/类
@Test
public void runClasspathLoadedStoriesAsJUnit() {
// TraderEmbedder defines the configuration and steps factory
Embedder embedder = new TraderEmbedder();
embedder.embedderControls().doIgnoreFailureInStories(true);
List<String> storyPaths = new StoryFinder().findPaths(codeLocationFromClass(this.getClass()), "**/*.story", "");
embedder.runStoriesAsPaths(storyPaths);
}
示例12: runURLLoadedStoriesAsJUnit
import org.jbehave.core.io.StoryFinder; //导入依赖的package包/类
@Test
public void runURLLoadedStoriesAsJUnit() {
// Embedder defines the configuration and candidate steps
Embedder embedder = new URLTraderEmbedder();
String codeLocation = codeLocationFromClass(this.getClass()).getFile();
List<String> storyPaths = new StoryFinder().findPaths(codeLocation, asList(
"**/trader_is_alerted_of_status.story", "**/traders_can_be_subset.story"), null, "file:"
+ codeLocation);
embedder.runStoriesAsPaths(storyPaths);
}
示例13: storyPaths
import org.jbehave.core.io.StoryFinder; //导入依赖的package包/类
@Override
protected List<String> storyPaths() {
// Specify story paths as URLs
String codeLocation = codeLocationFromPath("../trader/src/main/java").getFile();
return new StoryFinder().findPaths(codeLocation, asList("**/trader_is_alerted_of_status.story",
"**/traders_can_be_subset.story"), asList(""), "file:" + codeLocation);
}
示例14: shouldAllowSpecificationOfStoryFinderClass
import org.jbehave.core.io.StoryFinder; //导入依赖的package包/类
@Test
public void shouldAllowSpecificationOfStoryFinderClass() {
// Given
AbstractEmbedderTask task = new AbstractEmbedderTask() {
};
// When
task.setStoryFinderClass(MyStoryFinder.class.getName());
StoryFinder storyFinder = task.newStoryFinder();
// Then
assertThat(storyFinder.getClass().getName(), equalTo(MyStoryFinder.class.getName()));
}
示例15: shouldMapStoriesAsEmbeddables
import org.jbehave.core.io.StoryFinder; //导入依赖的package包/类
@Test
public void shouldMapStoriesAsEmbeddables() {
// Given
final EmbedderClassLoader classLoader = new EmbedderClassLoader(this.getClass().getClassLoader());
MapStoriesAsEmbeddables task = new MapStoriesAsEmbeddables() {
@Override
protected Embedder newEmbedder() {
return embedder;
}
@Override
protected EmbedderClassLoader classLoader() {
return classLoader;
}
};
String searchInDirectory = "src/test/java/";
task.setSourceDirectory(searchInDirectory);
task.setOutputDirectory("target/test-classes");
List<String> includes = asList("**/*StoryMaps.java");
task.setIncludes(StringUtils.join(includes, "'"));
List<String> excludes = asList();
task.setExcludes(StringUtils.join(excludes, "'"));
List<String> classNames = new StoryFinder().findClassNames(searchInDirectory, includes, excludes);
// When
task.execute();
// Then
verify(embedder).runAsEmbeddables(classNames);
}