Examples of StoryPathResolver


Examples of org.jbehave.core.io.StoryPathResolver

        viewGenerator.generateReportsView(outputDirectory, asList("html"), templates);
        // Then ... fail as expected
    }

    private String storyPath(Class<MyStory> storyClass) {
        StoryPathResolver resolver = new UnderscoredCamelCaseResolver(".story");
        return resolver.resolve(storyClass);
    }
View Full Code Here

Examples of org.jbehave.core.io.StoryPathResolver

    @Test
    public void shouldRunASingleStory() throws Throwable {
        // Given
        Embedder embedder = mock(Embedder.class);
        Configuration configuration = mock(Configuration.class);
        StoryPathResolver pathResolver = mock(StoryPathResolver.class);
        when(embedder.configuration()).thenReturn(configuration);
        when(configuration.storyPathResolver()).thenReturn(pathResolver);
        Class<MyStory> storyClass = MyStory.class;
        String storyPath = "/path/to/story";
        when(pathResolver.resolve(storyClass)).thenReturn(storyPath);
        CandidateSteps steps = mock(CandidateSteps.class);

        // When
        MyStory story = new MyStory(configuration, steps);
        story.useEmbedder(embedder);
View Full Code Here

Examples of org.jbehave.core.io.StoryPathResolver

  @Test
    public void shouldAllowOverrideOfDefaultConfiguration() throws Throwable {
        // Given
        Embedder embedder = mock(Embedder.class);
        Configuration configuration = mock(Configuration.class);
        StoryPathResolver pathResolver = mock(StoryPathResolver.class);
        when(embedder.configuration()).thenReturn(configuration);
        when(configuration.storyPathResolver()).thenReturn(pathResolver);
        Class<MyStory> storyClass = MyStory.class;
        String storyPath = "/path/to/story";
        when(pathResolver.resolve(storyClass)).thenReturn(storyPath);
        CandidateSteps steps = mock(CandidateSteps.class);
       
        // When
        MyStory story = new MyStory(new MostUsefulConfiguration(), steps);
        assertThat(story.configuration(), is(not(sameInstance(configuration))));
View Full Code Here

Examples of org.jbehave.core.io.StoryPathResolver

  @Test
    public void shouldAllowAdditionOfSteps() throws Throwable {
        // Given
        Embedder embedder = mock(Embedder.class);
        Configuration configuration = mock(Configuration.class);
        StoryPathResolver pathResolver = mock(StoryPathResolver.class);
        when(embedder.configuration()).thenReturn(configuration);
        when(configuration.storyPathResolver()).thenReturn(pathResolver);
        Class<MyStory> storyClass = MyStory.class;
        String storyPath = "/path/to/story";
        when(pathResolver.resolve(storyClass)).thenReturn(storyPath);
        CandidateSteps steps = mock(CandidateSteps.class);
       
        // When
        MyStory story = new MyStory(configuration, steps);
        story.useEmbedder(embedder);
View Full Code Here

Examples of org.jbehave.core.io.StoryPathResolver

        assertThat(delegates.contains(txtReporter), is(true));
        assertThat(delegates.contains(htmlReporter), is(true));
    }

    private String storyPath(Class<MyStory> storyClass) {
        StoryPathResolver resolver = new UnderscoredCamelCaseResolver(".story");
        return resolver.resolve(storyClass);
    }
View Full Code Here

Examples of org.jbehave.core.io.StoryPathResolver

public abstract class JUnitStory extends ConfigurableEmbedder {
   
  @Test
    public void run() throws Throwable {       
        Embedder embedder = configuredEmbedder();
        StoryPathResolver pathResolver = embedder.configuration().storyPathResolver();
        String storyPath = pathResolver.resolve(this.getClass());
        try {
            embedder.runStoriesAsPaths(asList(storyPath));
        } finally {
            embedder.generateCrossReference();
        }
View Full Code Here

Examples of org.jbehave.core.io.StoryPathResolver

public abstract class JUnitStory extends ConfigurableEmbedder {
   
  @Test
    public void run() throws Throwable {       
        Embedder embedder = configuredEmbedder();
        StoryPathResolver pathResolver = embedder.configuration().storyPathResolver();
        String storyPath = pathResolver.resolve(this.getClass());
        embedder.runStoriesAsPaths(asList(storyPath));
    }
View Full Code Here

Examples of org.jbehave.core.io.StoryPathResolver

public class PreferredConfiguration extends MostUsefulConfiguration {
 
  public PreferredConfiguration(String storyUrl) {
    URL codeLocation = CodeLocations.codeLocationFromURL(storyUrl);
    Properties viewResources = new Properties();
    StoryPathResolver storyPathResolver = new UnderscoredCamelCaseResolver(
        ".story");
    StoryReporterBuilder srb = new StoryReporterBuilder()
        .withDefaultFormats()
        .withViewResources(viewResources)
                .withRelativeDirectory(".." + File.separator + Config.getLatestReportsDir())
View Full Code Here

Examples of org.jbehave.core.io.StoryPathResolver

    return usedStepMonitor;
  }

  private void getStoryPathsFromJUnitStory() {
    configuredEmbedder = configurableEmbedder.configuredEmbedder();
    StoryPathResolver resolver = configuredEmbedder.configuration()
        .storyPathResolver();
    storyPaths = Arrays.asList(resolver.resolve(configurableEmbedder
        .getClass()));
  }
View Full Code Here
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.