Examples of ViewHandlerSupport


Examples of org.apache.myfaces.shared.application.ViewHandlerSupport

     * Test method for
     * {@link org.apache.myfaces.application.jsp.JspViewHandlerImpl#createView(javax.faces.context.FacesContext, java.lang.String)}.
     */
    public void testCreateView()
    {
        ViewHandlerSupport viewHandlerSupport = _mocksControl.createMock(ViewHandlerSupport.class);
        _testimpl.setViewHandlerSupport(viewHandlerSupport);
        expect(viewHandlerSupport.calculateViewId(same(_facesContext), eq("viewidxxx"))).andReturn("calculatedviewId");
        expect(_facesContext.getApplication()).andReturn(_application);
        ViewHandler viewHandler = _mocksControl.createMock(ViewHandler.class);
        expect(_application.getViewHandler()).andReturn(viewHandler);
        expect(_facesContext.getViewRoot()).andReturn(null);
        UIViewRoot viewRoot = _mocksControl.createMock(UIViewRoot.class);
View Full Code Here

Examples of org.apache.myfaces.shared.application.ViewHandlerSupport

     *
     * @throws Exception
     */
    public void testCreateViewWithInvalidViewId() throws Exception
    {
        ViewHandlerSupport viewHandlerSupport = _mocksControl.createMock(ViewHandlerSupport.class);
        _testimpl.setViewHandlerSupport(viewHandlerSupport);
        expect(viewHandlerSupport.calculateViewId(same(_facesContext), eq("viewidxxx"))).andThrow(
                new InvalidViewIdException("xxx"));

        expect(_facesContext.getExternalContext()).andReturn(_externalContext);
        HttpServletResponse httpServletResponse = _mocksControl.createMock(HttpServletResponse.class);
        expect(_externalContext.getResponse()).andReturn(httpServletResponse);
View Full Code Here

Examples of org.apache.myfaces.shared.application.ViewHandlerSupport

     * Test method for
     * {@link org.apache.myfaces.application.jsp.JspViewHandlerImpl#createView(javax.faces.context.FacesContext, java.lang.String)}.
     */
    public void testCreateViewWithExistingViewRoot()
    {
        ViewHandlerSupport viewHandlerSupport = _mocksControl.createMock(ViewHandlerSupport.class);
        _testimpl.setViewHandlerSupport(viewHandlerSupport);
        expect(viewHandlerSupport.calculateViewId(same(_facesContext), eq("viewidxxx"))).andReturn("calculatedviewId");
        expect(_facesContext.getApplication()).andReturn(_application);
        ViewHandler viewHandler = _mocksControl.createMock(ViewHandler.class);
        expect(_application.getViewHandler()).andReturn(viewHandler);

        UIViewRoot existingViewRoot = _mocksControl.createMock(UIViewRoot.class);
View Full Code Here

Examples of org.apache.myfaces.shared.application.ViewHandlerSupport

        super.setUpApplication();
       
        ((MockFacesContext)facesContext).setApplication(application);
       
        ViewHandlerImpl viewHandler = (ViewHandlerImpl) application.getViewHandler();
        viewHandler.setViewHandlerSupport(new ViewHandlerSupport(){

            public String calculateActionURL(FacesContext facesContext,
                    String viewId)
            {
                return viewId;
View Full Code Here

Examples of org.apache.myfaces.shared.application.ViewHandlerSupport

    protected void setUpApplication() throws Exception
    {
        super.setUpApplication();
       
        ViewHandlerImpl viewHandler = (ViewHandlerImpl) facesContext.getApplication().getViewHandler();
        viewHandler.setViewHandlerSupport(new ViewHandlerSupport(){

            public String calculateActionURL(FacesContext facesContext,
                    String viewId)
            {
                return viewId;
View Full Code Here

Examples of org.apache.myfaces.shared.application.ViewHandlerSupport

    protected void setUpApplication() throws Exception
    {
        super.setUpApplication();
       
        ViewHandlerImpl viewHandler = (ViewHandlerImpl) facesContext.getApplication().getViewHandler();
        viewHandler.setViewHandlerSupport(new ViewHandlerSupport(){

            public String calculateActionURL(FacesContext facesContext,
                    String viewId)
            {
                return viewId;
View Full Code Here

Examples of org.apache.myfaces.shared.application.ViewHandlerSupport

     * Test method for
     * {@link org.apache.myfaces.application.jsp.JspViewHandlerImpl#createView(javax.faces.context.FacesContext, java.lang.String)}.
     */
    public void testCreateView()
    {
        ViewHandlerSupport viewHandlerSupport = _mocksControl.createMock(ViewHandlerSupport.class);
        _testimpl.setViewHandlerSupport(viewHandlerSupport);
        expect(viewHandlerSupport.calculateViewId(same(_facesContext), eq("viewidxxx"))).andReturn("calculatedviewId");
        expect(_facesContext.getApplication()).andReturn(_application);
        ViewHandler viewHandler = _mocksControl.createMock(ViewHandler.class);
        expect(_application.getViewHandler()).andReturn(viewHandler);
        expect(_facesContext.getViewRoot()).andReturn(null);
        UIViewRoot viewRoot = _mocksControl.createMock(UIViewRoot.class);
View Full Code Here

Examples of org.apache.myfaces.shared.application.ViewHandlerSupport

     *
     * @throws Exception
     */
    public void testCreateViewWithInvalidViewId() throws Exception
    {
        ViewHandlerSupport viewHandlerSupport = _mocksControl.createMock(ViewHandlerSupport.class);
        _testimpl.setViewHandlerSupport(viewHandlerSupport);
        expect(viewHandlerSupport.calculateViewId(same(_facesContext), eq("viewidxxx"))).andThrow(
                new InvalidViewIdException("xxx"));

        expect(_facesContext.getExternalContext()).andReturn(_externalContext);
        HttpServletResponse httpServletResponse = _mocksControl.createMock(HttpServletResponse.class);
        expect(_externalContext.getResponse()).andReturn(httpServletResponse);
View Full Code Here

Examples of org.apache.myfaces.shared.application.ViewHandlerSupport

     * Test method for
     * {@link org.apache.myfaces.application.jsp.JspViewHandlerImpl#createView(javax.faces.context.FacesContext, java.lang.String)}.
     */
    public void testCreateViewWithExistingViewRoot()
    {
        ViewHandlerSupport viewHandlerSupport = _mocksControl.createMock(ViewHandlerSupport.class);
        _testimpl.setViewHandlerSupport(viewHandlerSupport);
        expect(viewHandlerSupport.calculateViewId(same(_facesContext), eq("viewidxxx"))).andReturn("calculatedviewId");
        expect(_facesContext.getApplication()).andReturn(_application);
        ViewHandler viewHandler = _mocksControl.createMock(ViewHandler.class);
        expect(_application.getViewHandler()).andReturn(viewHandler);

        UIViewRoot existingViewRoot = _mocksControl.createMock(UIViewRoot.class);
View Full Code Here

Examples of org.apache.myfaces.shared.application.ViewHandlerSupport

        super.setUpApplication();
       
        ((MockFacesContext)facesContext).setApplication(application);
       
        ViewHandlerImpl viewHandler = (ViewHandlerImpl) application.getViewHandler();
        viewHandler.setViewHandlerSupport(new ViewHandlerSupport(){

            public String calculateActionURL(FacesContext facesContext,
                    String viewId)
            {
                return viewId;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.