Package org.apache.wicket.spring

Examples of org.apache.wicket.spring.SpringBeanLocator.locateProxyTarget()


    ctx.putBean("bean", bean);

    SpringBeanLocator locator = (SpringBeanLocator)Objects.cloneObject(new SpringBeanLocator(
        Bean.class, ctxLocator));

    assertNotNull(locator.locateProxyTarget());
  }

  /**
   * tests error if bean with class is not in the context
   */
 
View Full Code Here


  public void testLookupByClassNotFound()
  {
    SpringBeanLocator locator = new SpringBeanLocator(Bean.class, ctxLocator);
    try
    {
      locator.locateProxyTarget();
      fail();
    }
    catch (IllegalStateException e)
    {
      // noop
View Full Code Here

    ctx.putBean("somebean2", bean);

    SpringBeanLocator locator = new SpringBeanLocator(Bean.class, ctxLocator);
    try
    {
      locator.locateProxyTarget();
      fail();
    }
    catch (IllegalStateException e)
    {
      // noop
View Full Code Here

  {
    Bean bean = new Bean();
    ctx.putBean("bean", bean);

    SpringBeanLocator locator = new SpringBeanLocator("bean", Bean.class, ctxLocator);
    assertTrue(locator.locateProxyTarget() == bean);

  }

  /**
   * tests lookup by name after locator has been deserialized
View Full Code Here

    ctx.putBean("bean", bean);

    SpringBeanLocator locator = (SpringBeanLocator)Objects.cloneObject(new SpringBeanLocator(
        "bean", Bean.class, ctxLocator));

    assertNotNull(locator.locateProxyTarget());
  }

  /**
   * tests error if no bean with name found
   */
 
View Full Code Here

  public void testLookupByNameNotFound()
  {
    SpringBeanLocator locator = new SpringBeanLocator("bean", Bean.class, ctxLocator);
    try
    {
      locator.locateProxyTarget();
      fail();
    }
    catch (IllegalStateException e)
    {
      // noop
View Full Code Here

  {
    SpringContextLocatorMock ctxLocator = new SpringContextLocatorMock(null);
    SpringBeanLocator locator = new SpringBeanLocator(Bean.class, ctxLocator);
    try
    {
      locator.locateProxyTarget();
    }
    catch (IllegalStateException e)
    {
      // noop
    }
View Full Code Here

      {
        target = LazyInitProxyFactory.createProxy(field.getType(), locator);
      }
      else
      {
        target = locator.locateProxyTarget();
      }

      // only put the proxy into the cache if the bean is a singleton
      if (locator.isSingletonBean())
      {
View Full Code Here

      {
        target = LazyInitProxyFactory.createProxy(field.getType(), locator);
      }
      else
      {
        target = locator.locateProxyTarget();
      }

      // only put the proxy into the cache if the bean is a singleton
      if (locator.isSingletonBean())
      {
View Full Code Here

      {
        target = LazyInitProxyFactory.createProxy(field.getType(), locator);
      }
      else
      {
        target = locator.locateProxyTarget();
      }

      // only put the proxy into the cache if the bean is a singleton
      if (locator.isSingletonBean())
      {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.