Skip to content

Commit c674649

Browse files
committed
[grid] Code formatting and improving method name
1 parent 3c60492 commit c674649

File tree

3 files changed

+26
-10
lines changed

3 files changed

+26
-10
lines changed

java/server/src/org/openqa/selenium/docker/ContainerLogs.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public ContainerLogs(ContainerId id, List<String> logLines) {
3131
this.id = Require.nonNull("Container id", id);
3232
}
3333

34-
public List<String> getLogs() {
34+
public List<String> getLogLines() {
3535
return logLines;
3636
}
3737

java/server/src/org/openqa/selenium/grid/node/httpd/NodeFlags.java

+8-4
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,17 @@ public class NodeFlags implements HasRoles {
4949

5050
@Parameter(
5151
names = {"-I", "--driver-implementation"},
52-
description = "Drivers that should be checked. If specified, will skip autoconfiguration. Example: -I \"firefox\" -I \"chrome\"")
52+
description = "Drivers that should be checked. If specified, will skip autoconfiguration. " +
53+
"Example: -I \"firefox\" -I \"chrome\"")
5354
@ConfigValue(section = "node", name = "drivers", example = "[\"firefox\", \"chrome\"]")
5455
public Set<String> driverNames = new HashSet<>();
5556

5657
@Parameter(
5758
names = {"--driver-factory"},
58-
description = "Mapping of fully qualified class name to a browser configuration that this matches against. " +
59-
"`--driver-factory org.openqa.selenium.example.LynxDriverFactory '{\"browserName\": \"lynx\"}')",
59+
description = "Mapping of fully qualified class name to a browser configuration that this " +
60+
"matches against. " +
61+
"`--driver-factory org.openqa.selenium.example.LynxDriverFactory " +
62+
"'{\"browserName\": \"lynx\"}')",
6063
arity = 2,
6164
variableArity = true)
6265
@ConfigValue(
@@ -67,7 +70,8 @@ public class NodeFlags implements HasRoles {
6770

6871
@Parameter(
6972
names = {"--public-url"},
70-
description = "Public URL of the Grid as a whole (typically the address of the hub or the router)")
73+
description = "Public URL of the Grid as a whole (typically the address of the Hub " +
74+
"or the Router)")
7175
@ConfigValue(section = "node", name = "grid-url", example = "\"https://grid.example.com\"")
7276
public URL gridUri;
7377

java/server/src/org/openqa/selenium/grid/server/BaseServerOptions.java

+17-5
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,14 @@ public URI getExternalUri() {
8888
int port = getPort();
8989

9090
try {
91-
return new URI((isSecure() || isSelfSigned()) ? "https" : "http", null, host, port, null, null, null);
91+
return new URI(
92+
(isSecure() || isSelfSigned()) ? "https" : "http",
93+
null,
94+
host,
95+
port,
96+
null,
97+
null,
98+
null);
9299
} catch (URISyntaxException e) {
93100
throw new ConfigException("Cannot determine external URI: " + e.getMessage());
94101
}
@@ -99,23 +106,28 @@ public boolean getAllowCORS() {
99106
}
100107

101108
public boolean isSecure() {
102-
return config.get(SERVER_SECTION, "https-private-key").isPresent() && config.get(SERVER_SECTION, "https-certificate").isPresent();
109+
return config.get(SERVER_SECTION, "https-private-key").isPresent()
110+
&& config.get(SERVER_SECTION, "https-certificate").isPresent();
103111
}
104112

105113
public File getPrivateKey() {
106114
String privateKey = config.get(SERVER_SECTION, "https-private-key").orElse(null);
107115
if (privateKey != null) {
108116
return new File(privateKey);
109117
}
110-
throw new ConfigException("you must provide a private key via --https-private-key when using --https");
118+
throw new ConfigException("Please provide a private key via --https-private-key " +
119+
"when using --https");
111120
}
112121

113122
public File getCertificate() {
114-
String certificatePath = config.get(SERVER_SECTION, "https-certificate").orElse(null);
123+
String certificatePath = config
124+
.get(SERVER_SECTION, "https-certificate")
125+
.orElse(null);
115126
if (certificatePath != null) {
116127
return new File(certificatePath);
117128
}
118-
throw new ConfigException("you must provide a certificate via --https-certificate when using --https");
129+
throw new ConfigException("Please provide a certificate via --https-certificate " +
130+
"when using --https");
119131
}
120132

121133
public boolean isSelfSigned() {

0 commit comments

Comments
 (0)