Search in sources :

Example 1 with PortalContextBridgeImpl

use of com.liferay.faces.bridge.context.internal.PortalContextBridgeImpl in project liferay-faces-bridge-impl by liferay.

the class BridgePortalContextAjaxRequestTest method testBridgePortalContextAjaxRequest.

@Test
public void testBridgePortalContextAjaxRequest() {
    boolean markupHeadElementSupport = true;
    boolean ajaxRequest = true;
    PortalContext portalContextBridgeImpl = new PortalContextBridgeImpl(new PortletRequestMockImpl(markupHeadElementSupport, ajaxRequest));
    testBridgePortalContextAjaxRequest(portalContextBridgeImpl);
    markupHeadElementSupport = false;
    portalContextBridgeImpl = new PortalContextBridgeImpl(new PortletRequestMockImpl(markupHeadElementSupport, ajaxRequest));
    testBridgePortalContextAjaxRequest(portalContextBridgeImpl);
}
Also used : PortalContext(javax.portlet.PortalContext) PortalContextBridgeImpl(com.liferay.faces.bridge.context.internal.PortalContextBridgeImpl) Test(org.junit.Test)

Example 2 with PortalContextBridgeImpl

use of com.liferay.faces.bridge.context.internal.PortalContextBridgeImpl in project liferay-faces-bridge-impl by liferay.

the class BridgePortalContextTest method testBridgePortalContext.

@Test
public void testBridgePortalContext() {
    // PortalContextBridgeImpl should delegate to the portlet container to determine if the optional
    // MARKUP_HEAD_ELEMENT feature is supported.
    boolean markupHeadElementSupport = true;
    PortalContext portalContextBridgeImpl = new PortalContextBridgeImpl(new PortletRequestMockImpl(markupHeadElementSupport));
    Assert.assertEquals("true", portalContextBridgeImpl.getProperty(PortalContext.MARKUP_HEAD_ELEMENT_SUPPORT));
    testBridgePortalContextAddToHeadSupport(portalContextBridgeImpl, markupHeadElementSupport);
    // PortalContextBridgeImpl should delegate to the portlet container to determine if the optional
    // MARKUP_HEAD_ELEMENT feature is supported.
    markupHeadElementSupport = false;
    portalContextBridgeImpl = new PortalContextBridgeImpl(new PortletRequestMockImpl(markupHeadElementSupport));
    Assert.assertNull(portalContextBridgeImpl.getProperty(PortalContext.MARKUP_HEAD_ELEMENT_SUPPORT));
    testBridgePortalContextAddToHeadSupport(portalContextBridgeImpl, markupHeadElementSupport);
}
Also used : PortalContext(javax.portlet.PortalContext) PortalContextBridgeImpl(com.liferay.faces.bridge.context.internal.PortalContextBridgeImpl) Test(org.junit.Test)

Aggregations

PortalContextBridgeImpl (com.liferay.faces.bridge.context.internal.PortalContextBridgeImpl)2 PortalContext (javax.portlet.PortalContext)2 Test (org.junit.Test)2