Package org.strecks.injection.internal

Examples of org.strecks.injection.internal.InjectionAnnotationReader


  @Test
  public void testRequestAttribute()
  {

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

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

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

    expect(request.getAttribute("requestAttribute")).andReturn(new Integer(1));
View Full Code Here


  @Test
  public void testSessionAttribute()
  {

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

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

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

    expect(request.getSession(false)).andReturn(session);
View Full Code Here

  @Test
  public void testContextAttribute()
  {

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

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

    ServletContext context = EasyMock.createMock(ServletContext.class);

    expect(context.getAttribute("contextAttribute")).andReturn(new Integer(1));
View Full Code Here

  @Test
  public void testDoInjection() throws Exception
  {

    InjectionAnnotationReader c = new InjectionAnnotationReader();
    InjectionAction actionBean = new InjectionAction();
    c.readAnnotations(actionBean.getClass());
    Map<String, InjectionWrapper> injectionHandlers = c.getInjectionMap();

    HttpServletRequest request = createMock(HttpServletRequest.class);
    ServletContext context = createMock(ServletContext.class);

    // this will be called when the injection context is inspected
View Full Code Here

  @Test
  public void testDoInjection() throws Exception
  {

    InjectionAnnotationReader c = new InjectionAnnotationReader();
    InjectionAction actionBean = new InjectionAction();
    c.readAnnotations(actionBean.getClass());
    Map<String, InjectionWrapper> injectionHandlers = c.getInjectionMap();

    HttpServletRequest request = createMock(HttpServletRequest.class);
    ServletContext context = createMock(ServletContext.class);

    // this will be called when the injection context is inspected
View Full Code Here

    if (controllerAction instanceof Injectable)
    {

      // set action class injection handlers
      InjectionAnnotationReader injectionAnnotationReader = new InjectionAnnotationReader();
      injectionAnnotationReader.readAnnotations(actionBeanClass);

      // tell controller action about action class injection handlers
      injectionAnnotationReader.populateController((Injectable) controllerAction);

    }
   
    if (controllerAction instanceof InterceptorAware)
    {
View Full Code Here

TOP

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

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.