Examples of indexResources()


Examples of org.jbehave.core.io.rest.ResourceIndexer.indexResources()

        ResourceLoader loader = mock(ResourceLoader.class);
        String rootURI = "http://wiki";
        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);
View Full Code Here

Examples of org.jbehave.core.io.rest.ResourceIndexer.indexResources()

        Resource aResource = new Resource(rootURI + "/A_story");
    index.put("A_story", aResource);
        Resource anotherResource = new Resource(rootURI + "/Another_story");
    index.put("Another_story", anotherResource);
        String includes = "**";
    when(indexer.indexResources(rootURI, sourcePath, sourceSyntax, includes)).thenReturn(index);

        // When
        ResourceExporter exporter = new ExportFromFilesystem(indexer, uploader, sourcePath, sourceExt, sourceSyntax, includes);
        exporter.exportResources(rootURI);

View Full Code Here

Examples of org.jbehave.core.io.rest.ResourceIndexer.indexResources()

        final ResourceLoader loader = mock(ResourceLoader.class);
        String rootURI = "http://wiki";
        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);
View Full Code Here

Examples of org.jbehave.core.io.rest.ResourceIndexer.indexResources()

  }

  @When("index is retrieved from $uri")
  public void indexIsRetrieved(String uri) {
    ResourceIndexer indexer = resourceIndexer();
    index = indexer.indexResources(uri);
  }

  @Then("the index is not empty")
  public void indexIsNotEmpty() {
    assertThat(index.isEmpty(), is(false));
View Full Code Here

Examples of org.jbehave.core.io.rest.xwiki.IndexFromXWiki.indexResources()

  @Test
  public void canIndexFromPaths() {
    IndexWithBreadcrumbs indexer = new IndexFromXWiki();
    String rootURI = "http://localhost:8080/xwiki/rest/wikis/xwiki/spaces/Main/pages";
    String syntax = "jbehave/3.0";
    Map<String, Resource> index = indexer.indexResources(rootURI, "src/test/resources", syntax, "stories/**");
    assertThat(index.containsKey("a_first"), equalTo(true));
    Resource first = index.get("a_first");
    assertThat(first.getURI(), equalTo(rootURI + "/a_first"));
    assertThat(first.getParentName(), equalTo("stories"));
    assertThat(join(first.getBreadcrumbs(), "/"), equalTo("stories"));
View Full Code Here

Examples of org.jbehave.core.io.rest.xwiki.IndexFromXWiki.indexResources()

  @Test
  public void canIndexFromPathsWithDefaultSyntax() {
    IndexWithBreadcrumbs indexer = new IndexFromXWiki();
    String rootURI = "http://localhost:8080/xwiki/rest/wikis/xwiki/spaces/Main/pages";
    String syntax = null;
    Map<String, Resource> index = indexer.indexResources(rootURI, "src/test/resources", syntax, "stories/**");
    assertThat(index.containsKey("a_first"), equalTo(true));
    Resource first = index.get("a_first");
    assertThat(first.hasSyntax(), equalTo(false));
  }

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.