diff --git a/org.springframework.integration/src/test/java/org/springframework/integration/config/xml/DefaultConfiguringBeanFactoryPostProcessorTests-context.xml b/org.springframework.integration/src/test/java/org/springframework/integration/config/xml/DefaultConfiguringBeanFactoryPostProcessorTests-context.xml new file mode 100644 index 0000000000..b25ccd7290 --- /dev/null +++ b/org.springframework.integration/src/test/java/org/springframework/integration/config/xml/DefaultConfiguringBeanFactoryPostProcessorTests-context.xml @@ -0,0 +1,13 @@ + + + + + + + diff --git a/org.springframework.integration/src/test/java/org/springframework/integration/config/xml/DefaultConfiguringBeanFactoryPostProcessorTests.java b/org.springframework.integration/src/test/java/org/springframework/integration/config/xml/DefaultConfiguringBeanFactoryPostProcessorTests.java new file mode 100644 index 0000000000..6a46f85516 --- /dev/null +++ b/org.springframework.integration/src/test/java/org/springframework/integration/config/xml/DefaultConfiguringBeanFactoryPostProcessorTests.java @@ -0,0 +1,64 @@ +/* + * Copyright 2002-2009 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.integration.config.xml; + +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.context.ApplicationContext; +import org.springframework.integration.channel.NullChannel; +import org.springframework.integration.channel.PublishSubscribeChannel; +import org.springframework.integration.context.IntegrationContextUtils; +import org.springframework.integration.core.MessageChannel; +import org.springframework.integration.scheduling.SimpleTaskScheduler; +import org.springframework.integration.scheduling.TaskScheduler; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; + +/** + * @author Mark Fisher + */ +@RunWith(SpringJUnit4ClassRunner.class) +@ContextConfiguration +public class DefaultConfiguringBeanFactoryPostProcessorTests { + + @Autowired + private ApplicationContext context; + + + @Test + public void errorChannelRegistered() { + MessageChannel errorChannel = (MessageChannel) context.getBean(IntegrationContextUtils.ERROR_CHANNEL_BEAN_NAME); + assertEquals(PublishSubscribeChannel.class, errorChannel.getClass()); + } + + @Test + public void nullChannelRegistered() { + MessageChannel nullChannel = (MessageChannel) context.getBean(IntegrationContextUtils.NULL_CHANNEL_BEAN_NAME); + assertEquals(NullChannel.class, nullChannel.getClass()); + } + + @Test + public void taskSchedulerRegistered() { + TaskScheduler taskScheduler = (TaskScheduler) context.getBean(IntegrationContextUtils.TASK_SCHEDULER_BEAN_NAME); + assertEquals(SimpleTaskScheduler.class, taskScheduler.getClass()); + } + +}