139140141142143144145146147148149
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 */
150151152153154155156157158159160
public void testLookupByNameNotFound() { SpringBeanLocator locator = new SpringBeanLocator("bean", Bean.class, ctxLocator); try { locator.locateProxyTarget(); fail(); } catch (IllegalStateException e) { // noop
194195196197198199200201202203204
{ SpringContextLocatorMock ctxLocator = new SpringContextLocatorMock(null); SpringBeanLocator locator = new SpringBeanLocator(Bean.class, ctxLocator); try { locator.locateProxyTarget(); } catch (IllegalStateException e) { // noop }
130131132133134135136137138139140
{ 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()) {
132133134135136137138139140141142
124125126127128129130131132133134
129130131132133134135136137138139
131132133134135136137138139140141