Search in sources :

Example 1 with TcpSSLContextSupport

use of org.springframework.integration.ip.tcp.connection.TcpSSLContextSupport in project spring-integration by spring-projects.

the class ParserUnitTests method testInTcp.

@Test
public void testInTcp() {
    DirectFieldAccessor dfa = new DirectFieldAccessor(tcpIn);
    assertSame(cfS1, dfa.getPropertyValue("serverConnectionFactory"));
    assertEquals("testInTcp", tcpIn.getComponentName());
    assertEquals("ip:tcp-inbound-channel-adapter", tcpIn.getComponentType());
    assertEquals(errorChannel, dfa.getPropertyValue("errorChannel"));
    assertFalse(cfS1.isLookupHost());
    assertFalse(tcpIn.isAutoStartup());
    assertEquals(124, tcpIn.getPhase());
    TcpMessageMapper cfS1Mapper = TestUtils.getPropertyValue(cfS1, "mapper", TcpMessageMapper.class);
    assertSame(mapper, cfS1Mapper);
    assertTrue(TestUtils.getPropertyValue(cfS1Mapper, "applySequence", Boolean.class));
    Object socketSupport = TestUtils.getPropertyValue(cfS1, "tcpSocketFactorySupport");
    assertTrue(socketSupport instanceof DefaultTcpNetSSLSocketFactorySupport);
    assertNotNull(TestUtils.getPropertyValue(socketSupport, "sslContext"));
    TcpSSLContextSupport tcpSSLContextSupport = new DefaultTcpSSLContextSupport("http:foo", "file:bar", "", "");
    assertTrue(TestUtils.getPropertyValue(tcpSSLContextSupport, "keyStore") instanceof UrlResource);
    assertTrue(TestUtils.getPropertyValue(tcpSSLContextSupport, "trustStore") instanceof UrlResource);
}
Also used : TcpMessageMapper(org.springframework.integration.ip.tcp.connection.TcpMessageMapper) UrlResource(org.springframework.core.io.UrlResource) DefaultTcpNetSSLSocketFactorySupport(org.springframework.integration.ip.tcp.connection.DefaultTcpNetSSLSocketFactorySupport) DirectFieldAccessor(org.springframework.beans.DirectFieldAccessor) DefaultTcpSSLContextSupport(org.springframework.integration.ip.tcp.connection.DefaultTcpSSLContextSupport) TcpSSLContextSupport(org.springframework.integration.ip.tcp.connection.TcpSSLContextSupport) DefaultTcpSSLContextSupport(org.springframework.integration.ip.tcp.connection.DefaultTcpSSLContextSupport) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 DirectFieldAccessor (org.springframework.beans.DirectFieldAccessor)1 UrlResource (org.springframework.core.io.UrlResource)1 DefaultTcpNetSSLSocketFactorySupport (org.springframework.integration.ip.tcp.connection.DefaultTcpNetSSLSocketFactorySupport)1 DefaultTcpSSLContextSupport (org.springframework.integration.ip.tcp.connection.DefaultTcpSSLContextSupport)1 TcpMessageMapper (org.springframework.integration.ip.tcp.connection.TcpMessageMapper)1 TcpSSLContextSupport (org.springframework.integration.ip.tcp.connection.TcpSSLContextSupport)1