Skip to content

Commit 782822c

Browse files
committed
Mark Lock for deletion
1 parent ef599b3 commit 782822c

File tree

3 files changed

+28
-22
lines changed

3 files changed

+28
-22
lines changed

java/client/src/org/openqa/selenium/internal/Lock.java

+4
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@
1717

1818
package org.openqa.selenium.internal;
1919

20+
/**
21+
* @deprecated Scheduled for deletion in 3.7
22+
*/
23+
@Deprecated
2024
public interface Lock {
2125
void lock(long timeoutInMillis);
2226

java/client/src/org/openqa/selenium/internal/SocketLock.java

+2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@
3131
* server socket.
3232
*
3333
* @author [email protected] (Gregory Block)
34+
* @deprecated No longer used. Scheduled for deletion in 3.7
3435
*/
36+
@Deprecated
3537
public class SocketLock implements Closeable, Lock {
3638
public static final int DEFAULT_PORT = 7055;
3739
private static final long DELAY_BETWEEN_SOCKET_CHECKS = 2000;

java/server/src/org/openqa/selenium/server/htmlrunner/HTMLLauncher.java

+22-22
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
import org.openqa.selenium.firefox.FirefoxDriver;
3333
import org.openqa.selenium.firefox.FirefoxOptions;
3434
import org.openqa.selenium.ie.InternetExplorerDriver;
35-
import org.openqa.selenium.internal.SocketLock;
3635
import org.openqa.selenium.net.PortProber;
3736
import org.openqa.selenium.opera.OperaDriver;
3837
import org.openqa.selenium.safari.SafariDriver;
@@ -149,35 +148,36 @@ private URL determineSuiteUrl(String startURL, String suiteURL) throws IOExcepti
149148
Path path = Paths.get(suiteURL).toAbsolutePath();
150149
if (Files.exists(path)) {
151150
// Not all drivers can read files from the disk, so we need to host the suite somewhere.
152-
try (SocketLock lock = new SocketLock()) {
153-
server = new Server();
154-
HttpConfiguration httpConfig = new HttpConfiguration();
151+
server = new Server();
152+
HttpConfiguration httpConfig = new HttpConfiguration();
155153

156-
ServerConnector http = new ServerConnector(server, new HttpConnectionFactory(httpConfig));
157-
int port = PortProber.findFreePort();
158-
http.setPort(port);
159-
http.setIdleTimeout(500000);
160-
server.setConnectors(new Connector[]{http});
154+
ServerConnector http = new ServerConnector(server, new HttpConnectionFactory(httpConfig));
155+
int port = PortProber.findFreePort();
156+
http.setPort(port);
157+
http.setIdleTimeout(500000);
158+
server.setConnectors(new Connector[]{http});
161159

162-
ResourceHandler handler = new ResourceHandler();
163-
handler.setDirectoriesListed(true);
164-
handler.setWelcomeFiles(new String[]{path.getFileName().toString(), "index.html"});
165-
handler.setBaseResource(new PathResource(path.toFile().getParentFile().toPath().toRealPath()));
160+
ResourceHandler handler = new ResourceHandler();
161+
handler.setDirectoriesListed(true);
162+
handler.setWelcomeFiles(new String[]{path.getFileName().toString(), "index.html"});
163+
handler
164+
.setBaseResource(new PathResource(path.toFile().getParentFile().toPath().toRealPath()));
166165

167-
ContextHandler context = new ContextHandler("/tests");
168-
context.setHandler(handler);
166+
ContextHandler context = new ContextHandler("/tests");
167+
context.setHandler(handler);
169168

170-
server.setHandler(context);
169+
server.setHandler(context);
170+
try {
171171
server.start();
172-
173-
PortProber.waitForPortUp(port, 15, SECONDS);
174-
175-
URL serverUrl = server.getURI().toURL();
176-
return new URL(serverUrl.getProtocol(), serverUrl.getHost(), serverUrl.getPort(),
177-
"/tests/");
178172
} catch (Exception e) {
179173
throw new IOException(e);
180174
}
175+
176+
PortProber.waitForPortUp(port, 15, SECONDS);
177+
178+
URL serverUrl = server.getURI().toURL();
179+
return new URL(serverUrl.getProtocol(), serverUrl.getHost(), serverUrl.getPort(),
180+
"/tests/");
181181
}
182182

183183
// Well then, it must be a URL relative to whatever the browserUrl. Probe and find out.

0 commit comments

Comments
 (0)