Package org.strecks.context

Examples of org.strecks.context.ActionContext


  public void test() throws Exception
  {

    View view = createStrictMock(View.class);
    Map model = createStrictMock(Map.class);
    ActionContext context = createStrictMock(ActionContext.class);
    HttpServletRequest request = createStrictMock(HttpServletRequest.class);
    HttpServletResponse response = createStrictMock(HttpServletResponse.class);

    SpringRenderingViewAdapter va = new SpringRenderingViewAdapter(view, model);

    expect(context.getRequest()).andReturn(request);
    expect(context.getResponse()).andReturn(response);
    view.render(model, request, response);

    replay(context);
    replay(view);
    replay(model);
View Full Code Here


  public void testException() throws Exception
  {

    View view = createStrictMock(View.class);
    Map model = createStrictMock(Map.class);
    ActionContext context = createStrictMock(ActionContext.class);
    HttpServletRequest request = createStrictMock(HttpServletRequest.class);
    HttpServletResponse response = createStrictMock(HttpServletResponse.class);

    SpringRenderingViewAdapter va = new SpringRenderingViewAdapter(view, model);

    expect(context.getRequest()).andReturn(request);
    expect(context.getResponse()).andReturn(response);
    view.render(model, request, response);
    expectLastCall().andThrow(new IllegalStateException());

    replay(context);
    replay(view);
View Full Code Here

  @Test
  public void testNavigationHandler()
  {

    Page pageClass = createStrictMock(Page.class);
    ActionContext actionContext = createStrictMock(TestContextImpl.class);
    HttpServletRequest request = createStrictMock(HttpServletRequest.class);

    expect(pageClass.getPagePath()).andReturn("page_path");
    expect(actionContext.getResponse()).andReturn(null);
    pageClass.setHttpServletResponse(null);
    expect(actionContext.getRequest()).andReturn(request);
    request.setAttribute(InfrastructureKeys.PAGE_BEAN, pageClass);

    replay(pageClass);
    replay(actionContext);
    replay(request);
View Full Code Here

    replay(request);
    replay(session);

    InjectionWrapper inputWrapper = inputs.get("redirectParameter");

    ActionContext injectionContext = new TestContextImpl(request);
    inputWrapper.inject(action, injectionContext);

    verify(request);
    verify(session);
View Full Code Here

    replay(request);
    replay(session);

    InjectionWrapper inputWrapper = inputs.get("redirectParameter");

    ActionContext injectionContext = new TestContextImpl(request);
    inputWrapper.inject(action, injectionContext);

    verify(request);
    verify(session);
View Full Code Here

    replay(request);

    InjectionWrapper inputWrapper = inputs.get("redirectParameter");

    ActionContext injectionContext = new TestContextImpl(request);
    inputWrapper.inject(action, injectionContext);

    verify(request);

    assert action.getRedirectParameter() == null;
View Full Code Here

    replay(context);

    InjectionWrapper inputWrapper = inputs.get("context");

    ActionContext injectionContext = new TestContextImpl(context);
    inputWrapper.inject(action, injectionContext);

    verify(context);

    assert action.getContext() != null;
View Full Code Here

    replay(response);

    InjectionWrapper inputWrapper = inputs.get("response");

    ActionContext injectionContext = new TestContextImpl(null, response, null, null, null);
    inputWrapper.inject(action, injectionContext);

    verify(response);

    assert action.getResponse() != null;
View Full Code Here

    replay(request);

    InjectionWrapper inputWrapper = inputs.get("integerInput");

    ActionContext injectionContext = new TestContextImpl(request);
    inputWrapper.inject(action, injectionContext);

    verify(request);

    assert action.getIntegerInput() == null;
View Full Code Here

    replay(request);

    InjectionWrapper inputWrapper = inputs.get("integerInput");

    ActionContext injectionContext = new TestContextImpl(request);
    inputWrapper.inject(action, injectionContext);

    verify(request);

    assert action.getIntegerInput() != null;
View Full Code Here

TOP

Related Classes of org.strecks.context.ActionContext

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.