Skip to content

Commit 15fa449

Browse files
committed
fix formatting
1 parent 8de6ddf commit 15fa449

File tree

8 files changed

+47
-31
lines changed

8 files changed

+47
-31
lines changed

.idea/kotlinc.xml

Lines changed: 0 additions & 7 deletions
This file was deleted.

.idea/misc.xml

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

java/src/org/openqa/selenium/remote/service/DriverService.java

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -505,11 +505,15 @@ public DS build() {
505505
port = PortProber.findFreePort();
506506
}
507507

508-
if(Locale.getDefault(Locale.Category.FORMAT).getLanguage().equals("ar")) {
509-
throw new NumberFormatException(String.format("Couldn't format the port numbers because the System Language is arabic: \"--port=%d\","
510-
+ " please make sure to add the required arguments \"-Duser.language=en -Duser.region=US\" to your JVM,"
511-
+ " for more info please visit :\n https://www.selenium.dev/documentation/webdriver/browsers/", getPort()));
512-
}
508+
if (Locale.getDefault(Locale.Category.FORMAT).getLanguage().equals("ar")) {
509+
throw new NumberFormatException(
510+
String.format(
511+
"Couldn't format the port numbers because the System Language is arabic:"
512+
+ " \"--port=%d\", please make sure to add the required arguments"
513+
+ " \"-Duser.language=en -Duser.region=US\" to your JVM, for more info please"
514+
+ " visit :\n"
515+
+ " https://www.selenium.dev/documentation/webdriver/browsers/",
516+
getPort()));
513517

514518
if (timeout == null) {
515519
timeout = getDefaultTimeout();

java/test/org/openqa/selenium/chrome/ChromeDriverFunctionalTest.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,9 +213,13 @@ void shouldThrowNumberFormatException() {
213213
builder.usingPort(port);
214214

215215
assertThatExceptionOfType(NumberFormatException.class)
216-
.isThrownBy(builder::build)
217-
.withMessage("Couldn't format the port numbers because the System Language is arabic: \"" + String.format("--port=%d", port) +
218-
"\", please make sure to add the required arguments \"-Duser.language=en -Duser.region=US\" to your JVM, for more info please visit :" + "\n https://www.selenium.dev/documentation/webdriver/browsers/");
216+
.isThrownBy(builder::build)
217+
.withMessage(
218+
"Couldn't format the port numbers because the System Language is arabic: \""
219+
+ String.format("--port=%d", port)
220+
+ "\", please make sure to add the required arguments \"-Duser.language=en"
221+
+ " -Duser.region=US\" to your JVM, for more info please visit :\n"
222+
+ " https://www.selenium.dev/documentation/webdriver/browsers/");
219223

220224
Locale.setDefault(Locale.US);
221225
}

java/test/org/openqa/selenium/edge/EdgeDriverFunctionalTest.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -207,9 +207,13 @@ void shouldThrowNumberFormatException() {
207207
builder.usingPort(port);
208208

209209
assertThatExceptionOfType(NumberFormatException.class)
210-
.isThrownBy(builder::build)
211-
.withMessage("Couldn't format the port numbers because the System Language is arabic: \"" + String.format("--port=%d", port) +
212-
"\", please make sure to add the required arguments \"-Duser.language=en -Duser.region=US\" to your JVM, for more info please visit :" + "\n https://www.selenium.dev/documentation/webdriver/browsers/");
210+
.isThrownBy(builder::build)
211+
.withMessage(
212+
"Couldn't format the port numbers because the System Language is arabic: \""
213+
+ String.format("--port=%d", port)
214+
+ "\", please make sure to add the required arguments \"-Duser.language=en"
215+
+ " -Duser.region=US\" to your JVM, for more info please visit :\n"
216+
+ " https://www.selenium.dev/documentation/webdriver/browsers/");
213217

214218
Locale.setDefault(Locale.US);
215219
}

java/test/org/openqa/selenium/firefox/FirefoxDriverTest.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
package org.openqa.selenium.firefox;
1919

2020
import static org.assertj.core.api.Assertions.assertThat;
21-
import static org.assertj.core.api.AssertionsForClassTypes.assertThatThrownBy;
2221
import static org.assertj.core.api.AssertionsForClassTypes.assertThatExceptionOfType;
22+
import static org.assertj.core.api.AssertionsForClassTypes.assertThatThrownBy;
2323
import static org.junit.jupiter.api.Assertions.fail;
2424
import static org.junit.jupiter.api.Assumptions.assumeTrue;
2525
import static org.mockito.Mockito.atLeastOnce;
@@ -283,9 +283,13 @@ void shouldThrowNumberFormatException() {
283283

284284
assertThatExceptionOfType(NumberFormatException.class)
285285
.isThrownBy(builder::build)
286-
.withMessage("Couldn't format the port numbers because the System Language is arabic: \"" + String.format("--port=%d", port) +
287-
"\", please make sure to add the required arguments \"-Duser.language=en -Duser.region=US\" to your JVM, for more info please visit :" + "\n https://www.selenium.dev/documentation/webdriver/browsers/");
288-
286+
.withMessage(
287+
"Couldn't format the port numbers because the System Language is arabic: \""
288+
+ String.format("--port=%d", port)
289+
+ "\", please make sure to add the required arguments \"-Duser.language=en"
290+
+ " -Duser.region=US\" to your JVM, for more info please visit :\n"
291+
+ " https://www.selenium.dev/documentation/webdriver/browsers/");
292+
289293
Locale.setDefault(Locale.US);
290294
}
291295

java/test/org/openqa/selenium/ie/InternetExplorerDriverTest.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
import java.awt.*;
2626
import java.time.Duration;
2727
import java.util.Locale;
28-
2928
import org.junit.jupiter.api.Test;
3029
import org.openqa.selenium.By;
3130
import org.openqa.selenium.Capabilities;
@@ -157,9 +156,13 @@ void shouldThrowNumberFormatException() {
157156
builder.usingPort(port);
158157

159158
assertThatExceptionOfType(NumberFormatException.class)
160-
.isThrownBy(builder::build)
161-
.withMessage("Couldn't format the port numbers because the System Language is arabic: \"" + String.format("--port=%d", port) +
162-
"\", please make sure to add the required arguments \"-Duser.language=en -Duser.region=US\" to your JVM, for more info please visit :" + "\n https://www.selenium.dev/documentation/webdriver/browsers/");
159+
.isThrownBy(builder::build)
160+
.withMessage(
161+
"Couldn't format the port numbers because the System Language is arabic: \""
162+
+ String.format("--port=%d", port)
163+
+ "\", please make sure to add the required arguments \"-Duser.language=en"
164+
+ " -Duser.region=US\" to your JVM, for more info please visit :\n"
165+
+ " https://www.selenium.dev/documentation/webdriver/browsers/");
163166

164167
Locale.setDefault(Locale.US);
165168
}

java/test/org/openqa/selenium/safari/SafariDriverTest.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
import java.nio.file.Paths;
2929
import java.time.Duration;
3030
import java.util.Locale;
31-
3231
import org.junit.jupiter.api.Test;
3332
import org.openqa.selenium.Capabilities;
3433
import org.openqa.selenium.SessionNotCreatedException;
@@ -147,9 +146,13 @@ void shouldThrowNumberFormatException() {
147146
builder.usingPort(port);
148147

149148
assertThatExceptionOfType(NumberFormatException.class)
150-
.isThrownBy(builder::build)
151-
.withMessage("Couldn't format the port numbers because the System Language is arabic: \"" + String.format("--port=%d", port) +
152-
"\", please make sure to add the required arguments \"-Duser.language=en -Duser.region=US\" to your JVM, for more info please visit :" + "\n https://www.selenium.dev/documentation/webdriver/browsers/");
149+
.isThrownBy(builder::build)
150+
.withMessage(
151+
"Couldn't format the port numbers because the System Language is arabic: \""
152+
+ String.format("--port=%d", port)
153+
+ "\", please make sure to add the required arguments \"-Duser.language=en"
154+
+ " -Duser.region=US\" to your JVM, for more info please visit :\n"
155+
+ " https://www.selenium.dev/documentation/webdriver/browsers/");
153156

154157
Locale.setDefault(Locale.US);
155158
}

0 commit comments

Comments
 (0)