Skip to content

Commit 6c0204a

Browse files
krmahadevandiemol
authored andcommitted
Additional review comment fixes
1 parent bc94505 commit 6c0204a

File tree

5 files changed

+10
-8
lines changed

5 files changed

+10
-8
lines changed

java/src/org/openqa/selenium/grid/node/config/NodeOptions.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ public Optional<URI> getPublicGridUri() {
148148
}
149149
}
150150

151-
public Optional<String> getDownloadsDirectory() {
151+
public Optional<String> getDownloadsPath() {
152152
return config.get(NODE_SECTION, "downloads-path");
153153
}
154154

java/src/org/openqa/selenium/grid/node/local/LocalNode.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -748,7 +748,7 @@ public static class Builder {
748748
private Duration sessionTimeout = Duration.ofSeconds(NodeOptions.DEFAULT_SESSION_TIMEOUT);
749749
private HealthCheck healthCheck;
750750
private Duration heartbeatPeriod = Duration.ofSeconds(NodeOptions.DEFAULT_HEARTBEAT_PERIOD);
751-
private String downloadsDir = "";
751+
private String downloadsPath = "";
752752

753753
private Builder(
754754
Tracer tracer,
@@ -803,8 +803,8 @@ public Builder heartbeatPeriod(Duration heartbeatPeriod) {
803803
return this;
804804
}
805805

806-
public Builder downloadsDirectory(String dir) {
807-
this.downloadsDir = dir;
806+
public Builder downloadsPath(String path) {
807+
this.downloadsPath = path;
808808
return this;
809809
}
810810

@@ -824,7 +824,7 @@ public LocalNode build() {
824824
heartbeatPeriod,
825825
factories.build(),
826826
registrationSecret,
827-
downloadsDir);
827+
downloadsPath);
828828
}
829829

830830
public Advanced advanced() {

java/src/org/openqa/selenium/grid/node/local/LocalNodeFactory.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ public static Node create(Config config) {
7676
List<DriverService.Builder<?, ?>> builders = new ArrayList<>();
7777
ServiceLoader.load(DriverService.Builder.class).forEach(builders::add);
7878

79+
nodeOptions.getDownloadsPath().ifPresent(builder::downloadsPath);
80+
7981
nodeOptions
8082
.getSessionFactories(
8183
caps -> createSessionFactory(tracer, clientFactory, sessionTimeout, builders, caps))

java/test/org/openqa/selenium/grid/distributor/AddingNodesTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ public HttpResponse uploadFile(HttpRequest req, SessionId id) {
386386

387387
@Override
388388
public HttpResponse downloadFile(HttpRequest req, SessionId id) {
389-
throw new UnsupportedOperationException("uploadFile");
389+
throw new UnsupportedOperationException("downloadFile");
390390
}
391391

392392
@Override

java/test/org/openqa/selenium/grid/node/NodeTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public void setUp() throws URISyntaxException {
116116
caps = new ImmutableCapabilities("browserName", "cheese");
117117

118118
uri = new URI("http://localhost:1234");
119-
File downloadsDir = new File(System.getProperty("java.io.tmpdir"));
119+
File downloadsPath = new File(System.getProperty("java.io.tmpdir"));
120120

121121
class Handler extends Session implements HttpHandler {
122122
private Handler(Capabilities capabilities) {
@@ -133,7 +133,7 @@ public HttpResponse execute(HttpRequest req) throws UncheckedIOException {
133133
.add(caps, new TestSessionFactory((id, c) -> new Handler(c)))
134134
.add(caps, new TestSessionFactory((id, c) -> new Handler(c)))
135135
.add(caps, new TestSessionFactory((id, c) -> new Handler(c)))
136-
.downloadsDirectory(downloadsDir.getAbsolutePath())
136+
.downloadsPath(downloadsPath.getAbsolutePath())
137137
.maximumConcurrentSessions(2)
138138
.build();
139139

0 commit comments

Comments
 (0)