Remove deprecated SocketUtils

Closes gh-28052
This commit is contained in:
Sam Brannen
2022-02-15 16:19:11 +01:00
parent bbd35ded91
commit 2cee63491d
7 changed files with 149 additions and 564 deletions

View File

@@ -34,6 +34,7 @@ import javax.management.remote.JMXServiceURL;
import org.junit.jupiter.api.Test;
import org.springframework.aop.framework.ProxyFactory;
import org.springframework.core.testfixture.net.TestSocketUtils;
import org.springframework.jmx.AbstractMBeanServerTests;
import org.springframework.jmx.IJmxTestBean;
import org.springframework.jmx.JmxTestBean;
@@ -177,7 +178,7 @@ class MBeanClientInterceptorTests extends AbstractMBeanServerTests {
assumeTrue(runTests);
@SuppressWarnings("deprecation")
final int port = org.springframework.util.SocketUtils.findAvailableTcpPort();
final int port = TestSocketUtils.findAvailableTcpPort();
JMXServiceURL url = new JMXServiceURL("service:jmx:jmxmp://localhost:" + port);
JMXConnectorServer connector = JMXConnectorServerFactory.newJMXConnectorServer(url, null, getServer());

View File

@@ -28,6 +28,8 @@ import javax.management.remote.JMXServiceURL;
import org.junit.jupiter.api.AfterEach;
import org.springframework.core.testfixture.net.TestSocketUtils;
/**
* @author Rob Harrop
* @author Chris Beams
@@ -36,7 +38,7 @@ import org.junit.jupiter.api.AfterEach;
class RemoteMBeanClientInterceptorTests extends MBeanClientInterceptorTests {
@SuppressWarnings("deprecation")
private final int servicePort = org.springframework.util.SocketUtils.findAvailableTcpPort();
private final int servicePort = TestSocketUtils.findAvailableTcpPort();
private final String serviceUrl = "service:jmx:jmxmp://localhost:" + servicePort;

View File

@@ -30,6 +30,7 @@ import javax.management.remote.JMXServiceURL;
import org.junit.jupiter.api.Test;
import org.springframework.core.testfixture.net.TestSocketUtils;
import org.springframework.jmx.AbstractMBeanServerTests;
import static org.assertj.core.api.Assertions.assertThat;
@@ -47,7 +48,7 @@ class ConnectorServerFactoryBeanTests extends AbstractMBeanServerTests {
private static final String OBJECT_NAME = "spring:type=connector,name=test";
@SuppressWarnings("deprecation")
private final String serviceUrl = "service:jmx:jmxmp://localhost:" + org.springframework.util.SocketUtils.findAvailableTcpPort();
private final String serviceUrl = "service:jmx:jmxmp://localhost:" + TestSocketUtils.findAvailableTcpPort();
@Test

View File

@@ -24,6 +24,7 @@ import javax.management.remote.JMXServiceURL;
import org.junit.jupiter.api.Test;
import org.springframework.aop.support.AopUtils;
import org.springframework.core.testfixture.net.TestSocketUtils;
import org.springframework.jmx.AbstractMBeanServerTests;
import static org.assertj.core.api.Assertions.assertThat;
@@ -39,7 +40,7 @@ import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException
class MBeanServerConnectionFactoryBeanTests extends AbstractMBeanServerTests {
@SuppressWarnings("deprecation")
private final String serviceUrl = "service:jmx:jmxmp://localhost:" + org.springframework.util.SocketUtils.findAvailableTcpPort();
private final String serviceUrl = "service:jmx:jmxmp://localhost:" + TestSocketUtils.findAvailableTcpPort();
@Test