Package org.strecks.context.impl

Examples of org.strecks.context.impl.TestContextImpl


    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);
View Full Code Here


    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(servletContext);
    replay(wac);

    SpringActionBeanSource source = new SpringActionBeanSource(actionBeanClass, "beanName");
    TestContextImpl context = new TestContextImpl(servletContext);
    Object bean1 = source.createBean(context);
    source.createBean(context);

    assert bean1 instanceof TestAction;
View Full Code Here

        null);

    replay(servletContext);

    SpringActionBeanSource source = new SpringActionBeanSource(actionBeanClass, "beanName");
    TestContextImpl context = new TestContextImpl(servletContext);

    try
    {
      source.createBean(context);
      Assert.fail();
View Full Code Here

    expect(mapping.findForward("success")).andReturn(actionForward);

    replay(mapping);

    MappingNavigationHandler handler = new MappingNavigationHandler();
    ActionForwardViewAdapter viewAdapter = handler.getActionForward(new TestContextImpl(null, mapping), "success");

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

    verify(mapping);
View Full Code Here

    replay(servletContext);
    replay(wac);

    SpringActionBeanSource source = new SpringActionBeanSource(actionBeanClass, "beanName");
    TestContextImpl context = new TestContextImpl(servletContext);

    try
    {
      source.createBean(context);
      Assert.fail();
View Full Code Here

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

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

    verify(actionBean);
    verify(mapping);
View Full Code Here

    replay(mapping);
    replay(form);
    replay(request);


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

    verify(actionBean);
    verify(mapping);
View Full Code Here

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

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

    verify(actionBean);
    verify(mapping);
View Full Code Here

TOP

Related Classes of org.strecks.context.impl.TestContextImpl

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.