Search in sources :

Example 1 with AccessResultImpl

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

the class DataServiceImplTest method test_insert_deleteTx.

public void test_insert_deleteTx() {
    final AccessResult accessResult1 = new AccessResultImpl();
    accessResult1.setContentLength(Long.valueOf(10));
    accessResult1.setCreateTime(System.currentTimeMillis());
    accessResult1.setExecutionTime(10);
    accessResult1.setHttpStatusCode(200);
    accessResult1.setLastModified(System.currentTimeMillis());
    accessResult1.setMethod("GET");
    accessResult1.setMimeType("text/plain");
    accessResult1.setParentUrl("http://www.parent.com/");
    accessResult1.setRuleId("htmlRule");
    accessResult1.setSessionId("id1");
    accessResult1.setStatus(200);
    accessResult1.setUrl("http://www.id1.com/");
    dataService.store(accessResult1);
    final AccessResult accessResult2 = dataService.getAccessResult("id1", "http://www.id1.com/");
    assertNotNull(accessResult2);
    accessResult2.setMimeType("text/html");
    dataService.update(accessResult2);
    final AccessResult accessResult3 = dataService.getAccessResult("id1", "http://www.id1.com/");
    assertNotNull(accessResult3);
    assertEquals("text/html", accessResult3.getMimeType());
    dataService.delete("id1");
    final AccessResult accessResult4 = dataService.getAccessResult("id1", "http://www.id1.com/");
    assertNull(accessResult4);
}
Also used : AccessResult(org.codelibs.fess.crawler.entity.AccessResult) AccessResultImpl(org.codelibs.fess.crawler.entity.AccessResultImpl)

Aggregations

AccessResult (org.codelibs.fess.crawler.entity.AccessResult)1 AccessResultImpl (org.codelibs.fess.crawler.entity.AccessResultImpl)1