use of org.springframework.core.io.ClassRelativeResourceLoader in project webapp by elimu-ai.
the class EPubParagraphExtractionHelperTest method testExtractParagraphsFromChapterFile_HIN_SW_10145_ch4.
@Test
public void testExtractParagraphsFromChapterFile_HIN_SW_10145_ch4() throws IOException {
ResourceLoader resourceLoader = new ClassRelativeResourceLoader(EPubParagraphExtractionHelper.class);
Resource resource = resourceLoader.getResource("hin-sw-10145-ek-sau-saintisvan-paer.epub_4.xhtml");
File xhtmlFile = resource.getFile();
logger.debug("xhtmlFile: " + xhtmlFile);
List<String> storyBookParagraphs = EPubParagraphExtractionHelper.extractParagraphsFromChapterFile(xhtmlFile);
assertThat(storyBookParagraphs.size(), is(3));
assertThat(storyBookParagraphs.get(0), is("एक गोजर एक बड़े से भूरे पत्ते के भीतर"));
assertThat(storyBookParagraphs.get(1), is("ख़ुमारी में दुबकी हुई थी।"));
assertThat(storyBookParagraphs.get(2), is("चिड़ियों की चहचहाट ने उसे जगा दिया।"));
}
use of org.springframework.core.io.ClassRelativeResourceLoader in project webapp by elimu-ai.
the class EPubParagraphExtractionHelperTest method testExtractParagraphsFromChapterFile_BEN_GDL_761.
@Test
public void testExtractParagraphsFromChapterFile_BEN_GDL_761() throws IOException {
ResourceLoader resourceLoader = new ClassRelativeResourceLoader(EPubParagraphExtractionHelper.class);
Resource resource = resourceLoader.getResource("ben-gdl-761.epub_chapter-2.xhtml");
File xhtmlFile = resource.getFile();
logger.debug("xhtmlFile: " + xhtmlFile);
List<String> storyBookParagraphs = EPubParagraphExtractionHelper.extractParagraphsFromChapterFile(xhtmlFile);
assertThat(storyBookParagraphs.size(), is(1));
assertThat(storyBookParagraphs.get(0), is("আজকে ছুটির দিন আনন্দে হারাই! চলো সবে পোশাকের উৎসবে যাই!"));
}
use of org.springframework.core.io.ClassRelativeResourceLoader in project webapp by elimu-ai.
the class EPubParagraphExtractionHelperTest method testExtractParagraphsFromChapterFile_ENG_GDL_1855_ch4.
@Test
public void testExtractParagraphsFromChapterFile_ENG_GDL_1855_ch4() throws IOException {
ResourceLoader resourceLoader = new ClassRelativeResourceLoader(EPubParagraphExtractionHelper.class);
Resource resource = resourceLoader.getResource("eng-gdl-1855.epub_chapter-4.xhtml");
File xhtmlFile = resource.getFile();
logger.debug("xhtmlFile: " + xhtmlFile);
List<String> storyBookParagraphs = EPubParagraphExtractionHelper.extractParagraphsFromChapterFile(xhtmlFile);
assertThat(storyBookParagraphs.size(), is(2));
assertThat(storyBookParagraphs.get(0), is("Some wild cats have spots."));
assertThat(storyBookParagraphs.get(1), is("Like the leopard and the leopard cat!"));
}
use of org.springframework.core.io.ClassRelativeResourceLoader in project webapp by elimu-ai.
the class EPubParagraphExtractionHelperTest method testExtractParagraphsFromChapterFile_ENG_GDL_1855.
@Test
public void testExtractParagraphsFromChapterFile_ENG_GDL_1855() throws IOException {
ResourceLoader resourceLoader = new ClassRelativeResourceLoader(EPubParagraphExtractionHelper.class);
Resource resource = resourceLoader.getResource("eng-gdl-1855.epub_chapter-2.xhtml");
File xhtmlFile = resource.getFile();
logger.debug("xhtmlFile: " + xhtmlFile);
List<String> storyBookParagraphs = EPubParagraphExtractionHelper.extractParagraphsFromChapterFile(xhtmlFile);
assertThat(storyBookParagraphs.size(), is(2));
assertThat(storyBookParagraphs.get(0), is("Some wild cats have stripes."));
assertThat(storyBookParagraphs.get(1), is("Like the tiger!"));
}
use of org.springframework.core.io.ClassRelativeResourceLoader in project uPortal by Jasig.
the class XalanAuthorizationHelperTest method setup.
@Before
public void setup() throws Exception {
final ResourceLoaderURIResolver resolver = new ResourceLoaderURIResolver(new ClassRelativeResourceLoader(getClass()));
this.tFactory = TransformerFactory.newInstance();
this.tFactory.setURIResolver(resolver);
this.tFactory.setErrorListener(new SimpleTransformErrorListener(LogFactory.getLog(getClass())));
this.xmlSource = new StreamSource(this.getClass().getResourceAsStream("test.xml"));
}
Aggregations