// Path: web-io/src/main/java/org/jbehave/web/io/ResourceFinder.java
// @SuppressWarnings("serial")
// public static class ResourceNotFoundException extends RuntimeException {
// 
// 	public ResourceNotFoundException(String resourcePath) {
// 		super("Resource " + resourcePath + " not found");
// 	}
// 
// 	public ResourceNotFoundException(String resourcePath,
// 			ClassLoader classLoader) {
// 		super("Resource " + resourcePath + " not found in classLoader "
// 				+ classLoader);
// 	}
// 
// }


import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.greaterThan;
import static org.junit.Assert.assertEquals;
import java.io.IOException;
import org.jbehave.web.io.ResourceFinder.ResourceNotFoundException;
import org.junit.Test;
    public void canFindResourceFromRootDirectoryInClasspath() throws IOException {
        ResourceFinder finder = new ResourceFinder("classpath:org/jbehave/web");
        assertEquals("A test resource", finder.resourceAsString("io/resource.txt"));
    }

    @Test
    public void canChangeRootDirectory() throws IOException {
        ResourceFinder finder = new ResourceFinder();
        finder.useRootDirectory("classpath:org/jbehave/web/io");
        assertEquals("A test resource", finder.resourceAsString("resource.txt"));
    }

    @Test
    public void canFindResourceInFilesystem() throws IOException {
        ResourceFinder finder = new ResourceFinder();
        assertEquals("A test resource", finder.resourceAsString("src/test/java/org/jbehave/web/io/resource.txt"));
    }

    @Test
    public void canFindResourceFromRootDirectoryInFilesystem() throws IOException {
        ResourceFinder finder = new ResourceFinder("src/test/java/org/jbehave/web");
        assertEquals("A test resource", finder.resourceAsString("io/resource.txt"));
    }

    @Test
    public void canFindResourceInJarsInClasspath() {
        ResourceFinder finder = new ResourceFinder();
        assertThat(finder.resourceAsString("ftl/jbehave-reports.ftl").length(), greaterThan(0));
    }

// Path: web-io/src/main/java/org/jbehave/web/io/ResourceFinder.java
// @SuppressWarnings("serial")
// public static class ResourceNotFoundException extends RuntimeException {
// 
// 	public ResourceNotFoundException(String resourcePath) {
// 		super("Resource " + resourcePath + " not found");
// 	}
// 
// 	public ResourceNotFoundException(String resourcePath,
// 			ClassLoader classLoader) {
// 		super("Resource " + resourcePath + " not found in classLoader "
// 				+ classLoader);
// 	}
// 
// }


// Path: web-io/src/test/java/org/jbehave/web/io/ResourceFinderTest.java
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.greaterThan;
import static org.junit.Assert.assertEquals;
import java.io.IOException;
import org.jbehave.web.io.ResourceFinder.ResourceNotFoundException;
import org.junit.Test;

    public void canFindResourceFromRootDirectoryInClasspath() throws IOException {
        ResourceFinder finder = new ResourceFinder("classpath:org/jbehave/web");
        assertEquals("A test resource", finder.resourceAsString("io/resource.txt"));
    }

    @Test
    public void canChangeRootDirectory() throws IOException {
        ResourceFinder finder = new ResourceFinder();
        finder.useRootDirectory("classpath:org/jbehave/web/io");
        assertEquals("A test resource", finder.resourceAsString("resource.txt"));
    }

    @Test
    public void canFindResourceInFilesystem() throws IOException {
        ResourceFinder finder = new ResourceFinder();
        assertEquals("A test resource", finder.resourceAsString("src/test/java/org/jbehave/web/io/resource.txt"));
    }

    @Test
    public void canFindResourceFromRootDirectoryInFilesystem() throws IOException {
        ResourceFinder finder = new ResourceFinder("src/test/java/org/jbehave/web");
        assertEquals("A test resource", finder.resourceAsString("io/resource.txt"));
    }

    @Test
    public void canFindResourceInJarsInClasspath() {
        ResourceFinder finder = new ResourceFinder();
        assertThat(finder.resourceAsString("ftl/jbehave-reports.ftl").length(), greaterThan(0));
    }

    @Test(expected = ResourceNotFoundException.class)