Examples of loadResourceAsText()


Examples of org.jbehave.core.io.ResourceLoader.loadResourceAsText()

        ResourceLoader resourceLoader = mock(ResourceLoader.class);
        ExamplesTableFactory factory = new ExamplesTableFactory(resourceLoader);
       
        // When
        String resourcePath = "/path/to/table";
        when(resourceLoader.loadResourceAsText(resourcePath)).thenReturn(tableAsString);
        ExamplesTable examplesTable = factory.createExamplesTable(resourcePath);
       
        // Then
        assertThat(examplesTable.asString(), equalTo(tableAsString));
    }
View Full Code Here

Examples of org.jbehave.core.io.ResourceLoader.loadResourceAsText()

        Map<String, Resource> index = new HashMap<String, Resource>();
        index.put("one", new Resource(rootURI + "/one"));
        index.put("two", new Resource(rootURI + "/two"));
        when(indexer.indexResources(rootURI)).thenReturn(index);
        String text1 = "story text 1";
        when(loader.loadResourceAsText(index.get("one").getURI())).thenReturn(text1);
        String text2 = "story text 2";
        when(loader.loadResourceAsText(index.get("two").getURI())).thenReturn(text2);

        // When
        String targetPath = "target/stories";
View Full Code Here

Examples of org.jbehave.core.io.ResourceLoader.loadResourceAsText()

        index.put("two", new Resource(rootURI + "/two"));
        when(indexer.indexResources(rootURI)).thenReturn(index);
        String text1 = "story text 1";
        when(loader.loadResourceAsText(index.get("one").getURI())).thenReturn(text1);
        String text2 = "story text 2";
        when(loader.loadResourceAsText(index.get("two").getURI())).thenReturn(text2);

        // When
        String targetPath = "target/stories";
        String targetExt = ".story";
        ResourceImporter importer = new ImportToFilesystem(indexer, loader, targetPath, targetExt);
View Full Code Here

Examples of org.jbehave.core.io.ResourceLoader.loadResourceAsText()

      when(client.getType()).thenReturn(Type.JSON);
      String url = "http://wiki/page";
        String entity = "Some content";
        when(client.get(url)).thenReturn(entity);
    ResourceLoader loader = new LoadFromREST(client);
    String text = loader.loadResourceAsText(url);
    assertThat(text, containsString(entity));
  }

}
View Full Code Here

Examples of org.jbehave.core.io.ResourceLoader.loadResourceAsText()

        Map<String, Resource> index = new HashMap<String, Resource>();
        index.put("one", new Resource(rootURI + "/one"));
        index.put("two", new Resource(rootURI + "/two"));
        when(indexer.indexResources(rootURI)).thenReturn(index);
        String text1 = "story text 1";
        when(loader.loadResourceAsText(index.get("one").getURI())).thenReturn(text1);
        String text2 = "story text 2";
        when(loader.loadResourceAsText(index.get("two").getURI())).thenReturn(text2);

        // When
        String targetPath = "target/stories";
View Full Code Here

Examples of org.jbehave.core.io.ResourceLoader.loadResourceAsText()

        index.put("two", new Resource(rootURI + "/two"));
        when(indexer.indexResources(rootURI)).thenReturn(index);
        String text1 = "story text 1";
        when(loader.loadResourceAsText(index.get("one").getURI())).thenReturn(text1);
        String text2 = "story text 2";
        when(loader.loadResourceAsText(index.get("two").getURI())).thenReturn(text2);

        // When
        String targetPath = "target/stories";
        String targetExt = ".story";
        ImportToFilesystemMojo mojo = new ImportToFilesystemMojo(){
View Full Code Here

Examples of org.jbehave.core.io.ResourceLoader.loadResourceAsText()

  @When("story $name text contains '$text'")
  public void storyIsLoaded(String name, String text) {
    ResourceLoader loader = resourceLoader();
    Resource resource = index.get(name);
    String asText = loader.loadResourceAsText(resource.getURI());
    assertThat(asText, containsString(text));
  }

  @When("stories in $sourcePath are exported to $rootURI")
  public void whenStoriesAreExported(String sourcePath, String rootURI) {
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.