Search in sources :

Example 1 with Option

use of org.springframework.integration.file.remote.gateway.AbstractRemoteFileOutboundGateway.Option in project spring-integration by spring-projects.

the class SftpOutboundGatewayParserTests method testGateway1.

@Test
public void testGateway1() {
    SftpOutboundGateway gateway = TestUtils.getPropertyValue(gateway1, "handler", SftpOutboundGateway.class);
    assertEquals("X", TestUtils.getPropertyValue(gateway, "remoteFileTemplate.remoteFileSeparator"));
    assertNotNull(TestUtils.getPropertyValue(gateway, "remoteFileTemplate.sessionFactory"));
    assertNotNull(TestUtils.getPropertyValue(gateway, "outputChannel"));
    assertEquals("local-test-dir", TestUtils.getPropertyValue(gateway, "localDirectoryExpression.literalValue"));
    assertFalse((Boolean) TestUtils.getPropertyValue(gateway, "autoCreateLocalDirectory"));
    assertTrue(TestUtils.getPropertyValue(gateway, "requiresReply", Boolean.class));
    assertNotNull(TestUtils.getPropertyValue(gateway, "filter"));
    assertEquals(Command.LS, TestUtils.getPropertyValue(gateway, "command"));
    @SuppressWarnings("unchecked") Set<Option> options = TestUtils.getPropertyValue(gateway, "options", Set.class);
    assertTrue(options.contains(Option.NAME_ONLY));
    assertTrue(options.contains(Option.NOSORT));
    Long sendTimeout = TestUtils.getPropertyValue(gateway, "messagingTemplate.sendTimeout", Long.class);
    assertEquals(Long.valueOf(777), sendTimeout);
    assertThat(TestUtils.getPropertyValue(gateway, "mputFilter"), Matchers.instanceOf(RegexPatternFileListFilter.class));
}
Also used : SftpOutboundGateway(org.springframework.integration.sftp.gateway.SftpOutboundGateway) Option(org.springframework.integration.file.remote.gateway.AbstractRemoteFileOutboundGateway.Option) RegexPatternFileListFilter(org.springframework.integration.file.filters.RegexPatternFileListFilter) Test(org.junit.Test)

Example 2 with Option

use of org.springframework.integration.file.remote.gateway.AbstractRemoteFileOutboundGateway.Option in project spring-integration by spring-projects.

the class FtpOutboundGatewayParserTests method testGateway1.

@Test
public void testGateway1() {
    FtpOutboundGateway gateway = TestUtils.getPropertyValue(gateway1, "handler", FtpOutboundGateway.class);
    assertEquals("X", TestUtils.getPropertyValue(gateway, "remoteFileTemplate.remoteFileSeparator"));
    assertNotNull(TestUtils.getPropertyValue(gateway, "remoteFileTemplate.sessionFactory"));
    assertNotNull(TestUtils.getPropertyValue(gateway, "outputChannel"));
    assertEquals("local-test-dir", TestUtils.getPropertyValue(gateway, "localDirectoryExpression.literalValue"));
    assertFalse(TestUtils.getPropertyValue(gateway, "autoCreateLocalDirectory", Boolean.class));
    assertNotNull(TestUtils.getPropertyValue(gateway, "filter"));
    assertEquals(Command.LS, TestUtils.getPropertyValue(gateway, "command"));
    @SuppressWarnings("unchecked") Set<Option> options = TestUtils.getPropertyValue(gateway, "options", Set.class);
    assertTrue(options.contains(Option.NAME_ONLY));
    assertTrue(options.contains(Option.NOSORT));
    Long sendTimeout = TestUtils.getPropertyValue(gateway, "messagingTemplate.sendTimeout", Long.class);
    assertEquals(Long.valueOf(777), sendTimeout);
    assertTrue(TestUtils.getPropertyValue(gateway, "requiresReply", Boolean.class));
    assertThat(TestUtils.getPropertyValue(gateway, "mputFilter"), Matchers.instanceOf(ExpressionFileListFilter.class));
    assertEquals(FileExistsMode.APPEND, TestUtils.getPropertyValue(gateway, "fileExistsMode"));
}
Also used : ExpressionFileListFilter(org.springframework.integration.file.filters.ExpressionFileListFilter) FtpOutboundGateway(org.springframework.integration.ftp.gateway.FtpOutboundGateway) Option(org.springframework.integration.file.remote.gateway.AbstractRemoteFileOutboundGateway.Option) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)2 Option (org.springframework.integration.file.remote.gateway.AbstractRemoteFileOutboundGateway.Option)2 ExpressionFileListFilter (org.springframework.integration.file.filters.ExpressionFileListFilter)1 RegexPatternFileListFilter (org.springframework.integration.file.filters.RegexPatternFileListFilter)1 FtpOutboundGateway (org.springframework.integration.ftp.gateway.FtpOutboundGateway)1 SftpOutboundGateway (org.springframework.integration.sftp.gateway.SftpOutboundGateway)1