Upgrade to SIK-3.0
* Fix Kafka Java DSL sample from bean name conflict * Fix usage of deprecated `org.springframework.integration.test.util.SocketUtils`
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2012 the original author or authors.
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -23,7 +23,7 @@ import org.springframework.context.support.GenericXmlApplicationContext;
|
||||
import org.springframework.core.env.MapPropertySource;
|
||||
import org.springframework.integration.ip.tcp.connection.AbstractServerConnectionFactory;
|
||||
import org.springframework.integration.ip.util.TestingUtilities;
|
||||
import org.springframework.integration.test.util.SocketUtils;
|
||||
import org.springframework.util.SocketUtils;
|
||||
|
||||
/**
|
||||
* Demonstrates the use of a gateway as an entry point into the integration flow.
|
||||
@@ -44,6 +44,7 @@ import org.springframework.integration.test.util.SocketUtils;
|
||||
* </ul>
|
||||
*
|
||||
* @author Gunnar Hillert
|
||||
* @author Artem Bilan
|
||||
*
|
||||
*/
|
||||
public final class Main {
|
||||
@@ -111,7 +112,7 @@ public final class Main {
|
||||
final GenericXmlApplicationContext context = new GenericXmlApplicationContext();
|
||||
|
||||
System.out.print("Detect open server socket...");
|
||||
int availableServerSocket = SocketUtils.findAvailableServerSocket(5678);
|
||||
int availableServerSocket = SocketUtils.findAvailableTcpPort(5678);
|
||||
|
||||
final Map<String, Object> sockets = new HashMap<String, Object>();
|
||||
sockets.put("availableServerSocket", availableServerSocket);
|
||||
@@ -128,4 +129,5 @@ public final class Main {
|
||||
|
||||
return context;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2015 the original author or authors.
|
||||
* Copyright 2015-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,6 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.integration.samples.tcpclientserver;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
@@ -38,7 +39,7 @@ import org.springframework.integration.ip.tcp.connection.AbstractServerConnectio
|
||||
import org.springframework.integration.ip.tcp.connection.TcpNetClientConnectionFactory;
|
||||
import org.springframework.integration.ip.tcp.connection.TcpNetServerConnectionFactory;
|
||||
import org.springframework.integration.ip.util.TestingUtilities;
|
||||
import org.springframework.integration.test.util.SocketUtils;
|
||||
import org.springframework.util.SocketUtils;
|
||||
import org.springframework.messaging.MessageChannel;
|
||||
import org.springframework.messaging.MessageHandler;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
@@ -57,6 +58,7 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
*
|
||||
* @author Gary Russell
|
||||
* @author Gunnar Hillert
|
||||
* @author Artem Bilan
|
||||
*
|
||||
*/
|
||||
@ContextConfiguration(classes = TcpClientServerAnnotationDemoTest.Config.class)
|
||||
@@ -85,7 +87,7 @@ public class TcpClientServerAnnotationDemoTest {
|
||||
@Configuration
|
||||
public static class Config {
|
||||
|
||||
private final int port = SocketUtils.findAvailableServerSocket();
|
||||
private final int port = SocketUtils.findAvailableTcpPort();
|
||||
|
||||
@MessagingGateway(defaultRequestChannel="toTcp")
|
||||
public interface Gateway {
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.integration.samples.tcpclientserver.support;
|
||||
|
||||
import java.util.HashMap;
|
||||
@@ -23,13 +24,14 @@ import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import org.springframework.context.support.GenericApplicationContext;
|
||||
import org.springframework.core.env.MapPropertySource;
|
||||
import org.springframework.integration.test.util.SocketUtils;
|
||||
import org.springframework.util.SocketUtils;
|
||||
import org.springframework.test.context.MergedContextConfiguration;
|
||||
import org.springframework.test.context.support.GenericXmlContextLoader;
|
||||
|
||||
/**
|
||||
* @author Gunnar Hillert
|
||||
* @author Gary Russell
|
||||
* @author Artem Bilan
|
||||
*/
|
||||
public class CustomTestContextLoader extends GenericXmlContextLoader {
|
||||
|
||||
@@ -39,7 +41,7 @@ public class CustomTestContextLoader extends GenericXmlContextLoader {
|
||||
protected void loadBeanDefinitions(GenericApplicationContext context,
|
||||
MergedContextConfiguration mergedConfig) {
|
||||
|
||||
int availableServerSocket = SocketUtils.findAvailableServerSocket(5678);
|
||||
int availableServerSocket = SocketUtils.findAvailableTcpPort(5678);
|
||||
|
||||
final Map<String, Object> sockets = new HashMap<String, Object>();
|
||||
sockets.put("availableServerSocket", availableServerSocket);
|
||||
|
||||
Reference in New Issue
Block a user