@Test public void testOnlyTargetClassIsExposed() throws Exception { load(ProxyConfiguration.class); validateAnnotationTestBean(); }
@Test public void testLazyAssembling() throws Exception { System.setProperty("domain", "bean"); load(LazyAssemblingConfiguration.class); try { MBeanServer server = (MBeanServer) this.ctx.getBean("server"); validateMBeanAttribute(server, "bean:name=testBean4", "TEST"); validateMBeanAttribute(server, "bean:name=testBean5", "FACTORY"); validateMBeanAttribute(server, "spring:mbean=true", "Rob Harrop"); validateMBeanAttribute(server, "spring:mbean=another", "Juergen Hoeller"); } finally { System.clearProperty("domain"); } }
private void validateAnnotationTestBean() throws Exception { MBeanServer server = (MBeanServer) this.ctx.getBean("server"); validateMBeanAttribute(server,"bean:name=testBean4", "TEST"); }
@Test public void testPlaceholderBased() throws Exception { MockEnvironment env = new MockEnvironment(); env.setProperty("serverName", "server"); AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(); context.setEnvironment(env); context.register(PlaceholderBasedConfiguration.class); context.refresh(); this.ctx = context; validateAnnotationTestBean(); }
@Test public void testLazyNaming() throws Exception { load(LazyNamingConfiguration.class); validateAnnotationTestBean(); }
@Test public void testComponentScan() throws Exception { load(ComponentScanConfiguration.class); MBeanServer server = (MBeanServer) this.ctx.getBean("server"); validateMBeanAttribute(server, "bean:name=testBean4", null); }
@Test public void testPackagePrivateClassExtensionCanBeExposed() throws Exception { load(PackagePrivateExtensionConfiguration.class); validateAnnotationTestBean(); }