INT-1449: tweak test case

This commit is contained in:
Dave Syer
2010-10-06 07:27:55 -07:00
parent cbf0242bd9
commit 1d44c8af2c
2 changed files with 8 additions and 3 deletions

View File

@@ -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>

View File

@@ -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();
}