Skip to content

Commit 5a56387

Browse files
committed
[java] Deleting unused code
1 parent c2a38eb commit 5a56387

File tree

5 files changed

+1
-292
lines changed

5 files changed

+1
-292
lines changed

java/client/src/org/openqa/selenium/net/PortProber.java

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
package org.openqa.selenium.net;
1919

2020
import static java.lang.Math.max;
21-
import static java.util.concurrent.TimeUnit.SECONDS;
2221

2322
import org.openqa.selenium.Platform;
2423

@@ -118,29 +117,6 @@ private static int checkPortIsFree(int port) {
118117
}
119118
}
120119

121-
public static boolean pollPort(int port) {
122-
return pollPort(port, 15, SECONDS);
123-
}
124-
125-
public static boolean pollPort(int port, int timeout, TimeUnit unit) {
126-
long end = System.currentTimeMillis() + unit.toMillis(timeout);
127-
while (System.currentTimeMillis() < end) {
128-
try {
129-
Socket socket = new Socket();
130-
socket.setReuseAddress(true);
131-
socket.bind(new InetSocketAddress("localhost", port));
132-
socket.close();
133-
return true;
134-
} catch (ConnectException e) {
135-
// Ignore this
136-
} catch (IOException e) {
137-
throw new RuntimeException(e);
138-
}
139-
}
140-
141-
return false;
142-
}
143-
144120
public static void waitForPortUp(int port, int timeout, TimeUnit unit) {
145121
long end = System.currentTimeMillis() + unit.toMillis(timeout);
146122
while (System.currentTimeMillis() < end) {

java/client/test/com/thoughtworks/selenium/BaseSuite.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717

1818
package com.thoughtworks.selenium;
1919

20-
import com.thoughtworks.selenium.testing.SeleniumTestEnvironment;
21-
2220
import org.junit.ClassRule;
2321
import org.junit.rules.ExternalResource;
2422
import org.junit.rules.RuleChain;

java/client/test/com/thoughtworks/selenium/SessionExtensionJsTest.java

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

java/client/test/com/thoughtworks/selenium/testing/SeleniumTestEnvironment.java

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

java/server/test/org/openqa/selenium/docker/DockerTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
package org.openqa.selenium.docker;
1919

2020
import static java.util.concurrent.TimeUnit.SECONDS;
21-
import static org.junit.Assert.assertTrue;
2221
import static org.openqa.selenium.docker.Port.tcp;
2322

2423
import org.junit.Test;
@@ -49,7 +48,7 @@ public void bootstrap() throws IOException {
4948

5049
container.start();
5150

52-
assertTrue(PortProber.pollPort(port, 10, SECONDS));
51+
PortProber.waitForPortUp(port, 10, SECONDS);
5352

5453
container.stop(Duration.ofSeconds(30));
5554
container.delete();

0 commit comments

Comments
 (0)