Search in sources :

Example 31 with SourcePollingChannelAdapter

use of org.springframework.integration.endpoint.SourcePollingChannelAdapter in project spring-integration by spring-projects.

the class FeedInboundChannelAdapterParserTests method testAutoChannel.

@Test
public void testAutoChannel() {
    ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("FeedInboundChannelAdapterParserTests-autoChannel-context.xml", this.getClass());
    MessageChannel autoChannel = context.getBean("autoChannel", MessageChannel.class);
    SourcePollingChannelAdapter adapter = context.getBean("autoChannel.adapter", SourcePollingChannelAdapter.class);
    assertSame(autoChannel, TestUtils.getPropertyValue(adapter, "outputChannel"));
    context.close();
}
Also used : MessageChannel(org.springframework.messaging.MessageChannel) ClassPathXmlApplicationContext(org.springframework.context.support.ClassPathXmlApplicationContext) SourcePollingChannelAdapter(org.springframework.integration.endpoint.SourcePollingChannelAdapter) Test(org.junit.Test)

Example 32 with SourcePollingChannelAdapter

use of org.springframework.integration.endpoint.SourcePollingChannelAdapter in project spring-integration by spring-projects.

the class FeedInboundChannelAdapterParserTests method validateSuccessfulFileConfigurationWithCustomMetadataStore.

@Test
public void validateSuccessfulFileConfigurationWithCustomMetadataStore() {
    ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("FeedInboundChannelAdapterParserTests-file-context.xml", this.getClass());
    SourcePollingChannelAdapter adapter = context.getBean("feedAdapter", SourcePollingChannelAdapter.class);
    FeedEntryMessageSource source = (FeedEntryMessageSource) TestUtils.getPropertyValue(adapter, "source");
    assertSame(context.getBean(MetadataStore.class), TestUtils.getPropertyValue(source, "metadataStore"));
    SyndFeedInput syndFeedInput = TestUtils.getPropertyValue(source, "syndFeedInput", SyndFeedInput.class);
    assertSame(context.getBean(SyndFeedInput.class), syndFeedInput);
    assertFalse(syndFeedInput.isPreserveWireFeed());
    context.close();
}
Also used : FeedEntryMessageSource(org.springframework.integration.feed.inbound.FeedEntryMessageSource) MetadataStore(org.springframework.integration.metadata.MetadataStore) ClassPathXmlApplicationContext(org.springframework.context.support.ClassPathXmlApplicationContext) SyndFeedInput(com.rometools.rome.io.SyndFeedInput) SourcePollingChannelAdapter(org.springframework.integration.endpoint.SourcePollingChannelAdapter) Test(org.junit.Test)

Example 33 with SourcePollingChannelAdapter

use of org.springframework.integration.endpoint.SourcePollingChannelAdapter in project spring-integration by spring-projects.

the class StoredProcPollingChannelAdapterParserTests method testAutoChannel.

@Test
public void testAutoChannel() throws Exception {
    setUp("storedProcPollingChannelAdapterParserTest.xml", getClass());
    MessageChannel autoChannel = context.getBean("autoChannel", MessageChannel.class);
    SourcePollingChannelAdapter autoChannelAdapter = context.getBean("autoChannel.adapter", SourcePollingChannelAdapter.class);
    assertSame(autoChannel, TestUtils.getPropertyValue(autoChannelAdapter, "outputChannel"));
    assertFalse(TestUtils.getPropertyValue(autoChannelAdapter, "source.executor.returnValueRequired", Boolean.class));
    assertFalse(TestUtils.getPropertyValue(autoChannelAdapter, "source.executor.isFunction", Boolean.class));
    autoChannelAdapter.stop();
}
Also used : MessageChannel(org.springframework.messaging.MessageChannel) SourcePollingChannelAdapter(org.springframework.integration.endpoint.SourcePollingChannelAdapter) Test(org.junit.Test)

Example 34 with SourcePollingChannelAdapter

use of org.springframework.integration.endpoint.SourcePollingChannelAdapter in project spring-integration by spring-projects.

the class JdbcPollingChannelAdapterParserTests method testAutoChannel.

@Test
public void testAutoChannel() {
    setUp("autoChannelJdbcPollingChannelAdapterParserTests-context.xml", getClass());
    MessageChannel autoChannel = appCtx.getBean("autoChannel", MessageChannel.class);
    SourcePollingChannelAdapter autoChannelAdapter = appCtx.getBean("autoChannel.adapter", SourcePollingChannelAdapter.class);
    assertSame(autoChannel, TestUtils.getPropertyValue(autoChannelAdapter, "outputChannel"));
}
Also used : MessageChannel(org.springframework.messaging.MessageChannel) SourcePollingChannelAdapter(org.springframework.integration.endpoint.SourcePollingChannelAdapter) Test(org.junit.Test)

Example 35 with SourcePollingChannelAdapter

use of org.springframework.integration.endpoint.SourcePollingChannelAdapter in project spring-integration by spring-projects.

the class InboundChannelAdapterParserTests method testAutoStartup.

@Test
public void testAutoStartup() throws Exception {
    ConfigurableApplicationContext context = new ClassPathXmlApplicationContext("SftpInboundAutostartup-context.xml", this.getClass());
    SourcePollingChannelAdapter adapter = context.getBean("sftpAutoStartup", SourcePollingChannelAdapter.class);
    assertFalse(adapter.isRunning());
    context.close();
}
Also used : ConfigurableApplicationContext(org.springframework.context.ConfigurableApplicationContext) ClassPathXmlApplicationContext(org.springframework.context.support.ClassPathXmlApplicationContext) SourcePollingChannelAdapter(org.springframework.integration.endpoint.SourcePollingChannelAdapter) Test(org.junit.Test)

Aggregations

SourcePollingChannelAdapter (org.springframework.integration.endpoint.SourcePollingChannelAdapter)66 Test (org.junit.Test)58 ClassPathXmlApplicationContext (org.springframework.context.support.ClassPathXmlApplicationContext)29 Message (org.springframework.messaging.Message)15 PollableChannel (org.springframework.messaging.PollableChannel)13 Collection (java.util.Collection)10 ArrayList (java.util.ArrayList)9 QueueChannel (org.springframework.integration.channel.QueueChannel)9 JpaExecutor (org.springframework.integration.jpa.core.JpaExecutor)9 Consumer (org.springframework.integration.jpa.test.Consumer)9 DirectFieldAccessor (org.springframework.beans.DirectFieldAccessor)8 PeriodicTrigger (org.springframework.scheduling.support.PeriodicTrigger)8 Trigger (org.springframework.scheduling.Trigger)7 ConfigurableApplicationContext (org.springframework.context.ConfigurableApplicationContext)6 Expression (org.springframework.expression.Expression)6 CountDownLatch (java.util.concurrent.CountDownLatch)5 BeanFactory (org.springframework.beans.factory.BeanFactory)5 RedisConnectionFactory (org.springframework.data.redis.connection.RedisConnectionFactory)5 RedisAvailable (org.springframework.integration.redis.rules.RedisAvailable)5 File (java.io.File)4