Package org.strecks.view

Examples of org.strecks.view.ViewAdapter


    replay(request);
    replay(session);
    replay(redirectHelper);

    ActionRedirectNavigationHandler handler = new ActionRedirectNavigationHandler();
    ViewAdapter viewAdapter = handler.getActionForward(new TestContextImpl(request), "action");

    ActionForwardViewAdapter va = (ActionForwardViewAdapter) viewAdapter;
    ActionForward actionForward = va.getActionForward();

    verify(request);
View Full Code Here


  {

    ActionForward actionForward = new ActionForward();

    ActionForwardNavigationHandler handler = new ActionForwardNavigationHandler();
    ViewAdapter viewAdapter = handler.getActionForward(new TestContextImpl(), actionForward);

    ActionForwardViewAdapter va = (ActionForwardViewAdapter) viewAdapter;
    assert (va.getActionForward() == actionForward);

  }
View Full Code Here

    replay(pageClass);
    replay(actionContext);
    replay(request);

    PageNavigationHandler handler = new PageNavigationHandler();
    ViewAdapter viewAdapter = handler.getActionForward(actionContext, pageClass);

    ActionForwardViewAdapter va = (ActionForwardViewAdapter) viewAdapter;
    ActionForward forward = va.getActionForward();

    assert forward instanceof PageForward;
View Full Code Here

  @Test
  public void testNavigationHandler()
  {

    ViewAdapter va = createStrictMock(ViewAdapter.class);

    replay(va);

    ViewAdapterNavigationHandler handler = new ViewAdapterNavigationHandler();
    ViewAdapter viewAdapter = handler.getActionForward(null, va);

    assert (va == viewAdapter);

    verify(va);
View Full Code Here

    expect(wac.getBean("resolver_name")).andReturn(viewResolver);
    expect(request.getAttribute(Globals.LOCALE_KEY)).andReturn(locale);
    expect(viewResolver.resolveViewName("view_name", locale)).andReturn(view);

    replayMocks();
    ViewAdapter adapter = handler.getActionForward(context, new ModelAndView("view_name", model));

    assert adapter instanceof SpringRenderingViewAdapter;
    SpringRenderingViewAdapter va = (SpringRenderingViewAdapter) adapter;
    assert va.getModel().equals(model);
    assert va.getView() == view;
View Full Code Here

    expect(servletContext.getAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE))
        .andReturn(wac);
    expect(wac.getBean("view_name")).andReturn(view);

    replayMocks();
    ViewAdapter adapter = handler.getActionForward(context, new ModelAndView("view_name", model));

    assert adapter instanceof SpringRenderingViewAdapter;
    SpringRenderingViewAdapter va = (SpringRenderingViewAdapter) adapter;
    assert va.getModel().equals(model);
    assert va.getView() == view;
View Full Code Here

    expect(context.getRequest()).andReturn(request);
    request.setAttribute(eq(DispatcherServlet.LOCALE_RESOLVER_ATTRIBUTE), isA(StrecksLocaleResolver.class));

    replayMocks();
    ViewAdapter adapter = handler.getActionForward(context, new ModelAndView(view, model));

    assert adapter instanceof SpringRenderingViewAdapter;
    SpringRenderingViewAdapter va = (SpringRenderingViewAdapter) adapter;
    assert va.getModel().equals(model);
    assert va.getView() == view;
View Full Code Here

    replay(actionBean);
    replay(mapping);
    replay(request);

    ViewAdapter viewAdapter = action.executeAction(actionBean, new TestContextImpl(request, null, null, null,
        mapping));
    ActionForwardViewAdapter va = (ActionForwardViewAdapter) viewAdapter;
    assert (va.getActionForward() == actionForward);

    verify(actionBean);
View Full Code Here

    replay(actionBean);
    replay(mapping);
    replay(request);

    ViewAdapter viewAdapter = action.executeAction(actionBean, new TestContextImpl(request, null, null, null,
        mapping));
    ActionForwardViewAdapter va = (ActionForwardViewAdapter) viewAdapter;
    assert (va.getActionForward() == actionForward);

    verify(actionBean);
View Full Code Here

    replay(servlet);
    replay(context);
    replay(messageResources);
    replay(form);

    ViewAdapter viewAdapter = action.executeAction(actionBean, new TestContextImpl(request, null, null, form,
        mapping));
    ActionForwardViewAdapter va = (ActionForwardViewAdapter) viewAdapter;
    assert (va.getActionForward() == actionForward);

    verify(actionBean);
View Full Code Here

TOP

Related Classes of org.strecks.view.ViewAdapter

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.