use of org.springframework.core.io.ClassRelativeResourceLoader in project webapp by elimu-ai.
the class EPubMetadataExtractionHelperTest method testExtractCoverImageReferenceFromOpfFile_FIL_GLOBAL_DIGITAL_LIBRARY_761.
@Test
public void testExtractCoverImageReferenceFromOpfFile_FIL_GLOBAL_DIGITAL_LIBRARY_761() throws IOException {
ResourceLoader resourceLoader = new ClassRelativeResourceLoader(EPubMetadataExtractionHelper.class);
Resource resource = resourceLoader.getResource("ben-gdl-761.epub_book.opf");
File opfFile = resource.getFile();
logger.debug("opfFile: " + opfFile);
String coverImageReference = EPubMetadataExtractionHelper.extractCoverImageReferenceFromOpfFile(opfFile);
assertThat(coverImageReference, is("99e3d3af620881991813482fb602a1f6.jpg"));
}
use of org.springframework.core.io.ClassRelativeResourceLoader in project webapp by elimu-ai.
the class EPubMetadataExtractionHelperTest method testExtractCoverImageReferenceFromOpfFile_FIL_LETS_READ_ASIA_0acfe340.
@Test
public void testExtractCoverImageReferenceFromOpfFile_FIL_LETS_READ_ASIA_0acfe340() throws IOException {
ResourceLoader resourceLoader = new ClassRelativeResourceLoader(EPubMetadataExtractionHelper.class);
Resource resource = resourceLoader.getResource("fil-lra-0acfe340-6116-4f8a-a45d-c925c8a1fd0e.epub_content.opf");
File opfFile = resource.getFile();
logger.debug("opfFile: " + opfFile);
String coverImageReference = EPubMetadataExtractionHelper.extractCoverImageReferenceFromOpfFile(opfFile);
assertThat(coverImageReference, is("coverImage.jpeg"));
}
use of org.springframework.core.io.ClassRelativeResourceLoader in project webapp by elimu-ai.
the class EPubMetadataExtractionHelperTest method testExtractTitleFromOpfFile_BEN_GLOBAL_DIGITAL_LIBRARY.
@Test
public void testExtractTitleFromOpfFile_BEN_GLOBAL_DIGITAL_LIBRARY() throws IOException {
ResourceLoader resourceLoader = new ClassRelativeResourceLoader(EPubMetadataExtractionHelper.class);
Resource resource = resourceLoader.getResource("ben-gdl-761.epub_book.opf");
File opfFile = resource.getFile();
logger.debug("opfFile: " + opfFile);
String title = EPubMetadataExtractionHelper.extractTitleFromOpfFile(opfFile);
assertThat(title, is("উৎসব"));
String description = EPubMetadataExtractionHelper.extractDescriptionFromOpfFile(opfFile);
assertThat(description, is("পোশাক উৎসবের বর্ণ, শব্দ, গন্ধ ও অনুভূতি উপভোগ করো।"));
}
use of org.springframework.core.io.ClassRelativeResourceLoader in project webapp by elimu-ai.
the class EPubImageExtractionHelperTest method testExtractImageReferenceFromChapterFile_FIL_LRA_faa0d66e.
@Test
public void testExtractImageReferenceFromChapterFile_FIL_LRA_faa0d66e() throws IOException {
ResourceLoader resourceLoader = new ClassRelativeResourceLoader(EPubImageExtractionHelper.class);
Resource resource = resourceLoader.getResource("fil-lra-faa0d66e-564f-4d72-a1d3-ec46fb754205.epub_Page_3.xhtml");
File xhtmlFile = resource.getFile();
logger.debug("xhtmlFile: " + xhtmlFile);
String imageReference = EPubImageExtractionHelper.extractImageReferenceFromChapterFile(xhtmlFile);
assertThat(imageReference, is("image_3.jpg"));
}
use of org.springframework.core.io.ClassRelativeResourceLoader in project webapp by elimu-ai.
the class EPubImageExtractionHelperTest method testExtractImageReferenceFromChapterFile_BEN_SW_11791.
@Test
public void testExtractImageReferenceFromChapterFile_BEN_SW_11791() throws IOException {
ResourceLoader resourceLoader = new ClassRelativeResourceLoader(EPubImageExtractionHelper.class);
Resource resource = resourceLoader.getResource("ben-sw-11791-ghumkature-bhim.epub_2.xhtml");
File xhtmlFile = resource.getFile();
logger.debug("xhtmlFile: " + xhtmlFile);
String imageReference = EPubImageExtractionHelper.extractImageReferenceFromChapterFile(xhtmlFile);
assertThat(imageReference, is("image_2.jpg"));
}
Aggregations