use of org.codelibs.fess.crawler.entity.AccessResultDataImpl in project fess-crawler by codelibs.
the class BinaryTransformerTest method test_getData_wrongName.
public void test_getData_wrongName() throws Exception {
final AccessResultDataImpl accessResultData = new AccessResultDataImpl();
accessResultData.setTransformerName("transformer");
accessResultData.setData("xyz".getBytes());
try {
binaryTransformer.getData(accessResultData);
fail();
} catch (final CrawlerSystemException e) {
}
}
use of org.codelibs.fess.crawler.entity.AccessResultDataImpl in project fess-crawler by codelibs.
the class BinaryTransformerTest method test_getData.
public void test_getData() throws Exception {
final AccessResultDataImpl accessResultData = new AccessResultDataImpl();
accessResultData.setTransformerName("binaryTransformer");
accessResultData.setData("xyz".getBytes());
final Object obj = binaryTransformer.getData(accessResultData);
assertNotNull(obj);
assertTrue(obj instanceof InputStream);
assertEquals("xyz", new String(IOUtils.toByteArray((InputStream) obj)));
}
use of org.codelibs.fess.crawler.entity.AccessResultDataImpl in project fess-crawler by codelibs.
the class FileTransformerTest method test_getData.
public void test_getData() throws Exception {
final AccessResultDataImpl accessResultDataImpl = new AccessResultDataImpl();
accessResultDataImpl.setData("hoge.txt".getBytes());
accessResultDataImpl.setEncoding(Constants.UTF_8);
accessResultDataImpl.setTransformerName("fileTransformer");
setBaseDir();
final Object obj = fileTransformer.getData(accessResultDataImpl);
assertTrue(obj instanceof File);
assertEquals(new File(fileTransformer.baseDir, "hoge.txt"), obj);
}
use of org.codelibs.fess.crawler.entity.AccessResultDataImpl in project fess-crawler by codelibs.
the class FileTransformerTest method test_getData_wrongName.
public void test_getData_wrongName() throws Exception {
final AccessResultDataImpl accessResultDataImpl = new AccessResultDataImpl();
accessResultDataImpl.setData("hoge.txt".getBytes());
accessResultDataImpl.setEncoding(Constants.UTF_8);
accessResultDataImpl.setTransformerName("transformer");
setBaseDir();
try {
final Object obj = fileTransformer.getData(accessResultDataImpl);
fail();
} catch (final CrawlerSystemException e) {
}
}
use of org.codelibs.fess.crawler.entity.AccessResultDataImpl in project fess-crawler by codelibs.
the class HtmlTransformerTest method test_getData.
public void test_getData() throws Exception {
final String value = "<html><body>hoge</body></html>";
final AccessResultDataImpl accessResultDataImpl = new AccessResultDataImpl();
accessResultDataImpl.setData(value.getBytes());
accessResultDataImpl.setEncoding(Constants.UTF_8);
accessResultDataImpl.setTransformerName("htmlTransformer");
final Object obj = htmlTransformer.getData(accessResultDataImpl);
assertEquals(value, obj);
}
Aggregations