use of com.sun.faces.mock.MockRenderKit in project mojarra by eclipse-ee4j.
the class UIComponentTestCase method setUp.
// ---------------------------------------------------- Overall Test Methods
// Set up instance variables required by this test case.
@Override
public void setUp() throws Exception {
super.setUp();
expectedAttributes = new String[0];
expectedFamily = "Test";
expectedId = "test";
expectedRendered = true;
expectedRendererType = null;
expectedRendersChildren = false;
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) {
}
component = new ComponentTestImpl(expectedId);
}
use of com.sun.faces.mock.MockRenderKit in project mojarra by eclipse-ee4j.
the class ValidatorTestCase method setUp.
// ---------------------------------------------------- Overall Test Methods
// Set up instance variables required by this test case.
@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) {
}
}
use of com.sun.faces.mock.MockRenderKit in project mojarra by eclipse-ee4j.
the class UIViewRootTestCase method setUp.
@Override
public void setUp() throws Exception {
FactoryFinder.releaseFactories();
super.setUp();
for (int i = 0, len = FACTORIES.length; i < len; i++) {
System.getProperties().remove(FACTORIES[i][0]);
}
FactoryFinder.releaseFactories();
int len, i = 0;
// simulate the "faces implementation specific" part
for (i = 0, len = FACTORIES.length; i < len; i++) {
FactoryFinder.setFactory(FACTORIES[i][0], FACTORIES[i][1]);
}
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) {
}
}
use of com.sun.faces.mock.MockRenderKit in project mojarra by eclipse-ee4j.
the class NamingContainerTestCase method setUp.
// ---------------------------------------------------- Overall Test Methods
// Set up instance variables required by this test case.
@Override
public void setUp() throws Exception {
super.setUp();
root = new UIViewRoot();
root.setViewId("/viewId");
root.setRenderKitId(RenderKitFactory.HTML_BASIC_RENDER_KIT);
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) {
}
Map map = new HashMap();
externalContext.setRequestParameterMap(map);
}
use of com.sun.faces.mock.MockRenderKit 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