INT-1449: tweak test case
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
|
||||
<context:mbean-server id="mbs" />
|
||||
|
||||
<context:mbean-export server="mbs"/>
|
||||
<context:mbean-export server="mbs" default-domain="spring.application"/>
|
||||
|
||||
<int:channel id="testChannel" />
|
||||
|
||||
@@ -25,6 +25,6 @@
|
||||
|
||||
<int:logging-channel-adapter channel="testChannel"/>
|
||||
|
||||
<jmx:mbean-export server="mbs"/>
|
||||
<jmx:mbean-export id="integrationMbeanExporter" server="mbs"/>
|
||||
|
||||
</beans>
|
||||
|
||||
@@ -15,7 +15,10 @@ package org.springframework.integration.jmx.config;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
import javax.management.MBeanServer;
|
||||
import javax.management.ObjectName;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
@@ -37,10 +40,12 @@ public class PollingAdapterMBeanTests {
|
||||
private ApplicationContext context;
|
||||
|
||||
@Test
|
||||
public void testMBeanExporterExists() throws InterruptedException {
|
||||
public void testMBeanExporterExists() throws Exception {
|
||||
IntegrationMBeanExporter exporter = this.context.getBean(IntegrationMBeanExporter.class);
|
||||
MBeanServer server = this.context.getBean("mbs", MBeanServer.class);
|
||||
assertEquals(server, exporter.getServer());
|
||||
Set<ObjectName> names = server.queryNames(new ObjectName("spring.application:type=MessageSource,*"), null);
|
||||
assertEquals(1, names.size());
|
||||
exporter.destroy();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user