use of org.asqatasun.entity.audit.Content in project Asqatasun by Asqatasun.
the class CrawlerServiceImplTest method testCrawl_Page.
/**
* Test the crawl of a page
*/
public void testCrawl_Page() {
System.out.println("crawl_page");
crawlerFactory.setCrawlConfigFilePath(PAGE_CRAWL_CONF_FILE_PATH);
String siteUrl = bundle.getString(FULL_SITE_CRAWL_URL_KEY);
Audit audit = new AuditImpl();
audit.setParameterSet(setCrawlParameters("3", "", "", "", ""));
WebResource page = crawlerService.crawlPage(audit, siteUrl);
Collection<Long> contentListId = mockContentDataService.getSSPIdsFromWebResource(page.getId(), HttpStatus.SC_OK, 0, 10);
List<Content> contentList = new ArrayList<>();
for (Long id : contentListId) {
contentList.add(mockContentDataService.readWithRelatedContent(id, false));
}
assertEquals(1, contentList.size());
Set<String> urlSet = getUrlSet(contentList);
assertTrue(urlSet.contains(siteUrl));
assertFalse(urlSet.contains(siteUrl + PAGE_NAME_LEVEL1));
assertFalse(urlSet.contains(siteUrl + PAGE_NAME_LEVEL2));
assertFalse(urlSet.contains(siteUrl + FORBIDDEN_PAGE_NAME));
}
use of org.asqatasun.entity.audit.Content in project Asqatasun by Asqatasun.
the class AbstractRuleImplementationTestCase method process.
protected Collection<ProcessResult> process(String webResourceKey) {
LOGGER.debug(this + "::process(\"" + webResourceKey + "\")");
WebResource webResource = webResourceMap.get(webResourceKey);
Collection<ProcessResult> grossResultList = PROCESSOR_SERVICE.process(contentMap.get(webResource), testList);
for (Content content : contentMap.get(webResource)) {
LOGGER.debug(content.getURI());
}
grossResultMap.put(webResource, grossResultList);
return grossResultList;
}
Aggregations