Search in sources :

Example 1 with FtpStreamingMessageSource

use of org.springframework.integration.ftp.inbound.FtpStreamingMessageSource in project spring-integration by spring-projects.

the class FtpStreamingInboundChannelAdapterParserTests method testFtpInboundChannelAdapterComplete.

@Test
public void testFtpInboundChannelAdapterComplete() throws Exception {
    assertFalse(TestUtils.getPropertyValue(this.ftpInbound, "autoStartup", Boolean.class));
    assertEquals("ftpInbound", this.ftpInbound.getComponentName());
    assertEquals("ftp:inbound-streaming-channel-adapter", this.ftpInbound.getComponentType());
    assertSame(this.ftpChannel, TestUtils.getPropertyValue(this.ftpInbound, "outputChannel"));
    FtpStreamingMessageSource source = TestUtils.getPropertyValue(ftpInbound, "source", FtpStreamingMessageSource.class);
    assertNotNull(TestUtils.getPropertyValue(source, "comparator"));
    assertThat(TestUtils.getPropertyValue(source, "remoteFileSeparator", String.class), equalTo("X"));
    FileListFilter<?> filter = TestUtils.getPropertyValue(source, "filter", FileListFilter.class);
    assertNotNull(filter);
    assertThat(filter, instanceOf(CompositeFileListFilter.class));
    Set<?> fileFilters = TestUtils.getPropertyValue(filter, "fileFilters", Set.class);
    Iterator<?> filtersIterator = fileFilters.iterator();
    assertThat(filtersIterator.next(), instanceOf(FtpSimplePatternFileListFilter.class));
    assertThat(filtersIterator.next(), instanceOf(FtpPersistentAcceptOnceFileListFilter.class));
    assertSame(this.csf, TestUtils.getPropertyValue(source, "remoteFileTemplate.sessionFactory"));
    assertEquals(31, TestUtils.getPropertyValue(source, "maxFetchSize"));
}
Also used : CompositeFileListFilter(org.springframework.integration.file.filters.CompositeFileListFilter) FtpSimplePatternFileListFilter(org.springframework.integration.ftp.filters.FtpSimplePatternFileListFilter) FtpStreamingMessageSource(org.springframework.integration.ftp.inbound.FtpStreamingMessageSource) FtpPersistentAcceptOnceFileListFilter(org.springframework.integration.ftp.filters.FtpPersistentAcceptOnceFileListFilter) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 CompositeFileListFilter (org.springframework.integration.file.filters.CompositeFileListFilter)1 FtpPersistentAcceptOnceFileListFilter (org.springframework.integration.ftp.filters.FtpPersistentAcceptOnceFileListFilter)1 FtpSimplePatternFileListFilter (org.springframework.integration.ftp.filters.FtpSimplePatternFileListFilter)1 FtpStreamingMessageSource (org.springframework.integration.ftp.inbound.FtpStreamingMessageSource)1