Skip to content

Commit f4ef7be

Browse files
committed
[java] enabled and fixed unit tests of the http client
1 parent 25c8376 commit f4ef7be

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

Diff for: java/test/org/openqa/selenium/remote/http/BUILD.bazel

+5-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ load("//java:version.bzl", "TOOLS_JAVA_VERSION")
55
java_test_suite(
66
name = "small-tests",
77
size = "small",
8-
srcs = glob(["*.java"]),
8+
srcs = glob([
9+
"*.java",
10+
"jdk/*.java",
11+
]),
912
javacopts = [
1013
"--release",
1114
TOOLS_JAVA_VERSION,
@@ -15,6 +18,7 @@ java_test_suite(
1518
"//java/src/org/openqa/selenium:core",
1619
"//java/src/org/openqa/selenium/remote/http",
1720
"//java/test/org/openqa/selenium/environment",
21+
"//java/test/org/openqa/selenium/remote/internal:test-lib",
1822
"//java/test/org/openqa/selenium/testing:annotations",
1923
artifact("org.assertj:assertj-core"),
2024
artifact("com.google.guava:guava"),

Diff for: java/test/org/openqa/selenium/remote/internal/HttpClientTestBase.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -208,19 +208,19 @@ public void shouldAllowConfigurationFromSystemProperties() {
208208
delegate =
209209
req -> {
210210
try {
211-
Thread.sleep(1100);
211+
Thread.sleep(3000);
212212
} catch (InterruptedException e) {
213213
throw new RuntimeException(e);
214214
}
215215
return new HttpResponse().setContent(Contents.utf8String("Connection timed out"));
216216
};
217217
try {
218218
System.setProperty("webdriver.httpclient.connectionTimeout", "1");
219-
System.setProperty("webdriver.httpclient.readTimeout", "300");
219+
System.setProperty("webdriver.httpclient.readTimeout", "2");
220220
System.setProperty("webdriver.httpclient.version", "HTTP_1_1");
221221
ClientConfig clientConfig = ClientConfig.defaultConfig();
222222
assertThat(clientConfig.connectionTimeout()).isEqualTo(Duration.ofSeconds(1));
223-
assertThat(clientConfig.readTimeout()).isEqualTo(Duration.ofSeconds(300));
223+
assertThat(clientConfig.readTimeout()).isEqualTo(Duration.ofSeconds(2));
224224
assertThat(clientConfig.version()).isEqualTo("HTTP_1_1");
225225
HttpClient client =
226226
createFactory().createClient(clientConfig.baseUri(URI.create(server.whereIs("/"))));

0 commit comments

Comments
 (0)