INT-1265: fix tests in suite
This commit is contained in:
@@ -1,10 +1,19 @@
|
||||
package org.springframework.integration;
|
||||
|
||||
import org.junit.Ignore;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.Suite;
|
||||
import org.junit.runners.Suite.SuiteClasses;
|
||||
import org.springframework.integration.control.ControlBusTests;
|
||||
import org.springframework.integration.control.ControlBusXmlTests;
|
||||
import org.springframework.integration.jmx.AttributePollingMessageSourceTests;
|
||||
import org.springframework.integration.jmx.NotificationListeningMessageProducerTests;
|
||||
import org.springframework.integration.jmx.OperationInvokingMessageHandlerTests;
|
||||
import org.springframework.integration.jmx.config.NotificationListeningChannelAdapterParserTests;
|
||||
import org.springframework.integration.jmx.config.OperationInvokingChannelAdapterParserTests;
|
||||
import org.springframework.integration.jmx.config.OperationInvokingOutboundGatewayTests;
|
||||
import org.springframework.integration.monitor.ExponentialMovingAverageCumulativeHistoryTests;
|
||||
import org.springframework.integration.monitor.ExponentialMovingAverageRatioCumulativeHistoryTests;
|
||||
import org.springframework.integration.monitor.HandlerMonitoringIntegrationTests;
|
||||
import org.springframework.integration.monitor.MessageChannelsMonitorIntegrationTests;
|
||||
|
||||
/*
|
||||
@@ -30,8 +39,13 @@ import org.springframework.integration.monitor.MessageChannelsMonitorIntegration
|
||||
*
|
||||
*/
|
||||
@RunWith(Suite.class)
|
||||
@SuiteClasses(value = { ControlBusXmlTests.class, MessageChannelsMonitorIntegrationTests.class })
|
||||
@Ignore
|
||||
@SuiteClasses(value = { OperationInvokingMessageHandlerTests.class,
|
||||
ExponentialMovingAverageCumulativeHistoryTests.class, OperationInvokingChannelAdapterParserTests.class,
|
||||
HandlerMonitoringIntegrationTests.class, NotificationListeningMessageProducerTests.class,
|
||||
OperationInvokingOutboundGatewayTests.class, NotificationListeningChannelAdapterParserTests.class,
|
||||
ControlBusXmlTests.class, ExponentialMovingAverageRatioCumulativeHistoryTests.class,
|
||||
AttributePollingMessageSourceTests.class, ControlBusTests.class, MessageChannelsMonitorIntegrationTests.class })
|
||||
// @Ignore
|
||||
public class IgnoredTestSuite {
|
||||
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ package org.springframework.integration.control;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Test;
|
||||
import org.springframework.beans.factory.config.BeanDefinition;
|
||||
import org.springframework.beans.factory.config.RuntimeBeanReference;
|
||||
@@ -40,11 +41,12 @@ import org.springframework.jmx.support.MBeanServerFactoryBean;
|
||||
public class ControlBusOperationChannelTests {
|
||||
|
||||
private final String domain = "domain.test";
|
||||
private GenericApplicationContext context;
|
||||
|
||||
|
||||
@Test
|
||||
public void replyProducingOperation() throws Exception {
|
||||
GenericApplicationContext context = new GenericApplicationContext();
|
||||
context = new GenericApplicationContext();
|
||||
RootBeanDefinition endpointDef = new RootBeanDefinition(EventDrivenConsumer.class);
|
||||
endpointDef.getConstructorArgumentValues().addGenericArgumentValue(new DirectChannel());
|
||||
endpointDef.getConstructorArgumentValues().addGenericArgumentValue(new RootBeanDefinition(TestHandler.class));
|
||||
@@ -66,6 +68,11 @@ public class ControlBusOperationChannelTests {
|
||||
assertFalse("endpoint should have been stopped", endpoint.isRunning());
|
||||
controlBus.getOperationChannel().send(startMessage);
|
||||
assertTrue("endpoint should be running after being restarted", endpoint.isRunning());
|
||||
close();
|
||||
}
|
||||
|
||||
@After
|
||||
public void close() {
|
||||
context.close();
|
||||
}
|
||||
|
||||
|
||||
@@ -16,9 +16,7 @@
|
||||
<int:bridge input-channel="testDirectChannel" />
|
||||
|
||||
<int:bridge id="testPollingBridge" input-channel="testQueueChannel" output-channel="nullChannel">
|
||||
<int:poller max-messages-per-poll="1">
|
||||
<int:interval-trigger interval="10000" />
|
||||
</int:poller>
|
||||
<int:poller max-messages-per-poll="1" fixed-rate="10000" />
|
||||
</int:bridge>
|
||||
|
||||
<bean id="controlBus" class="org.springframework.integration.control.ControlBus">
|
||||
@@ -28,6 +26,7 @@
|
||||
|
||||
<bean id="mbeanExporter" class="org.springframework.integration.monitor.IntegrationMBeanExporter">
|
||||
<property name="server" ref="mbeanServer" />
|
||||
<property name="domain" value="control.bus.xml.test" />
|
||||
</bean>
|
||||
|
||||
<bean id="mbeanServer" class="org.springframework.jmx.support.MBeanServerFactoryBean">
|
||||
|
||||
@@ -30,7 +30,6 @@ import org.springframework.integration.monitor.LifecycleMessageHandlerMonitor;
|
||||
import org.springframework.integration.monitor.QueueChannelMonitor;
|
||||
import org.springframework.integration.monitor.SimpleMessageChannelMonitor;
|
||||
import org.springframework.jmx.support.ObjectNameManager;
|
||||
import org.springframework.test.annotation.DirtiesContext;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
|
||||
@@ -41,7 +40,7 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
public class ControlBusXmlTests {
|
||||
|
||||
private static final String DOMAIN = "spring.application";
|
||||
private static final String DOMAIN = "control.bus.xml.test";
|
||||
|
||||
|
||||
@Autowired
|
||||
@@ -78,8 +77,6 @@ public class ControlBusXmlTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
// Assume this one runs last and force MBeans to be unregistered to avoid clashes in later tests
|
||||
@DirtiesContext
|
||||
public void pollingConsumerRegistered() throws Exception {
|
||||
ObjectInstance instance = mbeanServer.getObjectInstance(
|
||||
ObjectNameManager.getInstance(DOMAIN + ":type=MessageHandler,name=testPollingBridge,bean=endpoint"));
|
||||
|
||||
@@ -22,7 +22,6 @@ import javax.management.MBeanServer;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import org.springframework.beans.DirectFieldAccessor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
|
||||
@@ -20,7 +20,6 @@ import static org.junit.Assert.assertEquals;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.integration.MessageChannel;
|
||||
|
||||
@@ -24,7 +24,6 @@ import javax.management.Notification;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.integration.Message;
|
||||
import org.springframework.integration.core.PollableChannel;
|
||||
|
||||
@@ -25,7 +25,6 @@ import javax.management.Notification;
|
||||
import org.junit.After;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.integration.Message;
|
||||
import org.springframework.integration.MessageChannel;
|
||||
|
||||
@@ -21,7 +21,6 @@ import static org.junit.Assert.assertEquals;
|
||||
import org.junit.After;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.integration.Message;
|
||||
import org.springframework.integration.MessageChannel;
|
||||
|
||||
@@ -23,7 +23,6 @@ import java.util.List;
|
||||
import org.junit.After;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.integration.MessageChannel;
|
||||
|
||||
@@ -13,8 +13,9 @@
|
||||
|
||||
<int:bridge id="bridge" input-channel="requests" output-channel="intermediate"/>
|
||||
|
||||
<bean id="integrationExecutions" class="org.springframework.integration.monitor.IntegrationMBeanExporter">
|
||||
<bean id="mbeanExporter" class="org.springframework.integration.monitor.IntegrationMBeanExporter">
|
||||
<property name="server" ref="mbeanServer" />
|
||||
<property name="domain" value="test.ChannelIntegrationTests"/>
|
||||
</bean>
|
||||
|
||||
<bean id="mbeanServer" class="org.springframework.jmx.support.MBeanServerFactoryBean">
|
||||
|
||||
@@ -21,7 +21,6 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.integration.MessageChannel;
|
||||
import org.springframework.integration.core.PollableChannel;
|
||||
import org.springframework.integration.message.GenericMessage;
|
||||
import org.springframework.test.annotation.DirtiesContext;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
|
||||
@@ -39,7 +38,6 @@ public class ChannelIntegrationTests {
|
||||
private IntegrationMBeanExporter messageChannelsMonitor;
|
||||
|
||||
@Test
|
||||
@DirtiesContext
|
||||
public void testMessageChannelStatistics() throws Exception {
|
||||
|
||||
requests.send(new GenericMessage<String>("foo"));
|
||||
|
||||
Reference in New Issue
Block a user