Package org.strecks.source

Examples of org.strecks.source.DefaultActionBeanSource


  public ActionBeanSource readBeanSource(Class actionClass, Annotation annotation)
  {
    Assert.notNull(actionClass);
    Assert.notNull(annotation);
    return new DefaultActionBeanSource(actionClass);
  }
View Full Code Here


  @Test
  public void testNewActionBean()
  {

    BaseControllerAction action = new SimpleControllerAction();
    action.setBeanSource(new DefaultActionBeanSource(TestAction.class));
    Object newActionBean = action.getBeanSource().createBean(null);
    assert newActionBean instanceof TestAction;

  }
View Full Code Here

  public void testDuffNewActionBean()
  {
    try
    {
      BaseControllerAction action = new SimpleControllerAction();
      action.setBeanSource(new DefaultActionBeanSource(AbstractList.class));

      action.getBeanSource().createBean(null);
      fail("Should have caught UnrecoverableRuntimeException");
    }
    catch (ApplicationRuntimeException e)
View Full Code Here

    replay(servlet);

    SimpleControllerAction action = new SimpleControllerAction();
    action.setServlet(servlet);

    action.setBeanSource(new DefaultActionBeanSource(TestAction.class));
    action.executeController(new TestAction(), actionContext);
    action.executeController(new TestAction(), actionContext);

    Assert.assertEquals(action.getCallCount(), 2);
View Full Code Here

  @Test
  public void testNewActionBean()
  {

    BaseControllerAction action = new SimpleControllerAction();
    action.setBeanSource(new DefaultActionBeanSource(TestAction.class));
    Object newActionBean = action.getBeanSource().createBean(null);
    assert newActionBean instanceof TestAction;

  }
View Full Code Here

  public void testDuffNewActionBean()
  {
    try
    {
      BaseControllerAction action = new SimpleControllerAction();
      action.setBeanSource(new DefaultActionBeanSource(AbstractList.class));

      action.getBeanSource().createBean(null);
      fail("Should have caught UnrecoverableRuntimeException");
    }
    catch (ApplicationRuntimeException e)
View Full Code Here

    replay(servlet);

    SimpleControllerAction action = new SimpleControllerAction();
    action.setServlet(servlet);

    action.setBeanSource(new DefaultActionBeanSource(TestAction.class));
    action.executeController(new TestAction(), actionContext);
    action.executeController(new TestAction(), actionContext);

    Assert.assertEquals(action.getCallCount(), 2);
View Full Code Here

    {

      BeanSourceAware bsa = (BeanSourceAware) controllerAction;

      // set the name of the actionBean to be instantiated
      bsa.setBeanSource(new DefaultActionBeanSource(actionBeanClass));

      // set action class injection handlers
      BeanSourceAnnotationReader sourceAnnotationReader = new BeanSourceAnnotationReader();
      sourceAnnotationReader.readAnnotations(actionBeanClass);
View Full Code Here

TOP

Related Classes of org.strecks.source.DefaultActionBeanSource

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.