|
|
|
@ -1,5 +1,5 @@ |
|
|
|
/* |
|
|
|
/* |
|
|
|
* Copyright 2002-2014 the original author or authors. |
|
|
|
* Copyright 2002-2016 the original author or authors. |
|
|
|
* |
|
|
|
* |
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
|
|
* you may not use this file except in compliance with the License. |
|
|
|
* you may not use this file except in compliance with the License. |
|
|
|
@ -742,6 +742,15 @@ public class InjectAnnotationBeanPostProcessorTests { |
|
|
|
bf.destroySingletons(); |
|
|
|
bf.destroySingletons(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
|
|
|
public void testAnnotatedDefaultConstructor() { |
|
|
|
|
|
|
|
DefaultListableBeanFactory bf = new DefaultListableBeanFactory(); |
|
|
|
|
|
|
|
bf.addBeanPostProcessor(new AutowiredAnnotationBeanPostProcessor()); |
|
|
|
|
|
|
|
bf.registerBeanDefinition("annotatedBean", new RootBeanDefinition(AnnotatedDefaultConstructorBean.class)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assertNotNull(bf.getBean("annotatedBean")); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static class ResourceInjectionBean { |
|
|
|
public static class ResourceInjectionBean { |
|
|
|
|
|
|
|
|
|
|
|
@ -750,7 +759,6 @@ public class InjectAnnotationBeanPostProcessorTests { |
|
|
|
|
|
|
|
|
|
|
|
private TestBean testBean2; |
|
|
|
private TestBean testBean2; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Inject |
|
|
|
@Inject |
|
|
|
public void setTestBean2(TestBean testBean2) { |
|
|
|
public void setTestBean2(TestBean testBean2) { |
|
|
|
if (this.testBean2 != null) { |
|
|
|
if (this.testBean2 != null) { |
|
|
|
@ -819,7 +827,6 @@ public class InjectAnnotationBeanPostProcessorTests { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static class TypedExtendedResourceInjectionBean extends ExtendedResourceInjectionBean<NestedTestBean> { |
|
|
|
public static class TypedExtendedResourceInjectionBean extends ExtendedResourceInjectionBean<NestedTestBean> { |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -1087,7 +1094,6 @@ public class InjectAnnotationBeanPostProcessorTests { |
|
|
|
@Inject |
|
|
|
@Inject |
|
|
|
private Map<String, TestBean> testBeanMap; |
|
|
|
private Map<String, TestBean> testBeanMap; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public Map<String, TestBean> getTestBeanMap() { |
|
|
|
public Map<String, TestBean> getTestBeanMap() { |
|
|
|
return this.testBeanMap; |
|
|
|
return this.testBeanMap; |
|
|
|
} |
|
|
|
} |
|
|
|
@ -1346,4 +1352,12 @@ public class InjectAnnotationBeanPostProcessorTests { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static class AnnotatedDefaultConstructorBean { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Inject |
|
|
|
|
|
|
|
public AnnotatedDefaultConstructorBean() { |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|