Search in sources :

Example 1 with MockRenderKit

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);
}
Also used : RenderKit(jakarta.faces.render.RenderKit) MockRenderKit(com.sun.faces.mock.MockRenderKit) MockRenderKit(com.sun.faces.mock.MockRenderKit) RenderKitFactory(jakarta.faces.render.RenderKitFactory)

Example 2 with MockRenderKit

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) {
    }
}
Also used : MockRenderKit(com.sun.faces.mock.MockRenderKit) RenderKit(jakarta.faces.render.RenderKit) UIViewRoot(jakarta.faces.component.UIViewRoot) MockRenderKit(com.sun.faces.mock.MockRenderKit) RenderKitFactory(jakarta.faces.render.RenderKitFactory)

Example 3 with MockRenderKit

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) {
    }
}
Also used : RenderKit(jakarta.faces.render.RenderKit) MockRenderKit(com.sun.faces.mock.MockRenderKit) MockRenderKit(com.sun.faces.mock.MockRenderKit) RenderKitFactory(jakarta.faces.render.RenderKitFactory)

Example 4 with MockRenderKit

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);
}
Also used : HashMap(java.util.HashMap) MockRenderKit(com.sun.faces.mock.MockRenderKit) RenderKit(jakarta.faces.render.RenderKit) MockRenderKit(com.sun.faces.mock.MockRenderKit) Map(java.util.Map) HashMap(java.util.HashMap) RenderKitFactory(jakarta.faces.render.RenderKitFactory)

Example 5 with MockRenderKit

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);
}
Also used : SearchKeywordResolverImplForm(com.sun.faces.component.search.SearchKeywordResolverImplForm) SearchExpressionContextFactoryImpl(com.sun.faces.component.search.SearchExpressionContextFactoryImpl) SearchKeywordResolverImplAll(com.sun.faces.component.search.SearchKeywordResolverImplAll) SearchKeywordResolverImplComposite(com.sun.faces.component.search.SearchKeywordResolverImplComposite) SearchKeywordResolverImplRoot(com.sun.faces.component.search.SearchKeywordResolverImplRoot) SearchKeywordResolverImplPrevious(com.sun.faces.component.search.SearchKeywordResolverImplPrevious) SearchKeywordResolverImplNamingContainer(com.sun.faces.component.search.SearchKeywordResolverImplNamingContainer) CompositeSearchKeywordResolver(com.sun.faces.component.search.CompositeSearchKeywordResolver) VisitContextFactoryImpl(com.sun.faces.component.visit.VisitContextFactoryImpl) SearchKeywordResolverImplParent(com.sun.faces.component.search.SearchKeywordResolverImplParent) SearchKeywordResolverImplNone(com.sun.faces.component.search.SearchKeywordResolverImplNone) SearchExpressionHandlerImpl(com.sun.faces.component.search.SearchExpressionHandlerImpl) SearchKeywordResolverImplThis(com.sun.faces.component.search.SearchKeywordResolverImplThis) SearchKeywordResolverImplId(com.sun.faces.component.search.SearchKeywordResolverImplId) SearchKeywordResolverImplNext(com.sun.faces.component.search.SearchKeywordResolverImplNext) RenderKit(jakarta.faces.render.RenderKit) MockRenderKit(com.sun.faces.mock.MockRenderKit) MockRenderKit(com.sun.faces.mock.MockRenderKit) SearchKeywordResolverImplChild(com.sun.faces.component.search.SearchKeywordResolverImplChild) RenderKitFactory(jakarta.faces.render.RenderKitFactory)

Aggregations

MockRenderKit (com.sun.faces.mock.MockRenderKit)6 RenderKit (jakarta.faces.render.RenderKit)6 RenderKitFactory (jakarta.faces.render.RenderKitFactory)6 UIViewRoot (jakarta.faces.component.UIViewRoot)2 CompositeSearchKeywordResolver (com.sun.faces.component.search.CompositeSearchKeywordResolver)1 SearchExpressionContextFactoryImpl (com.sun.faces.component.search.SearchExpressionContextFactoryImpl)1 SearchExpressionHandlerImpl (com.sun.faces.component.search.SearchExpressionHandlerImpl)1 SearchKeywordResolverImplAll (com.sun.faces.component.search.SearchKeywordResolverImplAll)1 SearchKeywordResolverImplChild (com.sun.faces.component.search.SearchKeywordResolverImplChild)1 SearchKeywordResolverImplComposite (com.sun.faces.component.search.SearchKeywordResolverImplComposite)1 SearchKeywordResolverImplForm (com.sun.faces.component.search.SearchKeywordResolverImplForm)1 SearchKeywordResolverImplId (com.sun.faces.component.search.SearchKeywordResolverImplId)1 SearchKeywordResolverImplNamingContainer (com.sun.faces.component.search.SearchKeywordResolverImplNamingContainer)1 SearchKeywordResolverImplNext (com.sun.faces.component.search.SearchKeywordResolverImplNext)1 SearchKeywordResolverImplNone (com.sun.faces.component.search.SearchKeywordResolverImplNone)1 SearchKeywordResolverImplParent (com.sun.faces.component.search.SearchKeywordResolverImplParent)1 SearchKeywordResolverImplPrevious (com.sun.faces.component.search.SearchKeywordResolverImplPrevious)1 SearchKeywordResolverImplRoot (com.sun.faces.component.search.SearchKeywordResolverImplRoot)1 SearchKeywordResolverImplThis (com.sun.faces.component.search.SearchKeywordResolverImplThis)1 VisitContextFactoryImpl (com.sun.faces.component.visit.VisitContextFactoryImpl)1