mirror of
https://github.com/google/nomulus
synced 2026-09-21 07:24:26 +00:00
Comment and deprecation nits
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=146285418
This commit is contained in:
@@ -99,7 +99,7 @@ public final class RegistryTestServer {
|
|||||||
|
|
||||||
private final TestServer server;
|
private final TestServer server;
|
||||||
|
|
||||||
/** @see TestServer#TestServer(HostAndPort, java.util.Map, Iterable, Iterable) */
|
/** @see TestServer#TestServer(HostAndPort, ImmutableMap, ImmutableList, ImmutableList) */
|
||||||
public RegistryTestServer(HostAndPort address) {
|
public RegistryTestServer(HostAndPort address) {
|
||||||
server = new TestServer(address, RUNFILES, ROUTES, FILTERS);
|
server = new TestServer(address, RUNFILES, ROUTES, FILTERS);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import static com.google.common.util.concurrent.Runnables.doNothing;
|
|||||||
import static google.registry.util.NetworkUtils.getCanonicalHostName;
|
import static google.registry.util.NetworkUtils.getCanonicalHostName;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
|
import com.google.common.collect.ImmutableMap;
|
||||||
import com.google.common.net.HostAndPort;
|
import com.google.common.net.HostAndPort;
|
||||||
import com.google.common.util.concurrent.SimpleTimeLimiter;
|
import com.google.common.util.concurrent.SimpleTimeLimiter;
|
||||||
import java.net.MalformedURLException;
|
import java.net.MalformedURLException;
|
||||||
@@ -84,7 +85,7 @@ public final class TestServer {
|
|||||||
*/
|
*/
|
||||||
public TestServer(
|
public TestServer(
|
||||||
HostAndPort address,
|
HostAndPort address,
|
||||||
Map<String, Path> runfiles,
|
ImmutableMap<String, Path> runfiles,
|
||||||
ImmutableList<Route> routes,
|
ImmutableList<Route> routes,
|
||||||
ImmutableList<Class<? extends Filter>> filters) {
|
ImmutableList<Class<? extends Filter>> filters) {
|
||||||
urlAddress = createUrlAddress(address);
|
urlAddress = createUrlAddress(address);
|
||||||
@@ -179,20 +180,20 @@ public final class TestServer {
|
|||||||
|
|
||||||
private static Connector createConnector(HostAndPort address) {
|
private static Connector createConnector(HostAndPort address) {
|
||||||
SocketConnector connector = new SocketConnector();
|
SocketConnector connector = new SocketConnector();
|
||||||
connector.setHost(address.getHostText());
|
connector.setHost(address.getHost());
|
||||||
connector.setPort(address.getPortOrDefault(DEFAULT_PORT));
|
connector.setPort(address.getPortOrDefault(DEFAULT_PORT));
|
||||||
return connector;
|
return connector;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Converts a bind address into an address that other machines can use to connect here. */
|
/** Converts a bind address into an address that other machines can use to connect here. */
|
||||||
private static HostAndPort createUrlAddress(HostAndPort address) {
|
private static HostAndPort createUrlAddress(HostAndPort address) {
|
||||||
if (address.getHostText().equals("::") || address.getHostText().equals("0.0.0.0")) {
|
if (address.getHost().equals("::") || address.getHost().equals("0.0.0.0")) {
|
||||||
return address.getPortOrDefault(DEFAULT_PORT) == DEFAULT_PORT
|
return address.getPortOrDefault(DEFAULT_PORT) == DEFAULT_PORT
|
||||||
? HostAndPort.fromHost(getCanonicalHostName())
|
? HostAndPort.fromHost(getCanonicalHostName())
|
||||||
: HostAndPort.fromParts(getCanonicalHostName(), address.getPort());
|
: HostAndPort.fromParts(getCanonicalHostName(), address.getPort());
|
||||||
} else {
|
} else {
|
||||||
return address.getPortOrDefault(DEFAULT_PORT) == DEFAULT_PORT
|
return address.getPortOrDefault(DEFAULT_PORT) == DEFAULT_PORT
|
||||||
? HostAndPort.fromHost(address.getHostText())
|
? HostAndPort.fromHost(address.getHost())
|
||||||
: address;
|
: address;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user