}
}
@Test
public void testSimpleFulltextSearchOnSingleSite() throws Exception {
SearchService searchService = ServicesRegistry.getInstance().getSearchService();
try {
ProcessingContext ctx = Jahia.getThreadParamBean();
RenderContext context = new RenderContext(((ParamBean) ctx).getRequest(), ((ParamBean) ctx).getResponse(),
ctx.getUser());
JCRSessionWrapper session = JCRSessionFactory.getInstance().getCurrentUserSession(null, Locale.ENGLISH);
JCRNodeWrapper homeNode = session.getNode(FIRST_SITECONTENT_ROOT_NODE + "/home");
Resource resource = new Resource(homeNode, "html", null, Resource.CONFIGURATION_PAGE);
context.setMainResource(resource);
context.setSite(homeNode.getResolveSite());
new URLGenerator(context, resource);
SearchCriteria criteria = createSearchCriteria();
StopWatch stopWatch = new StopWatch("search");
stopWatch.start("Starting 1000 searchs");
for (int j = 0; j < 1000; j++) {
List<Hit<?>> hits = searchService.search(criteria, context).getResults();
int i = 0;
for (Hit<?> hit : hits) {
logger.info("[" + j + "][" + (++i) + "]: " + hit.getLink());
}
}