Browse Source

Polishing

pull/1257/head
Juergen Hoeller 9 years ago
parent
commit
77e00f1926
  1. 4
      spring-context/src/main/java/org/springframework/context/support/LiveBeansView.java
  2. 9
      spring-context/src/test/java/org/springframework/beans/factory/xml/support/CustomNamespaceHandlerTests.java

4
spring-context/src/main/java/org/springframework/context/support/LiveBeansView.java

@ -60,6 +60,7 @@ public class LiveBeansView implements LiveBeansViewMBean, ApplicationContextAwar @@ -60,6 +60,7 @@ public class LiveBeansView implements LiveBeansViewMBean, ApplicationContextAwar
private static String applicationName;
static void registerApplicationContext(ConfigurableApplicationContext applicationContext) {
String mbeanDomain = applicationContext.getEnvironment().getProperty(MBEAN_DOMAIN_PROPERTY_NAME);
if (mbeanDomain != null) {
@ -90,7 +91,8 @@ public class LiveBeansView implements LiveBeansViewMBean, ApplicationContextAwar @@ -90,7 +91,8 @@ public class LiveBeansView implements LiveBeansViewMBean, ApplicationContextAwar
}
catch (Throwable ex) {
throw new ApplicationContextException("Failed to unregister LiveBeansView MBean", ex);
} finally {
}
finally {
applicationName = null;
}
}

9
spring-context/src/test/java/org/springframework/beans/factory/xml/support/CustomNamespaceHandlerTests.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2013 the original author or authors.
* Copyright 2002-2016 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.
@ -115,7 +115,7 @@ public class CustomNamespaceHandlerTests { @@ -115,7 +115,7 @@ public class CustomNamespaceHandlerTests {
assertTrue(AopUtils.isAopProxy(bean));
Advisor[] advisors = ((Advised) bean).getAdvisors();
assertEquals("Incorrect number of advisors", 1, advisors.length);
assertEquals("Incorrect advice class.", DebugInterceptor.class, advisors[0].getAdvice().getClass());
assertEquals("Incorrect advice class", DebugInterceptor.class, advisors[0].getAdvice().getClass());
}
@Test
@ -139,8 +139,8 @@ public class CustomNamespaceHandlerTests { @@ -139,8 +139,8 @@ public class CustomNamespaceHandlerTests {
assertTrue(AopUtils.isAopProxy(bean));
Advisor[] advisors = ((Advised) bean).getAdvisors();
assertEquals("Incorrect number of advisors", 2, advisors.length);
assertEquals("Incorrect advice class.", DebugInterceptor.class, advisors[0].getAdvice().getClass());
assertEquals("Incorrect advice class.", NopInterceptor.class, advisors[1].getAdvice().getClass());
assertEquals("Incorrect advice class", DebugInterceptor.class, advisors[0].getAdvice().getClass());
assertEquals("Incorrect advice class", NopInterceptor.class, advisors[1].getAdvice().getClass());
}
@Test
@ -235,7 +235,6 @@ final class TestNamespaceHandler extends NamespaceHandlerSupport { @@ -235,7 +235,6 @@ final class TestNamespaceHandler extends NamespaceHandlerSupport {
definition.setPropertyValues(mpvs);
parserContext.getRegistry().registerBeanDefinition(element.getAttribute("id"), definition);
return null;
}
}

Loading…
Cancel
Save