Skip to content

Commit e71ae89

Browse files
authored
Merge branch 'trunk' into py-client-config
2 parents 5b63c44 + 7dc68df commit e71ae89

25 files changed

+264
-341
lines changed

MODULE.bazel

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ maven.install(
180180
"com.google.googlejavaformat:google-java-format:jar:1.24.0",
181181
"com.graphql-java:graphql-java:22.3",
182182
"dev.failsafe:failsafe:3.3.2",
183-
"io.grpc:grpc-context:1.68.0",
183+
"io.grpc:grpc-context:1.68.1",
184184
"io.lettuce:lettuce-core:6.4.0.RELEASE",
185185
"io.netty:netty-buffer:4.1.114.Final",
186186
"io.netty:netty-codec-http:4.1.114.Final",
@@ -199,9 +199,8 @@ maven.install(
199199
"io.opentelemetry:opentelemetry-sdk-testing:1.43.0",
200200
"io.opentelemetry:opentelemetry-sdk-trace:1.43.0",
201201
"io.opentelemetry.semconv:opentelemetry-semconv:1.25.0-alpha",
202-
"io.ous:jtoml:2.0.0",
203202
"it.ozimov:embedded-redis:0.7.3",
204-
"net.bytebuddy:byte-buddy:1.15.7",
203+
"net.bytebuddy:byte-buddy:1.15.10",
205204
"org.htmlunit:htmlunit-core-js:4.5.0",
206205
"org.apache.commons:commons-exec:1.4.0",
207206
"org.apache.logging.log4j:log4j-core:2.24.1",
@@ -221,6 +220,7 @@ maven.install(
221220
"org.redisson:redisson:3.37.0",
222221
"org.slf4j:slf4j-api:2.0.16",
223222
"org.slf4j:slf4j-jdk14:2.0.16",
223+
"org.tomlj:tomlj:1.1.1",
224224
"org.zeromq:jeromq:0.6.0",
225225
],
226226
excluded_artifacts = [

dotnet/src/webdriver/Command.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,19 +151,18 @@ private static Dictionary<string, object> ConvertParametersFromJson(string value
151151
[JsonSerializable(typeof(ulong))]
152152
[JsonSerializable(typeof(short))]
153153
[JsonSerializable(typeof(ushort))]
154-
155154
[JsonSerializable(typeof(string))]
156155

157156
// Selenium WebDriver types
158157
[JsonSerializable(typeof(char[]))]
159158
[JsonSerializable(typeof(byte[]))]
159+
[JsonSerializable(typeof(Chromium.ChromiumNetworkConditions))]
160160
[JsonSerializable(typeof(Cookie))]
161161
[JsonSerializable(typeof(ReturnedCookie))]
162162
[JsonSerializable(typeof(Proxy))]
163163

164164
// Selenium Dictionaries, primarily used in Capabilities
165165
[JsonSerializable(typeof(Dictionary<string, object>))]
166-
167166
[JsonSerializable(typeof(Dictionary<string, bool>))]
168167
[JsonSerializable(typeof(Dictionary<string, byte>))]
169168
[JsonSerializable(typeof(Dictionary<string, sbyte>))]
@@ -179,5 +178,6 @@ private static Dictionary<string, object> ConvertParametersFromJson(string value
179178
[JsonSerializable(typeof(Dictionary<string, ulong>))]
180179
[JsonSerializable(typeof(Dictionary<string, short>))]
181180
[JsonSerializable(typeof(Dictionary<string, ushort>))]
181+
[JsonSerializable(typeof(Dictionary<string, string>))]
182182
internal partial class CommandJsonSerializerContext : JsonSerializerContext;
183183
}

java/maven_install.json

Lines changed: 46 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"__AUTOGENERATED_FILE_DO_NOT_MODIFY_THIS_FILE_MANUALLY": "THERE_IS_NO_DATA_ONLY_ZUUL",
3-
"__INPUT_ARTIFACTS_HASH": 282748108,
4-
"__RESOLVED_ARTIFACTS_HASH": 1016391538,
3+
"__INPUT_ARTIFACTS_HASH": -1685742929,
4+
"__RESOLVED_ARTIFACTS_HASH": -1218025727,
55
"conflict_resolution": {
66
"com.google.code.gson:gson:2.8.9": "com.google.code.gson:gson:2.11.0",
77
"com.google.errorprone:error_prone_annotations:2.3.2": "com.google.errorprone:error_prone_annotations:2.28.0",
@@ -243,17 +243,17 @@
243243
},
244244
"io.grpc:grpc-api": {
245245
"shasums": {
246-
"jar": "b5120a11da5ce5ddfab019bbb69f5868529c9b5def1ba5b283251cc95fb3ba91",
247-
"sources": "3e4b31496f2c8b7cd51b425af767c72d44b38fdbb56a6e8c247acb8a721c4e8c"
246+
"jar": "d88d815e07fe58a7572dda5d2823485b61706564f289a1e74281705d50ac2d5b",
247+
"sources": "791d817c56f03690df499020479e23494b79ab6ed578f4f50285d83d45a1f35d"
248248
},
249-
"version": "1.68.0"
249+
"version": "1.68.1"
250250
},
251251
"io.grpc:grpc-context": {
252252
"shasums": {
253-
"jar": "45f85a394466f963f1f7a5c5555e6dda35efd05ce1c687203a217d7048f6f089",
254-
"sources": "31d4fc1054b5c0bc75924e82ca425dcf624f895e7525da900b94cfa87a2bea53"
253+
"jar": "1df4f0310a7e7836bc2948afa95105f5ee27b5d468488aded74e7ff620359076",
254+
"sources": "6f5941f8531f6eea4ff922d2019757d06dc5857327ff9b9858ace45c0cf0ef8b"
255255
},
256-
"version": "1.68.0"
256+
"version": "1.68.1"
257257
},
258258
"io.lettuce:lettuce-core": {
259259
"shasums": {
@@ -444,13 +444,6 @@
444444
},
445445
"version": "1.43.0"
446446
},
447-
"io.ous:jtoml": {
448-
"shasums": {
449-
"jar": "3cabdae2244c999addebb8c31ae452fbdc874b4f26a163539954b8eeb5d6acc6",
450-
"sources": "f479f2acdf7a362dc86a5c9310ddaec7b34a87f0a8a6f46dde41c1069b2a2138"
451-
},
452-
"version": "2.0.0"
453-
},
454447
"io.projectreactor:reactor-core": {
455448
"shasums": {
456449
"jar": "44f055fbd033b6c976c53fb2e04b59027e79fb2312c37d2eaa54c77ea1ea80fe",
@@ -495,10 +488,10 @@
495488
},
496489
"net.bytebuddy:byte-buddy": {
497490
"shasums": {
498-
"jar": "7f77ee7ae0a6f420218546424a92fc6c964ed5788b21a2559d6be177c5e1a718",
499-
"sources": "d19281fa34e46008ff096ec955659f94c81df9a3301109e33503ac15f9e1c44d"
491+
"jar": "d8390d20685a41a2bdca640f958942cd91bcbf21c42470494bdf5752d9a07b14",
492+
"sources": "254ea80bf6f932e785b6f7dcdf3666b6fad4ceea36ef187c064a5346c650cb2c"
500493
},
501-
"version": "1.15.7"
494+
"version": "1.15.10"
502495
},
503496
"net.bytebuddy:byte-buddy-agent": {
504497
"shasums": {
@@ -514,6 +507,13 @@
514507
},
515508
"version": "12.4"
516509
},
510+
"org.antlr:antlr4-runtime": {
511+
"shasums": {
512+
"jar": "e06c6553c1ccc14d36052ec4b0fc6f13b808cf957b5b1dc3f61bf401996ada59",
513+
"sources": "6fa0efb711a152842ecda1d41ceab94fb2049f833e00e360e161ac0e7a3819fe"
514+
},
515+
"version": "4.11.1"
516+
},
517517
"org.apache.bcel:bcel": {
518518
"shasums": {
519519
"jar": "a119a4420350dea669acfd84120ecc7e5742dcabcc82b0b9f9755dc692335aa2",
@@ -801,6 +801,13 @@
801801
},
802802
"version": "1.7.21"
803803
},
804+
"org.tomlj:tomlj": {
805+
"shasums": {
806+
"jar": "383b7c66966c42ee4913ec977a7b6573631866bddc5318ec4a6215b688dd0d6c",
807+
"sources": "533276104d58ebc92ce049c59a129717ce7daf0e9340969256fdb61f4f06f717"
808+
},
809+
"version": "1.1.1"
810+
},
804811
"org.xmlresolver:xmlresolver": {
805812
"shasums": {
806813
"data": "173904bdbd783ba0fac92c5bcc05da5d09f0ce7eed24346666ea0a239461f9b4",
@@ -1159,6 +1166,10 @@
11591166
"org.slf4j:slf4j-simple": [
11601167
"org.slf4j:slf4j-api"
11611168
],
1169+
"org.tomlj:tomlj": [
1170+
"org.antlr:antlr4-runtime",
1171+
"org.checkerframework:checker-qual"
1172+
],
11621173
"org.xmlresolver:xmlresolver": [
11631174
"org.apache.httpcomponents.client5:httpclient5",
11641175
"org.apache.httpcomponents.core5:httpcore5"
@@ -1786,10 +1797,6 @@
17861797
"io.opentelemetry.sdk.trace.internal.data",
17871798
"io.opentelemetry.sdk.trace.samplers"
17881799
],
1789-
"io.ous:jtoml": [
1790-
"io.ous.jtoml",
1791-
"io.ous.jtoml.impl"
1792-
],
17931800
"io.projectreactor:reactor-core": [
17941801
"reactor.adapter",
17951802
"reactor.core",
@@ -2014,6 +2021,15 @@
20142021
"net.sf.saxon.xpath",
20152022
"net.sf.saxon.z"
20162023
],
2024+
"org.antlr:antlr4-runtime": [
2025+
"org.antlr.v4.runtime",
2026+
"org.antlr.v4.runtime.atn",
2027+
"org.antlr.v4.runtime.dfa",
2028+
"org.antlr.v4.runtime.misc",
2029+
"org.antlr.v4.runtime.tree",
2030+
"org.antlr.v4.runtime.tree.pattern",
2031+
"org.antlr.v4.runtime.tree.xpath"
2032+
],
20172033
"org.apache.bcel:bcel": [
20182034
"org.apache.bcel",
20192035
"org.apache.bcel.classfile",
@@ -2898,6 +2914,10 @@
28982914
"org.slf4j:slf4j-simple": [
28992915
"org.slf4j.impl"
29002916
],
2917+
"org.tomlj:tomlj": [
2918+
"org.tomlj",
2919+
"org.tomlj.internal"
2920+
],
29012921
"org.xmlresolver:xmlresolver": [
29022922
"org.xmlresolver",
29032923
"org.xmlresolver.cache",
@@ -3095,8 +3115,6 @@
30953115
"io.opentelemetry:opentelemetry-sdk-trace",
30963116
"io.opentelemetry:opentelemetry-sdk-trace:jar:sources",
30973117
"io.opentelemetry:opentelemetry-sdk:jar:sources",
3098-
"io.ous:jtoml",
3099-
"io.ous:jtoml:jar:sources",
31003118
"io.projectreactor:reactor-core",
31013119
"io.projectreactor:reactor-core:jar:sources",
31023120
"io.reactivex.rxjava3:rxjava",
@@ -3115,6 +3133,8 @@
31153133
"net.bytebuddy:byte-buddy:jar:sources",
31163134
"net.sf.saxon:Saxon-HE",
31173135
"net.sf.saxon:Saxon-HE:jar:sources",
3136+
"org.antlr:antlr4-runtime",
3137+
"org.antlr:antlr4-runtime:jar:sources",
31183138
"org.apache.bcel:bcel",
31193139
"org.apache.bcel:bcel:jar:sources",
31203140
"org.apache.commons:commons-exec",
@@ -3197,6 +3217,8 @@
31973217
"org.slf4j:slf4j-jdk14:jar:sources",
31983218
"org.slf4j:slf4j-simple",
31993219
"org.slf4j:slf4j-simple:jar:sources",
3220+
"org.tomlj:tomlj",
3221+
"org.tomlj:tomlj:jar:sources",
32003222
"org.xmlresolver:xmlresolver",
32013223
"org.xmlresolver:xmlresolver:jar:data",
32023224
"org.xmlresolver:xmlresolver:jar:sources",

java/src/org/openqa/selenium/grid/config/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ java_library(
2121
"//java/src/org/openqa/selenium/json",
2222
artifact("com.beust:jcommander"),
2323
artifact("com.google.guava:guava"),
24-
artifact("io.ous:jtoml"),
24+
artifact("org.tomlj:tomlj"),
2525
],
2626
)

java/src/org/openqa/selenium/grid/config/TomlConfig.java

Lines changed: 29 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@
1919

2020
import com.google.common.collect.ImmutableList;
2121
import com.google.common.collect.ImmutableSortedSet;
22-
import io.ous.jtoml.JToml;
23-
import io.ous.jtoml.ParseException;
24-
import io.ous.jtoml.Toml;
25-
import io.ous.jtoml.TomlTable;
2622
import java.io.IOException;
2723
import java.io.Reader;
2824
import java.nio.file.Files;
@@ -31,18 +27,31 @@
3127
import java.util.List;
3228
import java.util.Optional;
3329
import java.util.Set;
30+
import java.util.stream.Collectors;
3431
import org.openqa.selenium.internal.Require;
32+
import org.tomlj.Toml;
33+
import org.tomlj.TomlArray;
34+
import org.tomlj.TomlParseError;
35+
import org.tomlj.TomlParseResult;
36+
import org.tomlj.TomlTable;
3537

3638
public class TomlConfig implements Config {
3739

38-
private final Toml toml;
40+
private final TomlParseResult toml;
3941

4042
public TomlConfig(Reader reader) {
4143
try {
42-
toml = JToml.parse(reader);
44+
toml = Toml.parse(reader);
45+
46+
if (toml.hasErrors()) {
47+
String error =
48+
toml.errors().stream().map(TomlParseError::toString).collect(Collectors.joining("\n"));
49+
50+
throw new ConfigException(error);
51+
}
4352
} catch (IOException e) {
4453
throw new ConfigException("Unable to read TOML.", e);
45-
} catch (ParseException e) {
54+
} catch (TomlParseError e) {
4655
throw new ConfigException(
4756
e.getCause()
4857
+ "\n Validate the config using https://www.toml-lint.com/. "
@@ -65,7 +74,7 @@ public Optional<List<String>> getAll(String section, String option) {
6574
Require.nonNull("Section to read", section);
6675
Require.nonNull("Option to read", option);
6776

68-
if (!toml.containsKey(section)) {
77+
if (!toml.contains(section)) {
6978
return Optional.empty();
7079
}
7180

@@ -74,21 +83,28 @@ public Optional<List<String>> getAll(String section, String option) {
7483
throw new ConfigException(String.format("Section %s is not a section! %s", section, raw));
7584
}
7685

77-
TomlTable table = toml.getTomlTable(section);
86+
TomlTable table = toml.getTable(section);
87+
Object value = null;
88+
if (table != null) {
89+
value = table.get(option);
90+
}
7891

79-
Object value = table.getOrDefault(option, null);
8092
if (value == null) {
8193
return Optional.empty();
8294
}
8395

96+
if (value instanceof TomlArray) {
97+
value = ((TomlArray) value).toList();
98+
}
99+
84100
if (value instanceof Collection) {
85101
Collection<?> collection = (Collection<?>) value;
86102
// Case when an array of tables is used as config
87103
// https://toml.io/en/v1.0.0-rc.3#array-of-tables
88-
if (collection.stream().anyMatch(item -> item instanceof TomlTable)) {
104+
if (collection.stream().anyMatch(TomlTable.class::isInstance)) {
89105
return Optional.of(
90106
collection.stream()
91-
.map(item -> (TomlTable) item)
107+
.map(TomlTable.class::cast)
92108
.map(TomlTable::toMap)
93109
.map(this::toEntryList)
94110
.flatMap(Collection::stream)
@@ -106,7 +122,7 @@ public Optional<List<String>> getAll(String section, String option) {
106122
return Optional.of(toEntryList(((TomlTable) value).toMap()));
107123
}
108124

109-
return Optional.of(ImmutableList.of(String.valueOf(value)));
125+
return Optional.of(List.of(String.valueOf(value)));
110126
}
111127

112128
@Override

0 commit comments

Comments
 (0)