|
|
|
|
@ -1,5 +1,5 @@
@@ -1,5 +1,5 @@
|
|
|
|
|
/* |
|
|
|
|
* Copyright 2002-2016 the original author or authors. |
|
|
|
|
* Copyright 2002-2019 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. |
|
|
|
|
@ -24,7 +24,6 @@ import org.junit.Rule;
@@ -24,7 +24,6 @@ import org.junit.Rule;
|
|
|
|
|
import org.junit.Test; |
|
|
|
|
import org.junit.rules.ExpectedException; |
|
|
|
|
|
|
|
|
|
import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer; |
|
|
|
|
import org.springframework.context.annotation.AnnotationConfigApplicationContext; |
|
|
|
|
import org.springframework.context.annotation.Bean; |
|
|
|
|
import org.springframework.context.annotation.ComponentScan; |
|
|
|
|
@ -58,6 +57,7 @@ public class EnableMBeanExportConfigurationTests {
@@ -58,6 +57,7 @@ public class EnableMBeanExportConfigurationTests {
|
|
|
|
|
|
|
|
|
|
private AnnotationConfigApplicationContext ctx; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@After |
|
|
|
|
public void closeContext() { |
|
|
|
|
if (this.ctx != null) { |
|
|
|
|
@ -65,6 +65,7 @@ public class EnableMBeanExportConfigurationTests {
@@ -65,6 +65,7 @@ public class EnableMBeanExportConfigurationTests {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
public void testLazyNaming() throws Exception { |
|
|
|
|
load(LazyNamingConfiguration.class); |
|
|
|
|
@ -159,7 +160,7 @@ public class EnableMBeanExportConfigurationTests {
@@ -159,7 +160,7 @@ public class EnableMBeanExportConfigurationTests {
|
|
|
|
|
static class LazyNamingConfiguration { |
|
|
|
|
|
|
|
|
|
@Bean |
|
|
|
|
public MBeanServerFactoryBean server() throws Exception { |
|
|
|
|
public MBeanServerFactoryBean server() { |
|
|
|
|
return new MBeanServerFactoryBean(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -178,7 +179,7 @@ public class EnableMBeanExportConfigurationTests {
@@ -178,7 +179,7 @@ public class EnableMBeanExportConfigurationTests {
|
|
|
|
|
static class ProxyConfiguration { |
|
|
|
|
|
|
|
|
|
@Bean |
|
|
|
|
public MBeanServerFactoryBean server() throws Exception { |
|
|
|
|
public MBeanServerFactoryBean server() { |
|
|
|
|
return new MBeanServerFactoryBean(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -199,7 +200,7 @@ public class EnableMBeanExportConfigurationTests {
@@ -199,7 +200,7 @@ public class EnableMBeanExportConfigurationTests {
|
|
|
|
|
static class PlaceholderBasedConfiguration { |
|
|
|
|
|
|
|
|
|
@Bean |
|
|
|
|
public MBeanServerFactoryBean server() throws Exception { |
|
|
|
|
public MBeanServerFactoryBean server() { |
|
|
|
|
return new MBeanServerFactoryBean(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -219,12 +220,7 @@ public class EnableMBeanExportConfigurationTests {
@@ -219,12 +220,7 @@ public class EnableMBeanExportConfigurationTests {
|
|
|
|
|
static class LazyAssemblingConfiguration { |
|
|
|
|
|
|
|
|
|
@Bean |
|
|
|
|
public PropertyPlaceholderConfigurer ppc() { |
|
|
|
|
return new PropertyPlaceholderConfigurer(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Bean |
|
|
|
|
public MBeanServerFactoryBean server() throws Exception { |
|
|
|
|
public MBeanServerFactoryBean server() { |
|
|
|
|
return new MBeanServerFactoryBean(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -238,7 +234,7 @@ public class EnableMBeanExportConfigurationTests {
@@ -238,7 +234,7 @@ public class EnableMBeanExportConfigurationTests {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Bean("bean:name=testBean5") |
|
|
|
|
public AnnotationTestBeanFactory testBean5() throws Exception { |
|
|
|
|
public AnnotationTestBeanFactory testBean5() { |
|
|
|
|
return new AnnotationTestBeanFactory(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -265,12 +261,12 @@ public class EnableMBeanExportConfigurationTests {
@@ -265,12 +261,12 @@ public class EnableMBeanExportConfigurationTests {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Configuration |
|
|
|
|
@ComponentScan(excludeFilters = @ComponentScan.Filter(value=Configuration.class)) |
|
|
|
|
@ComponentScan(excludeFilters = @ComponentScan.Filter(Configuration.class)) |
|
|
|
|
@EnableMBeanExport(server = "server") |
|
|
|
|
static class ComponentScanConfiguration { |
|
|
|
|
|
|
|
|
|
@Bean |
|
|
|
|
public MBeanServerFactoryBean server() throws Exception { |
|
|
|
|
public MBeanServerFactoryBean server() { |
|
|
|
|
return new MBeanServerFactoryBean(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
@ -280,7 +276,7 @@ public class EnableMBeanExportConfigurationTests {
@@ -280,7 +276,7 @@ public class EnableMBeanExportConfigurationTests {
|
|
|
|
|
static class PackagePrivateConfiguration { |
|
|
|
|
|
|
|
|
|
@Bean |
|
|
|
|
public MBeanServerFactoryBean server() throws Exception { |
|
|
|
|
public MBeanServerFactoryBean server() { |
|
|
|
|
return new MBeanServerFactoryBean(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -312,7 +308,7 @@ public class EnableMBeanExportConfigurationTests {
@@ -312,7 +308,7 @@ public class EnableMBeanExportConfigurationTests {
|
|
|
|
|
static class PackagePrivateExtensionConfiguration { |
|
|
|
|
|
|
|
|
|
@Bean |
|
|
|
|
public MBeanServerFactoryBean server() throws Exception { |
|
|
|
|
public MBeanServerFactoryBean server() { |
|
|
|
|
return new MBeanServerFactoryBean(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -333,7 +329,7 @@ public class EnableMBeanExportConfigurationTests {
@@ -333,7 +329,7 @@ public class EnableMBeanExportConfigurationTests {
|
|
|
|
|
static class PackagePrivateInterfaceImplementationConfiguration { |
|
|
|
|
|
|
|
|
|
@Bean |
|
|
|
|
public MBeanServerFactoryBean server() throws Exception { |
|
|
|
|
public MBeanServerFactoryBean server() { |
|
|
|
|
return new MBeanServerFactoryBean(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -349,7 +345,6 @@ public class EnableMBeanExportConfigurationTests {
@@ -349,7 +345,6 @@ public class EnableMBeanExportConfigurationTests {
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public void foo() { |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|