Package org.strecks.lifecycle.impl

Examples of org.strecks.lifecycle.impl.ActionWithLifecycleMethods


 
  @Test
  public void testInitMethod() throws Exception
  {
    LifecycleMethodReader c = new LifecycleMethodReader();
    ActionWithLifecycleMethods actionBean = new ActionWithLifecycleMethods();
    c.readAnnotations(actionBean.getClass());
    final Method initMethod = c.getInitMethod();

    SimpleControllerAction action = new SimpleControllerAction();
    action.setInitMethod(initMethod);

    action.doInitMethod(actionBean);

    // prove that the value has been injected
    Assert.assertEquals(actionBean.getInitCount(), 1);
  }
View Full Code Here


  }
 
  @Test
  public void testNoLifecycleMethod() throws Exception
  {
    ActionWithLifecycleMethods actionBean = new ActionWithLifecycleMethods();
    SimpleControllerAction action = new SimpleControllerAction();
    action.doInitMethod(actionBean);
    Assert.assertEquals(actionBean.getInitCount(), 0);
    Assert.assertEquals(actionBean.getCloseCount(), 0);
  }
View Full Code Here

 
  @Test
  public void testCloseMethod() throws Exception
  {
    LifecycleMethodReader c = new LifecycleMethodReader();
    ActionWithLifecycleMethods actionBean = new ActionWithLifecycleMethods();
    c.readAnnotations(actionBean.getClass());
    final Method closeMethod = c.getCloseMethod();

    SimpleControllerAction action = new SimpleControllerAction();
    action.setCloseMethod(closeMethod);

    action.doCloseMethod(actionBean);

    // prove that the value has been injected
    Assert.assertEquals(actionBean.getCloseCount(), 1);
  }
View Full Code Here

TOP

Related Classes of org.strecks.lifecycle.impl.ActionWithLifecycleMethods

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.