*/
public class ResourceLoader {
- public static Document loadDocument(String resourceName, String baseUri) throws IOException {
- InputStream inputStream = ResourceLoader.class.getResourceAsStream(resourceName);
+ public static Document loadDocument(Class<?> classToLoadFrom, String resourceName, String baseUri) throws IOException {
+ InputStream inputStream = classToLoadFrom.getResourceAsStream(resourceName);
Document document = Jsoup.parse(inputStream, "UTF-8", baseUri);
return document;
}
private final Document document;
public AbstruseGooseComicFilterTest() throws IOException {
- document = ResourceLoader.loadDocument("abstruse-goose.html", "http://abstrusegoose.com/");
+ document = ResourceLoader.loadDocument(getClass(), "abstruse-goose.html", "http://abstrusegoose.com/");
}
@Test
private final Document document;
public BusinessCatComicFilterTest() throws IOException {
- document = ResourceLoader.loadDocument("business-cat.html", "http://www.businesscat.happyjar.com//");
+ document = ResourceLoader.loadDocument(getClass(), "business-cat.html", "http://www.businesscat.happyjar.com//");
}
@Test
private final Document document;
public ChiefOBrienAtWorkComicFilterTest() throws IOException {
- document = ResourceLoader.loadDocument("chief-obrien-at-work.html", "http://chiefobrienatwork.com/");
+ document = ResourceLoader.loadDocument(getClass(), "chief-obrien-at-work.html", "http://chiefobrienatwork.com/");
}
@Test
private final Document document;
public CyanideAndHappinessComicFilterTest() throws IOException {
- document = ResourceLoader.loadDocument("cyanide-and-happiness.html", "http://www.explosm.net/comics/new/");
+ document = ResourceLoader.loadDocument(getClass(), "cyanide-and-happiness.html", "http://www.explosm.net/comics/new/");
}
@Test