Package org.jbehave.core.io.rest

Examples of org.jbehave.core.io.rest.ResourceIndexer


      throw new MojoExecutionException(message, e);
    }
  }

  private ResourceExporter createExporter() {
    ResourceIndexer indexer = newResourceIndexer();
    ResourceUploader uploader = newResourceUploader();
    getLog().info(
        "Creating exporter from filesystem using REST provider "
            + restProvider + " with resourcesPath " + resourcesPath
            + ", resourcesExt " + resourcesExt + ", resourcesSyntax "
View Full Code Here


      throw new MojoExecutionException(message, e);
    }
  }

  private ResourceImporter createImporter() {
    ResourceIndexer indexer = newResourceIndexer();
    ResourceLoader loader = newResourceLoader();
    getLog().info(
        "Creating importer to filesystem using REST provider "
            + restProvider + " with resourcesPath " + resourcesPath
            + " and resourcesExt " + resourcesExt);
View Full Code Here

    @Test
    public void canImportToFilesystem() throws IOException {

        // Given
        ResourceIndexer indexer = mock(ResourceIndexer.class);
        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

    @Test
    public void canExportFromFilesystem() throws IOException {

        // Given
        ResourceIndexer indexer = mock(ResourceIndexer.class);
        ResourceUploader uploader = mock(ResourceUploader.class);
        String rootURI = "http://wiki";
        String text1 = "story1";
        String text2 = "story2";
        String sourcePath = "target/stories";
        String sourceExt = ".story";
        String sourceSyntax = "jbehave/3.0";
        File file1 = new File(sourcePath + "/A_story" + sourceExt);
        write(text1, file1);
        File file2 = new File(sourcePath + "/Another_story" + sourceExt);
        write(text2, file2);
        Map<String, Resource> index = new HashMap<String, Resource>();
        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

    @Test
    public void canImportToFilesystem() throws IOException, MojoExecutionException, MojoFailureException {

        // Given
        final ResourceIndexer indexer = mock(ResourceIndexer.class);
        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

    this.providerName = name;
  }

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

TOP

Related Classes of org.jbehave.core.io.rest.ResourceIndexer

Copyright © 2018 www.massapicom. 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.