18
18
19
19
import org .junit .Before ;
20
20
import org .junit .Test ;
21
-
22
21
import org .springframework .aop .scope .ScopedObject ;
23
22
import org .springframework .aop .scope .ScopedProxyUtils ;
24
23
import org .springframework .beans .factory .FactoryBean ;
39
38
/**
40
39
* @author Chris Beams
41
40
* @author Juergen Hoeller
41
+ * @author Sam Brannen
42
42
*/
43
43
public class ConfigurationClassPostProcessorTests {
44
44
@@ -63,7 +63,7 @@ public void setUp() {
63
63
* working.
64
64
*/
65
65
@ Test
66
- public void testEnhancementIsPresentBecauseSingletonSemanticsAreRespected () {
66
+ public void enhancementIsPresentBecauseSingletonSemanticsAreRespected () {
67
67
beanFactory .registerBeanDefinition ("config" , new RootBeanDefinition (SingletonBeanConfig .class ));
68
68
ConfigurationClassPostProcessor pp = new ConfigurationClassPostProcessor ();
69
69
pp .postProcessBeanFactory (beanFactory );
@@ -77,7 +77,7 @@ public void testEnhancementIsPresentBecauseSingletonSemanticsAreRespected() {
77
77
* over ASM if a bean class is already loaded.
78
78
*/
79
79
@ Test
80
- public void testAlreadyLoadedConfigurationClasses () {
80
+ public void alreadyLoadedConfigurationClasses () {
81
81
beanFactory .registerBeanDefinition ("unloadedConfig" ,
82
82
new RootBeanDefinition (UnloadedConfig .class .getName (), null , null ));
83
83
beanFactory .registerBeanDefinition ("loadedConfig" , new RootBeanDefinition (LoadedConfig .class ));
@@ -92,7 +92,7 @@ public void testAlreadyLoadedConfigurationClasses() {
92
92
* correctly.
93
93
*/
94
94
@ Test
95
- public void testPostProcessorIntrospectsInheritedDefinitionsCorrectly () {
95
+ public void postProcessorIntrospectsInheritedDefinitionsCorrectly () {
96
96
beanFactory .registerBeanDefinition ("config" , new RootBeanDefinition (SingletonBeanConfig .class ));
97
97
beanFactory .registerBeanDefinition ("parent" , new RootBeanDefinition (TestBean .class ));
98
98
beanFactory .registerBeanDefinition ("child" , new ChildBeanDefinition ("parent" ));
@@ -104,7 +104,7 @@ public void testPostProcessorIntrospectsInheritedDefinitionsCorrectly() {
104
104
}
105
105
106
106
@ Test
107
- public void testPostProcessorOverridesNonApplicationBeanDefinitions () {
107
+ public void postProcessorOverridesNonApplicationBeanDefinitions () {
108
108
RootBeanDefinition rbd = new RootBeanDefinition (TestBean .class );
109
109
rbd .setRole (RootBeanDefinition .ROLE_SUPPORT );
110
110
beanFactory .registerBeanDefinition ("bar" , rbd );
@@ -117,7 +117,7 @@ public void testPostProcessorOverridesNonApplicationBeanDefinitions() {
117
117
}
118
118
119
119
@ Test
120
- public void testPostProcessorDoesNotOverrideRegularBeanDefinitions () {
120
+ public void postProcessorDoesNotOverrideRegularBeanDefinitions () {
121
121
RootBeanDefinition rbd = new RootBeanDefinition (TestBean .class );
122
122
rbd .setResource (new DescriptiveResource ("XML or something" ));
123
123
beanFactory .registerBeanDefinition ("bar" , rbd );
@@ -129,7 +129,7 @@ public void testPostProcessorDoesNotOverrideRegularBeanDefinitions() {
129
129
}
130
130
131
131
@ Test
132
- public void testPostProcessorDoesNotOverrideRegularBeanDefinitionsEvenWithScopedProxy () {
132
+ public void postProcessorDoesNotOverrideRegularBeanDefinitionsEvenWithScopedProxy () {
133
133
RootBeanDefinition rbd = new RootBeanDefinition (TestBean .class );
134
134
rbd .setResource (new DescriptiveResource ("XML or something" ));
135
135
BeanDefinitionHolder proxied = ScopedProxyUtils .createScopedProxy (new BeanDefinitionHolder (rbd , "bar" ), beanFactory , true );
@@ -142,7 +142,7 @@ public void testPostProcessorDoesNotOverrideRegularBeanDefinitionsEvenWithScoped
142
142
}
143
143
144
144
@ Test
145
- public void testScopedProxyTargetMarkedAsNonAutowireCandidate () {
145
+ public void scopedProxyTargetMarkedAsNonAutowireCandidate () {
146
146
AutowiredAnnotationBeanPostProcessor bpp = new AutowiredAnnotationBeanPostProcessor ();
147
147
bpp .setBeanFactory (beanFactory );
148
148
beanFactory .addBeanPostProcessor (bpp );
@@ -157,7 +157,7 @@ public void testScopedProxyTargetMarkedAsNonAutowireCandidate() {
157
157
}
158
158
159
159
@ Test
160
- public void testProcessingAllowedOnlyOncePerProcessorRegistryPair () {
160
+ public void processingAllowedOnlyOncePerProcessorRegistryPair () {
161
161
DefaultListableBeanFactory bf1 = new DefaultListableBeanFactory ();
162
162
DefaultListableBeanFactory bf2 = new DefaultListableBeanFactory ();
163
163
ConfigurationClassPostProcessor pp = new ConfigurationClassPostProcessor ();
@@ -178,7 +178,7 @@ public void testProcessingAllowedOnlyOncePerProcessorRegistryPair() {
178
178
}
179
179
180
180
@ Test
181
- public void testGenericsBasedInjection () {
181
+ public void genericsBasedInjection () {
182
182
AutowiredAnnotationBeanPostProcessor bpp = new AutowiredAnnotationBeanPostProcessor ();
183
183
bpp .setBeanFactory (beanFactory );
184
184
beanFactory .addBeanPostProcessor (bpp );
@@ -195,7 +195,7 @@ public void testGenericsBasedInjection() {
195
195
}
196
196
197
197
@ Test
198
- public void testGenericsBasedInjectionWithScoped () {
198
+ public void genericsBasedInjectionWithScoped () {
199
199
AutowiredAnnotationBeanPostProcessor bpp = new AutowiredAnnotationBeanPostProcessor ();
200
200
bpp .setBeanFactory (beanFactory );
201
201
beanFactory .addBeanPostProcessor (bpp );
@@ -212,7 +212,7 @@ public void testGenericsBasedInjectionWithScoped() {
212
212
}
213
213
214
214
@ Test
215
- public void testGenericsBasedInjectionWithScopedProxy () {
215
+ public void genericsBasedInjectionWithScopedProxy () {
216
216
AutowiredAnnotationBeanPostProcessor bpp = new AutowiredAnnotationBeanPostProcessor ();
217
217
bpp .setBeanFactory (beanFactory );
218
218
beanFactory .addBeanPostProcessor (bpp );
@@ -230,7 +230,7 @@ public void testGenericsBasedInjectionWithScopedProxy() {
230
230
}
231
231
232
232
@ Test
233
- public void testGenericsBasedInjectionWithImplTypeAtInjectionPoint () {
233
+ public void genericsBasedInjectionWithImplTypeAtInjectionPoint () {
234
234
AutowiredAnnotationBeanPostProcessor bpp = new AutowiredAnnotationBeanPostProcessor ();
235
235
bpp .setBeanFactory (beanFactory );
236
236
beanFactory .addBeanPostProcessor (bpp );
@@ -247,7 +247,7 @@ public void testGenericsBasedInjectionWithImplTypeAtInjectionPoint() {
247
247
}
248
248
249
249
@ Test
250
- public void testGenericsBasedInjectionWithFactoryBean () {
250
+ public void genericsBasedInjectionWithFactoryBean () {
251
251
AutowiredAnnotationBeanPostProcessor bpp = new AutowiredAnnotationBeanPostProcessor ();
252
252
bpp .setBeanFactory (beanFactory );
253
253
beanFactory .addBeanPostProcessor (bpp );
@@ -266,7 +266,7 @@ public void testGenericsBasedInjectionWithFactoryBean() {
266
266
}
267
267
268
268
@ Test
269
- public void testGenericsBasedInjectionWithRawMatch () {
269
+ public void genericsBasedInjectionWithRawMatch () {
270
270
beanFactory .registerBeanDefinition ("configClass" , new RootBeanDefinition (RawMatchingConfiguration .class ));
271
271
ConfigurationClassPostProcessor pp = new ConfigurationClassPostProcessor ();
272
272
pp .postProcessBeanFactory (beanFactory );
@@ -275,7 +275,7 @@ public void testGenericsBasedInjectionWithRawMatch() {
275
275
}
276
276
277
277
@ Test
278
- public void testGenericsBasedInjectionWithWildcardMatch () {
278
+ public void genericsBasedInjectionWithWildcardMatch () {
279
279
beanFactory .registerBeanDefinition ("configClass" , new RootBeanDefinition (WildcardMatchingConfiguration .class ));
280
280
ConfigurationClassPostProcessor pp = new ConfigurationClassPostProcessor ();
281
281
pp .postProcessBeanFactory (beanFactory );
@@ -284,7 +284,7 @@ public void testGenericsBasedInjectionWithWildcardMatch() {
284
284
}
285
285
286
286
@ Test
287
- public void testGenericsBasedInjectionWithWildcardWithExtendsMatch () {
287
+ public void genericsBasedInjectionWithWildcardWithExtendsMatch () {
288
288
beanFactory .registerBeanDefinition ("configClass" , new RootBeanDefinition (WildcardWithExtendsConfiguration .class ));
289
289
ConfigurationClassPostProcessor pp = new ConfigurationClassPostProcessor ();
290
290
pp .postProcessBeanFactory (beanFactory );
@@ -293,7 +293,7 @@ public void testGenericsBasedInjectionWithWildcardWithExtendsMatch() {
293
293
}
294
294
295
295
@ Test
296
- public void testGenericsBasedInjectionWithWildcardWithGenericExtendsMatch () {
296
+ public void genericsBasedInjectionWithWildcardWithGenericExtendsMatch () {
297
297
beanFactory .registerBeanDefinition ("configClass" , new RootBeanDefinition (WildcardWithGenericExtendsConfiguration .class ));
298
298
ConfigurationClassPostProcessor pp = new ConfigurationClassPostProcessor ();
299
299
pp .postProcessBeanFactory (beanFactory );
@@ -460,6 +460,7 @@ public String toString() {
460
460
}
461
461
462
462
@ Bean @ Scope ("prototype" )
463
+ @ SuppressWarnings ("rawtypes" )
463
464
public Repository genericRepo () {
464
465
return new Repository <Object >() {
465
466
@ Override
@@ -542,6 +543,7 @@ public RepositoryFactoryBean<Object> repoFactoryBean() {
542
543
public static class RawMatchingConfiguration {
543
544
544
545
@ Bean
546
+ @ SuppressWarnings ("rawtypes" )
545
547
public Repository rawRepo () {
546
548
return new Repository ();
547
549
}
@@ -557,6 +559,7 @@ public Object repoConsumer(Repository<String> repo) {
557
559
public static class WildcardMatchingConfiguration {
558
560
559
561
@ Bean
562
+ @ SuppressWarnings ("rawtypes" )
560
563
public Repository <?> genericRepo () {
561
564
return new Repository ();
562
565
}
0 commit comments