Package javax.portlet

Examples of javax.portlet.PortletRequest


    }

    public void testGetServerName()
    {
        MockControl control = newControl(PortletRequest.class);
        PortletRequest request = (PortletRequest) control.getMock();

        request.getServerName();
        control.setReturnValue("www.myhost.com");

        replayControls();

        WebRequest wr = new PortletWebRequest(request);
View Full Code Here


    }

    public void testGetServerPort()
    {
        MockControl control = newControl(PortletRequest.class);
        PortletRequest request = (PortletRequest) control.getMock();

        request.getServerPort();
        control.setReturnValue(80);

        replayControls();

        WebRequest wr = new PortletWebRequest(request);
View Full Code Here

        verifyControls();
    }

    public void testGetRequestURIUnsupported()
    {
        PortletRequest request = newRequest();

        replayControls();

        WebRequest wr = new PortletWebRequest(request);
View Full Code Here

        verifyControls();
    }

    public void testForwardUnsupported()
    {
        PortletRequest request = newRequest();

        replayControls();

        WebRequest wr = new PortletWebRequest(request);
View Full Code Here

    {
        ExternalContext externalContext = facesContext.getExternalContext();

        if (PortletUtil.isPortletRequest(facesContext))
        {
            PortletRequest request = (PortletRequest) externalContext.getRequest();
            return request.getParameter(MyFacesGenericPortlet.VIEW_ID);
        }

        String viewId = externalContext.getRequestPathInfo(); // getPathInfo
        if (viewId == null)
        {
View Full Code Here

    @Override
    public UIViewRoot restoreView(FacesContext context, String viewId)
    {
        if (PortletUtil.isPortletRequest(context))
        {
            PortletRequest request = (PortletRequest) context.getExternalContext().getRequest();
            String portletViewId = request.getParameter(MyFacesGenericPortlet.VIEW_ID);
            Application application = context.getApplication();
            ViewHandler applicationViewHandler = application.getViewHandler();
            String renderKitId = applicationViewHandler.calculateRenderKitId(context);
            UIViewRoot viewRoot = application.getStateManager().restoreView(context, portletViewId, renderKitId);
            return viewRoot;
View Full Code Here

    public UIViewRoot createView(FacesContext context, String viewId)
    {
        UIViewRoot viewRoot = super.createView(context, viewId);
        if (PortletUtil.isPortletRequest(context))
        {
            PortletRequest request = (PortletRequest) context.getExternalContext().getRequest();
            viewRoot.setViewId(request.getParameter(MyFacesGenericPortlet.VIEW_ID));
        }
        return viewRoot;
    }
View Full Code Here

    public void testPut() {
       
        Mock mockSession = mock(PortletSession.class);
        Mock mockRequest = mock(PortletRequest.class);
       
        PortletRequest req = (PortletRequest)mockRequest.proxy();
        PortletSession session = (PortletSession)mockSession.proxy();
       
        mockRequest.expects(once()).method("getPortletSession").will(returnValue(session));
        Constraint[] params = new Constraint[]{eq("testAttribute1"), eq("testValue1")};
        mockSession.expects(once()).method("setAttribute").with(params);
View Full Code Here

   
    public void testGet() {
        Mock mockSession = mock(PortletSession.class);
        Mock mockRequest = mock(PortletRequest.class);
       
        PortletRequest req = (PortletRequest)mockRequest.proxy();
        PortletSession session = (PortletSession)mockSession.proxy();
       
        mockRequest.expects(once()).method("getPortletSession").will(returnValue(session));
        mockSession.expects(once()).method("getAttribute").with(eq("testAttribute1")).will(returnValue("testValue1"));
        mockSession.expects(once()).method("getAttribute").with(eq("testAttribute2")).will(returnValue("testValue2"));
View Full Code Here

   
    public void testClear() {
        Mock mockSession = mock(PortletSession.class);
        Mock mockRequest = mock(PortletRequest.class);
       
        PortletRequest req = (PortletRequest)mockRequest.proxy();
        PortletSession session = (PortletSession)mockSession.proxy();
       
        mockRequest.expects(once()).method("getPortletSession").will(returnValue(session));
        mockSession.expects(once()).method("invalidate");
       
View Full Code Here

TOP

Related Classes of javax.portlet.PortletRequest

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.