Examples of TestAction


Examples of org.strecks.controller.impl.TestAction

  {

    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

Examples of org.strecks.controller.impl.TestAction

    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

Examples of org.strecks.controller.impl.TestAction

    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

Examples of org.strecks.controller.impl.TestAction

    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

Examples of org.strecks.controller.impl.TestAction

    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

Examples of org.strecks.controller.impl.TestAction

    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

Examples of org.strecks.controller.impl.TestAction

    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

Examples of org.strecks.controller.impl.TestAction

    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

Examples of org.strecks.injection.handler.impl.TestAction

  @BeforeMethod
  public void beforeTest()
  {

    InjectionAnnotationReader c = new InjectionAnnotationReader();
    action = new TestAction();
    c.readAnnotations(action.getClass());
    inputs = c.getInjectionMap();
    request = EasyMock.createMock(HttpServletRequest.class);

  }
View Full Code Here

Examples of org.strecks.injection.handler.impl.TestAction

  @Test
  public void testInputReader()
  {

    InjectionAnnotationReader c = new InjectionAnnotationReader();
    TestAction action = new TestAction();

    c.readAnnotations(action.getClass());
    Map<String, InjectionWrapper> inputs = c.getInjectionMap();

    HttpServletRequest request = EasyMock.createMock(HttpServletRequest.class);

    expect(request.getParameter("integerInput")).andReturn("1");
    expect(request.getParameter("converted_long")).andReturn("2");

    replay(request);

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

    inputWrapper.inject(action, new TestContextImpl(request));

    inputWrapper = inputs.get("convertedLongInput");

    inputWrapper.inject(action, new TestContextImpl(request));

    verify(request);

    assert action.getConvertedLongInput() != null;
    assert action.getIntegerInput() != null;
    assert action.getLongInput() == null;

  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.