Polishing

(cherry picked from commit d2ef6dc)
This commit is contained in:
Juergen Hoeller
2014-09-03 13:49:37 +02:00
parent 5da8a16284
commit d18bdf6448
6 changed files with 78 additions and 84 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2013 the original author or authors.
* Copyright 2002-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -101,6 +101,7 @@ public class ConfigurationClassPostConstructAndAutowiringTests {
@Configuration
static class Config2 {
TestBean testBean;
@Autowired

View File

@@ -46,7 +46,6 @@ public class ImportBeanDefinitionRegistrarTests {
@Test
public void shouldInvokeAwareMethodsInImportBeanDefinitionRegistrar() {
AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(Config.class);
context.getBean(MessageSource.class);
@@ -55,19 +54,20 @@ public class ImportBeanDefinitionRegistrarTests {
assertThat(SampleRegistrar.resourceLoader, is(notNullValue()));
}
@Sample
@Configuration
static class Config {
}
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@Import(SampleRegistrar.class)
public static @interface Sample {
}
static class SampleRegistrar implements ImportBeanDefinitionRegistrar, BeanClassLoaderAware, ResourceLoaderAware,
BeanFactoryAware {
@@ -94,4 +94,5 @@ public class ImportBeanDefinitionRegistrarTests {
public void registerBeanDefinitions(AnnotationMetadata importingClassMetadata, BeanDefinitionRegistry registry) {
}
}
}