Package org.strecks.injection.internal

Examples of org.strecks.injection.internal.InjectionAnnotationReader


{

  @Test
  public void testSimple()
  {
    InjectionAnnotationReader c = new InjectionAnnotationReader();
    ActionWithActionForm action = new ActionWithActionForm();

    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);
View Full Code Here


 
 
  @Test
  public void testDelegating()
  {
    InjectionAnnotationReader c = new InjectionAnnotationReader();
    ActionWithActionForm action = new ActionWithActionForm();

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

    InjectionWrapper inputWrapper = injectionHandlers.get("actionForm");
View Full Code Here

  public void testReadAnnotations()
  {

    try
    {
      InjectionAnnotationReader c = new InjectionAnnotationReader();
      c.readAnnotations(ActionWithInvalidConverter.class);
    }
    catch (ApplicationConfigurationException e)
    {
      Assert.assertEquals(e.getMessage(),
          "@InjectRequestParameter in org.strecks.injection.handler.impl.ActionWithInvalidConverter "
View Full Code Here

  @BeforeMethod
  public void beforeTest()
  {

    reader = new InjectionAnnotationReader();
    context = createStrictMock(ServletContext.class);
    request = createStrictMock(HttpServletRequest.class);
    moduleConfig = createStrictMock(ModuleConfig.class);
    messageResources = createStrictMock(MessageResources.class);
    locale = Locale.getDefault();
View Full Code Here

  @BeforeMethod
  public void beforeTest()
  {

    reader = new InjectionAnnotationReader();
    context = createStrictMock(ServletContext.class);
    request = createStrictMock(HttpServletRequest.class);
    moduleConfig = createStrictMock(ModuleConfig.class);
    messageResources = createStrictMock(MessageResources.class);
View Full Code Here

{

  @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);
View Full Code Here

{

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

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

    HttpServletRequest request = createMock(HttpServletRequest.class);

    replay(request);
View Full Code Here

  @BeforeMethod
  public void beforeTest()
  {

    InjectionAnnotationReader c = new InjectionAnnotationReader();
    action = new SpringBeanAction();
    c.readAnnotations(action.getClass());
    inputs = c.getInjectionMap();
    context = EasyMock.createMock(ServletContext.class);
    wac = EasyMock.createMock(WebApplicationContext.class);

  }
View Full Code Here

  public void testInvalidRequestConverter() throws Exception
  {

    try
    {
      InjectionAnnotationReader reader = new InjectionAnnotationReader();
      reader.readAnnotations(ActionWithInvalidRequestConverter.class);
    }
    catch (ApplicationConfigurationException e)
    {
      Assert.assertEquals(e.getMessage(),
          "@InjectRequestParameter in org.strecks.injection.factory.impl.ActionWithInvalidRequestConverter"
View Full Code Here

  @Test
  public void testRedirectParameter()
  {

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

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

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

    Map<String, Object> map = new HashMap<String, Object>();
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.