Skip to content

Commit 2cee634

Browse files
committed
Remove deprecated SocketUtils
Closes gh-28052
1 parent bbd35de commit 2cee634

File tree

7 files changed

+149
-564
lines changed

7 files changed

+149
-564
lines changed

spring-context/src/test/java/org/springframework/jmx/access/MBeanClientInterceptorTests.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
import org.junit.jupiter.api.Test;
3535

3636
import org.springframework.aop.framework.ProxyFactory;
37+
import org.springframework.core.testfixture.net.TestSocketUtils;
3738
import org.springframework.jmx.AbstractMBeanServerTests;
3839
import org.springframework.jmx.IJmxTestBean;
3940
import org.springframework.jmx.JmxTestBean;
@@ -177,7 +178,7 @@ void lazyConnectionToRemote() throws Exception {
177178
assumeTrue(runTests);
178179

179180
@SuppressWarnings("deprecation")
180-
final int port = org.springframework.util.SocketUtils.findAvailableTcpPort();
181+
final int port = TestSocketUtils.findAvailableTcpPort();
181182

182183
JMXServiceURL url = new JMXServiceURL("service:jmx:jmxmp://localhost:" + port);
183184
JMXConnectorServer connector = JMXConnectorServerFactory.newJMXConnectorServer(url, null, getServer());

spring-context/src/test/java/org/springframework/jmx/access/RemoteMBeanClientInterceptorTests.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828

2929
import org.junit.jupiter.api.AfterEach;
3030

31+
import org.springframework.core.testfixture.net.TestSocketUtils;
32+
3133
/**
3234
* @author Rob Harrop
3335
* @author Chris Beams
@@ -36,7 +38,7 @@
3638
class RemoteMBeanClientInterceptorTests extends MBeanClientInterceptorTests {
3739

3840
@SuppressWarnings("deprecation")
39-
private final int servicePort = org.springframework.util.SocketUtils.findAvailableTcpPort();
41+
private final int servicePort = TestSocketUtils.findAvailableTcpPort();
4042

4143
private final String serviceUrl = "service:jmx:jmxmp://localhost:" + servicePort;
4244

spring-context/src/test/java/org/springframework/jmx/support/ConnectorServerFactoryBeanTests.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030

3131
import org.junit.jupiter.api.Test;
3232

33+
import org.springframework.core.testfixture.net.TestSocketUtils;
3334
import org.springframework.jmx.AbstractMBeanServerTests;
3435

3536
import static org.assertj.core.api.Assertions.assertThat;
@@ -47,7 +48,7 @@ class ConnectorServerFactoryBeanTests extends AbstractMBeanServerTests {
4748
private static final String OBJECT_NAME = "spring:type=connector,name=test";
4849

4950
@SuppressWarnings("deprecation")
50-
private final String serviceUrl = "service:jmx:jmxmp://localhost:" + org.springframework.util.SocketUtils.findAvailableTcpPort();
51+
private final String serviceUrl = "service:jmx:jmxmp://localhost:" + TestSocketUtils.findAvailableTcpPort();
5152

5253

5354
@Test

spring-context/src/test/java/org/springframework/jmx/support/MBeanServerConnectionFactoryBeanTests.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import org.junit.jupiter.api.Test;
2525

2626
import org.springframework.aop.support.AopUtils;
27+
import org.springframework.core.testfixture.net.TestSocketUtils;
2728
import org.springframework.jmx.AbstractMBeanServerTests;
2829

2930
import static org.assertj.core.api.Assertions.assertThat;
@@ -39,7 +40,7 @@
3940
class MBeanServerConnectionFactoryBeanTests extends AbstractMBeanServerTests {
4041

4142
@SuppressWarnings("deprecation")
42-
private final String serviceUrl = "service:jmx:jmxmp://localhost:" + org.springframework.util.SocketUtils.findAvailableTcpPort();
43+
private final String serviceUrl = "service:jmx:jmxmp://localhost:" + TestSocketUtils.findAvailableTcpPort();
4344

4445

4546
@Test

spring-core/src/main/java/org/springframework/util/SocketUtils.java

Lines changed: 0 additions & 319 deletions
This file was deleted.

0 commit comments

Comments
 (0)