Search in sources :

Example 1 with AccessResultDataImpl

use of org.codelibs.fess.crawler.entity.AccessResultDataImpl in project fess-crawler by codelibs.

the class FileTransformerTest method test_getData_nullData.

public void test_getData_nullData() throws Exception {
    final AccessResultDataImpl accessResultDataImpl = new AccessResultDataImpl();
    accessResultDataImpl.setData(null);
    accessResultDataImpl.setEncoding(Constants.UTF_8);
    accessResultDataImpl.setTransformerName("fileTransformer");
    setBaseDir();
    final Object obj = fileTransformer.getData(accessResultDataImpl);
    assertNull(obj);
}
Also used : AccessResultDataImpl(org.codelibs.fess.crawler.entity.AccessResultDataImpl)

Example 2 with AccessResultDataImpl

use of org.codelibs.fess.crawler.entity.AccessResultDataImpl in project fess-crawler by codelibs.

the class HtmlTransformerTest method test_getData_wrongName.

public void test_getData_wrongName() 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("transformer");
    try {
        htmlTransformer.getData(accessResultDataImpl);
        fail();
    } catch (final CrawlerSystemException e) {
    }
}
Also used : CrawlerSystemException(org.codelibs.fess.crawler.exception.CrawlerSystemException) AccessResultDataImpl(org.codelibs.fess.crawler.entity.AccessResultDataImpl)

Example 3 with AccessResultDataImpl

use of org.codelibs.fess.crawler.entity.AccessResultDataImpl in project fess-crawler by codelibs.

the class HtmlTransformerTest method test_getData_nullData.

public void test_getData_nullData() throws Exception {
    final AccessResultDataImpl accessResultDataImpl = new AccessResultDataImpl();
    accessResultDataImpl.setData(null);
    accessResultDataImpl.setEncoding(Constants.UTF_8);
    accessResultDataImpl.setTransformerName("htmlTransformer");
    final Object obj = htmlTransformer.getData(accessResultDataImpl);
    assertNull(obj);
}
Also used : AccessResultDataImpl(org.codelibs.fess.crawler.entity.AccessResultDataImpl)

Example 4 with AccessResultDataImpl

use of org.codelibs.fess.crawler.entity.AccessResultDataImpl in project fess-crawler by codelibs.

the class TextTransformerTest method test_getData_wrongName.

public void test_getData_wrongName() throws Exception {
    final AccessResultDataImpl accessResultData = new AccessResultDataImpl();
    accessResultData.setTransformerName("transformer");
    accessResultData.setData("xyz".getBytes());
    try {
        textTransformer.getData(accessResultData);
        fail();
    } catch (final CrawlerSystemException e) {
    }
}
Also used : CrawlerSystemException(org.codelibs.fess.crawler.exception.CrawlerSystemException) AccessResultDataImpl(org.codelibs.fess.crawler.entity.AccessResultDataImpl)

Example 5 with AccessResultDataImpl

use of org.codelibs.fess.crawler.entity.AccessResultDataImpl in project fess-crawler by codelibs.

the class TextTransformerTest method test_getData.

public void test_getData() throws Exception {
    final AccessResultDataImpl accessResultData = new AccessResultDataImpl();
    accessResultData.setTransformerName("textTransformer");
    accessResultData.setData("xyz".getBytes());
    final Object obj = textTransformer.getData(accessResultData);
    assertNotNull(obj);
    assertTrue(obj instanceof String);
    assertEquals("xyz", obj.toString());
}
Also used : AccessResultDataImpl(org.codelibs.fess.crawler.entity.AccessResultDataImpl)

Aggregations

AccessResultDataImpl (org.codelibs.fess.crawler.entity.AccessResultDataImpl)24 ArrayList (java.util.ArrayList)6 CrawlerSystemException (org.codelibs.fess.crawler.exception.CrawlerSystemException)6 TestEntity (org.codelibs.fess.crawler.entity.TestEntity)4 Map (java.util.Map)2 File (java.io.File)1 InputStream (java.io.InputStream)1