Package org.strecks.injection.internal

Examples of org.strecks.injection.internal.InjectionWrapper


    c.readAnnotations(action.getClass());
    Map<String, InjectionWrapper> injectionHandlers = c.getInjectionMap();
    ActionForm actionForm = new SimpleForm();

    InjectionWrapper inputWrapper = injectionHandlers.get("actionForm");

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

    assert action.getActionForm() != null;
    assert action.getActionForm() == actionForm;
  }
View Full Code Here


    c.readAnnotations(action.getClass());
    Map<String, InjectionWrapper> injectionHandlers = c.getInjectionMap();
    ActionForm actionForm = new SimpleForm();
    DelegatingForm delegator = new DelegatingForm(actionForm);

    InjectionWrapper inputWrapper = injectionHandlers.get("actionForm");

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

    assert action.getActionForm() != null;
    assert action.getActionForm() == actionForm;
  }
View Full Code Here

    replay(context);
    replay(request);
    replay(moduleConfig);
    replay(messageResources);

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

    ActionContext injectionContext = new TestContextImpl(request, null, context, null, null);
    inputWrapper.inject(action, injectionContext);
    MessageResourcesHelper namedHelper = action.getNamedHelper();
   
    namedHelper.getMessage("some.key");
   
    verify(context);
View Full Code Here

    replay(context);
    replay(request);
    replay(moduleConfig);
    replay(messageResources);

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

    ActionContext injectionContext = new TestContextImpl(request, null, context, null, null);
    inputWrapper.inject(action, injectionContext);
    MessageResourcesHelper defaultHelper = action.getDefaultHelper();
    defaultHelper.getMessage("some.key");

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

    replay(context);
    replay(request);
    replay(moduleConfig);
    replay(messageResources);

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

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

    verify(context);
    verify(request);
    verify(moduleConfig);
    verify(messageResources);
View Full Code Here

    replay(context);
    replay(request);
    replay(moduleConfig);
    replay(messageResources);

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

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

    verify(context);
    verify(request);
    verify(moduleConfig);
    verify(messageResources);
View Full Code Here

    HttpServletRequest request = createMock(HttpServletRequest.class);
    expect(request.getAttribute(Globals.LOCALE_KEY)).andReturn(locale);
   
    replay(request);

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

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

    verify(request);

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

    HttpServletRequest request = createMock(HttpServletRequest.class);

    replay(request);

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

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

    verify(request);

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

    expect(wac.getBean("springBean")).andReturn(new Integer(1));

    replay(context);
    replay(wac);

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

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

    verify(context);
    verify(wac);

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

    expect(wac.getBean("springBean")).andReturn(new Integer(1));

    replay(context);
    replay(wac);

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

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

    verify(context);
    verify(wac);

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

TOP

Related Classes of org.strecks.injection.internal.InjectionWrapper

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.