use of org.springframework.integration.ip.tcp.serializer.ByteArrayRawSerializer in project spring-integration by spring-projects.
the class ConnectionToConnectionTests method testConnectRaw.
@Test
public void testConnectRaw() throws Exception {
ByteArrayRawSerializer serializer = new ByteArrayRawSerializer();
clientNet.setSerializer(serializer);
serverNet.setDeserializer(serializer);
clientNet.start();
TcpConnection connection = clientNet.getConnection();
connection.send(MessageBuilder.withPayload("Test").build());
connection.close();
Message<?> message = serverSideChannel.receive(10000);
assertNotNull(message);
MessageHistory history = MessageHistory.read(message);
// org.springframework.integration.test.util.TestUtils
Properties componentHistoryRecord = TestUtils.locateComponentInHistory(history, "gwNet", 0);
assertNotNull(componentHistoryRecord);
assertTrue(componentHistoryRecord.get("type").equals("ip:tcp-inbound-gateway"));
assertNotNull(message);
assertEquals("Test", new String((byte[]) message.getPayload()));
}
Aggregations