Package org.strecks.injection.handler

Examples of org.strecks.injection.handler.RequestParameterInjectionHandler


          + " whose conversion source type is " + sourceType.getName() + ", and not "
          + String.class.getName());
     
    }

    InjectionHandler handler = new RequestParameterInjectionHandler(parameterName, converter, required);
    return handler;

  }
View Full Code Here


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

    Assert.assertEquals(inputs.size(), 10);

    InjectionWrapper wrapper = inputs.get("integerInput");
    RequestParameterInjectionHandler handler = (RequestParameterInjectionHandler) wrapper.getInjectionHandlers()
        .get(0);

    InjectionSetter info = wrapper.getInjectionSetter();
    Assert.assertEquals("setIntegerInput", info.getMethodName());
    Assert.assertEquals("integerInput", info.getPropertyName());
    Assert.assertEquals(Integer.class, info.getType());
    Assert.assertEquals("integerInput", handler.getParameterName());
    Assert.assertEquals(StandardBeanUtilsConverter.class, handler.getConverter().getClass());

    wrapper = inputs.get("longInput");
    handler = (RequestParameterInjectionHandler) wrapper.getInjectionHandlers().get(0);

    info = wrapper.getInjectionSetter();
    Assert.assertEquals("setLongInput", info.getMethodName());
    Assert.assertEquals("longInput", info.getPropertyName());
    Assert.assertEquals(Long.class, info.getType());
    Assert.assertEquals("longInput", handler.getParameterName());
    Assert.assertEquals(StandardBeanUtilsConverter.class, handler.getConverter().getClass());

    wrapper = inputs.get("convertedLongInput");
    handler = (RequestParameterInjectionHandler) wrapper.getInjectionHandlers().get(0);

    info = wrapper.getInjectionSetter();
    Assert.assertEquals("setConvertedLongInput", info.getMethodName());
    Assert.assertEquals("convertedLongInput", info.getPropertyName());
    Assert.assertEquals(String.class, info.getType());
    Assert.assertEquals("converted_long", handler.getParameterName());
    Assert.assertEquals(StringConverter.class, handler.getConverter().getClass());

  }
View Full Code Here

TOP

Related Classes of org.strecks.injection.handler.RequestParameterInjectionHandler

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.