@Test
public void testTestWithLazyConnection() throws Exception {
Assume.group(TestGroup.JMXMP);
MBeanServerConnectionFactoryBean bean = new MBeanServerConnectionFactoryBean();
bean.setServiceUrl(serviceUrl);
bean.setConnectOnStartup(false);
bean.afterPropertiesSet();
MBeanServerConnection connection = bean.getObject();
assertTrue(AopUtils.isAopProxy(connection));
JMXConnectorServer connector = null;
try {
connector = getConnectorServer();
connector.start();
assertEquals("Incorrect MBean count", getServer().getMBeanCount(), connection.getMBeanCount());
} finally {
bean.destroy();
if (connector != null) {
connector.stop();
}
}
}
MBeanServerConnectionFactoryBeanTests.java 文件源码
java
阅读 27
收藏 0
点赞 0
评论 0
项目:spring4-understanding
作者:
评论列表
文章目录