Package org.strecks.controller.impl

Examples of org.strecks.controller.impl.TestAction


  public void testHandleActionPerform() throws Exception
  {

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


  {

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

    actionAfters.add(actionAfter1);
    actionAfters.add(actionAfter2);

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

    actionAfters.add(actionAfter1);
    actionAfters.add(actionAfter2);

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

    afters.add(after1);
    afters.add(after2);

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

    afters.add(after1);
    afters.add(after2);

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

    WebApplicationContext wac = createStrictMock(WebApplicationContext.class);

    expect(servletContext.getAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE))
        .andReturn(wac);
    expect(wac.isSingleton("beanName")).andReturn(false);
    expect(wac.getBean("beanName", TestAction.class)).andReturn(new TestAction());

    // second call - note that isSingleton is not called second time
    expect(servletContext.getAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE))
        .andReturn(wac);
    expect(wac.getBean("beanName", TestAction.class)).andReturn(new TestAction());

    replay(servletContext);
    replay(wac);

    SpringActionBeanSource source = new SpringActionBeanSource(actionBeanClass, "beanName");
View Full Code Here

    SimpleControllerAction action = new SimpleControllerAction();
    action.setServlet(servlet);

    action.setBeanSource(new DefaultActionBeanSource(TestAction.class));
    action.executeController(new TestAction(), actionContext);
    action.executeController(new TestAction(), actionContext);

    Assert.assertEquals(action.getCallCount(), 2);

    // verify that a different action bean is being used
    Assert.assertEquals(action.getActionBeanCount(), 1);
View Full Code Here

    SimpleControllerAction action = new SimpleControllerAction();
    action.setServlet(servlet);

    action.setBeanSource(new DefaultActionBeanSource(TestAction.class));
    action.executeController(new TestAction(), actionContext);
    action.executeController(new TestAction(), actionContext);

    Assert.assertEquals(action.getCallCount(), 2);

    // verify that a different action bean is being used
    Assert.assertEquals(action.getActionBeanCount(), 1);
View Full Code Here

TOP

Related Classes of org.strecks.controller.impl.TestAction

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.