Package org.strecks.view

Examples of org.strecks.view.RenderingViewAdapter


  @Test
  public void testHandleViewRenderingAdapter() throws Exception
  {

    RenderingViewAdapter viewAdapter = createStrictMock(RenderingViewAdapter.class);
    ControllerAction action = createStrictMock(ControllerAction.class);
    HttpServletRequest request = createStrictMock(HttpServletRequest.class);
    TestAction actionBean = createStrictMock(TestAction.class);
    ActionBeanSource beanSource = createStrictMock(ActionBeanSource.class);

    ActionContext actionContext = new TestContextImpl(request);

    // check the expected order of method invocation
    expect(action.getBeanSource()).andReturn(beanSource);
    expect(beanSource.createBean(actionContext)).andReturn(actionBean);
    action.preExecute(actionBean, actionContext);

    expect(action.getBeforeInterceptors()).andReturn(null);
    expect(action.executeController(actionBean, actionContext)).andReturn(viewAdapter);
    expect(action.getAfterInterceptors()).andReturn(null);

    request.setAttribute(InfrastructureKeys.ACTION_BEAN, actionBean);
    action.postExecute(actionBean, actionContext, null);
    viewAdapter.render(actionContext);

    replay(action);
    replay(request);
    replay(actionBean);
    replay(beanSource);
View Full Code Here


        request.setAttribute(InfrastructureKeys.ACTION_FORWARD, actionForward);
        return actionForward;
      }
      else if (viewAdapter instanceof RenderingViewAdapter)
      {
        RenderingViewAdapter va = (RenderingViewAdapter) viewAdapter;
        va.render(context);
      }
    }
    return null;

  }
View Full Code Here

TOP

Related Classes of org.strecks.view.RenderingViewAdapter

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.