Package org.strecks.injection.handler.impl

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


  @Test
  public void test()
  {
    InjectionAnnotationReader c = new InjectionAnnotationReader();
    ActionWithLocale action = new ActionWithLocale();

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

    Locale locale = Locale.getDefault();
   
    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

TOP

Related Classes of org.strecks.injection.handler.impl.ActionWithLocale

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.