Skip to content

Commit

Permalink
[java] Deleting unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
barancev committed Sep 28, 2019
1 parent c2a38eb commit 5a56387
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 292 deletions.
24 changes: 0 additions & 24 deletions java/client/src/org/openqa/selenium/net/PortProber.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
package org.openqa.selenium.net;

import static java.lang.Math.max;
import static java.util.concurrent.TimeUnit.SECONDS;

import org.openqa.selenium.Platform;

Expand Down Expand Up @@ -118,29 +117,6 @@ private static int checkPortIsFree(int port) {
}
}

public static boolean pollPort(int port) {
return pollPort(port, 15, SECONDS);
}

public static boolean pollPort(int port, int timeout, TimeUnit unit) {
long end = System.currentTimeMillis() + unit.toMillis(timeout);
while (System.currentTimeMillis() < end) {
try {
Socket socket = new Socket();
socket.setReuseAddress(true);
socket.bind(new InetSocketAddress("localhost", port));
socket.close();
return true;
} catch (ConnectException e) {
// Ignore this
} catch (IOException e) {
throw new RuntimeException(e);
}
}

return false;
}

public static void waitForPortUp(int port, int timeout, TimeUnit unit) {
long end = System.currentTimeMillis() + unit.toMillis(timeout);
while (System.currentTimeMillis() < end) {
Expand Down
2 changes: 0 additions & 2 deletions java/client/test/com/thoughtworks/selenium/BaseSuite.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@

package com.thoughtworks.selenium;

import com.thoughtworks.selenium.testing.SeleniumTestEnvironment;

import org.junit.ClassRule;
import org.junit.rules.ExternalResource;
import org.junit.rules.RuleChain;
Expand Down
103 changes: 0 additions & 103 deletions java/client/test/com/thoughtworks/selenium/SessionExtensionJsTest.java

This file was deleted.

This file was deleted.

3 changes: 1 addition & 2 deletions java/server/test/org/openqa/selenium/docker/DockerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
package org.openqa.selenium.docker;

import static java.util.concurrent.TimeUnit.SECONDS;
import static org.junit.Assert.assertTrue;
import static org.openqa.selenium.docker.Port.tcp;

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

container.start();

assertTrue(PortProber.pollPort(port, 10, SECONDS));
PortProber.waitForPortUp(port, 10, SECONDS);

container.stop(Duration.ofSeconds(30));
container.delete();
Expand Down

0 comments on commit 5a56387

Please sign in to comment.