CAMEL-7835 Fixed camel-spring-javaconfig test error
Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/96bc7570 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/96bc7570 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/96bc7570 Branch: refs/heads/master Commit: 96bc75700ac4cae85e6d313215eef554cabfc8ea Parents: 4f7bda3 Author: Willem Jiang <willem.ji...@gmail.com> Authored: Sun Sep 28 15:53:36 2014 +0800 Committer: Willem Jiang <willem.ji...@gmail.com> Committed: Sun Sep 28 16:31:52 2014 +0800 ---------------------------------------------------------------------- .../javaconfig/test/JavaConfigContextLoader.java | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/96bc7570/components/camel-spring-javaconfig/src/main/java/org/apache/camel/spring/javaconfig/test/JavaConfigContextLoader.java ---------------------------------------------------------------------- diff --git a/components/camel-spring-javaconfig/src/main/java/org/apache/camel/spring/javaconfig/test/JavaConfigContextLoader.java b/components/camel-spring-javaconfig/src/main/java/org/apache/camel/spring/javaconfig/test/JavaConfigContextLoader.java index 0e150f0..87006b2 100644 --- a/components/camel-spring-javaconfig/src/main/java/org/apache/camel/spring/javaconfig/test/JavaConfigContextLoader.java +++ b/components/camel-spring-javaconfig/src/main/java/org/apache/camel/spring/javaconfig/test/JavaConfigContextLoader.java @@ -126,20 +126,8 @@ public class JavaConfigContextLoader implements ContextLoader { } context.refresh(); - - // Have to create a child context that implements BeanDefinitionRegistry - // to pass to registerAnnotationConfigProcessors, since - // JavaConfigApplicationContext does not - final GenericApplicationContext gac = new GenericApplicationContext(context); - AnnotationConfigUtils.registerAnnotationConfigProcessors(gac); - // copy BeanPostProcessors to the child context - for (String bppName : context.getBeanFactory().getBeanNamesForType(BeanPostProcessor.class)) { - gac.registerBeanDefinition(bppName, context.getBeanFactory().getBeanDefinition(bppName)); - } - gac.refresh(); - gac.registerShutdownHook(); - - return gac; + + return context; } }