use of com.sun.faces.component.search.SearchExpressionHandlerImpl in project mojarra by eclipse-ee4j.
the class SearchExpressionHandlerTest method setUp.
@Override
public void setUp() throws Exception {
super.setUp();
UIViewRoot root = facesContext.getApplication().getViewHandler().createView(facesContext, null);
root.setViewId("/viewId");
facesContext.setViewRoot(root);
RenderKitFactory renderKitFactory = (RenderKitFactory) FactoryFinder.getFactory(FactoryFinder.RENDER_KIT_FACTORY);
RenderKit renderKit = new MockRenderKit();
try {
renderKitFactory.addRenderKit(RenderKitFactory.HTML_BASIC_RENDER_KIT, renderKit);
} catch (IllegalArgumentException e) {
}
FactoryFinder.setFactory(FactoryFinder.SEARCH_EXPRESSION_CONTEXT_FACTORY, SearchExpressionContextFactoryImpl.class.getName());
FactoryFinder.setFactory(FactoryFinder.VISIT_CONTEXT_FACTORY, VisitContextFactoryImpl.class.getName());
SearchExpressionHandlerImpl expressionHandlerImpl = new SearchExpressionHandlerImpl();
application.setSearchExpressionHandler(expressionHandlerImpl);
CompositeSearchKeywordResolver searchKeywordResolvers = new CompositeSearchKeywordResolver();
searchKeywordResolvers.add(new SearchKeywordResolverImplThis());
searchKeywordResolvers.add(new SearchKeywordResolverImplParent());
searchKeywordResolvers.add(new SearchKeywordResolverImplForm());
searchKeywordResolvers.add(new SearchKeywordResolverImplComposite());
searchKeywordResolvers.add(new SearchKeywordResolverImplNext());
searchKeywordResolvers.add(new SearchKeywordResolverImplPrevious());
searchKeywordResolvers.add(new SearchKeywordResolverImplNone());
searchKeywordResolvers.add(new SearchKeywordResolverImplNamingContainer());
searchKeywordResolvers.add(new SearchKeywordResolverImplRoot());
searchKeywordResolvers.add(new SearchKeywordResolverImplId());
searchKeywordResolvers.add(new SearchKeywordResolverImplChild());
searchKeywordResolvers.add(new SearchKeywordResolverImplAll());
application.setSearchKeywordResolver(searchKeywordResolvers);
}
Aggregations