File tree Expand file tree Collapse file tree 7 files changed +29
-17
lines changed
java/server/src/org/openqa/selenium Expand file tree Collapse file tree 7 files changed +29
-17
lines changed Original file line number Diff line number Diff line change @@ -160,9 +160,9 @@ public boolean equals(Object o) {
160
160
161
161
Reference that = (Reference ) o ;
162
162
return this .domain .equals (that .domain ) &&
163
- this .name .equals (that .name ) &&
164
- Objects .equals (tag , that .tag ) &&
165
- Objects .equals (digest , that .digest );
163
+ this .name .equals (that .name ) &&
164
+ Objects .equals (tag , that .tag ) &&
165
+ Objects .equals (digest , that .digest );
166
166
}
167
167
168
168
@ Override
Original file line number Diff line number Diff line change 30
30
31
31
public class DistributorOptions {
32
32
33
+ public static final int DEFAULT_HEALTHCHECK_INTERVAL = 300 ;
33
34
static final String DISTRIBUTOR_SECTION = "distributor" ;
34
35
static final String DEFAULT_DISTRIBUTOR_IMPLEMENTATION =
35
36
"org.openqa.selenium.grid.distributor.local.LocalDistributor" ;
36
37
static final String DEFAULT_SLOT_MATCHER = "org.openqa.selenium.grid.data.DefaultSlotMatcher" ;
37
38
static final String DEFAULT_SLOT_SELECTOR_IMPLEMENTATION =
38
39
"org.openqa.selenium.grid.distributor.selector.DefaultSlotSelector" ;
39
40
static final boolean DEFAULT_REJECT_UNSUPPORTED_CAPS = false ;
40
-
41
- public static final int DEFAULT_HEALTHCHECK_INTERVAL = 300 ;
42
-
43
41
private final Config config ;
44
42
45
43
public DistributorOptions (Config config ) {
@@ -49,7 +47,11 @@ public DistributorOptions(Config config) {
49
47
public URI getDistributorUri () {
50
48
Optional <URI > host = config .get (DISTRIBUTOR_SECTION , "host" ).map (str -> {
51
49
try {
52
- return new URI (str );
50
+ URI distributorUri = new URI (str );
51
+ if (distributorUri .getHost () == null || distributorUri .getPort () == -1 ) {
52
+ throw new ConfigException ("Undefined host or port in Distributor server URI: " + str );
53
+ }
54
+ return distributorUri ;
53
55
} catch (URISyntaxException e ) {
54
56
throw new ConfigException ("Distributor URI is not a valid URI: " + str );
55
57
}
Original file line number Diff line number Diff line change 21
21
import com .google .common .collect .ImmutableMap ;
22
22
import com .google .common .collect .ImmutableSet ;
23
23
import com .google .common .net .MediaType ;
24
+
24
25
import org .openqa .selenium .BuildInfo ;
25
26
import org .openqa .selenium .cli .CliCommand ;
26
27
import org .openqa .selenium .grid .TemplateGridServerCommand ;
@@ -119,7 +120,7 @@ protected void execute(Config config) {
119
120
120
121
BuildInfo info = new BuildInfo ();
121
122
LOG .info (String .format (
122
- "Started Selenium distributor %s (revision %s): %s" ,
123
+ "Started Selenium Distributor %s (revision %s): %s" ,
123
124
info .getReleaseLabel (),
124
125
info .getBuildRevision (),
125
126
server .getUrl ()));
Original file line number Diff line number Diff line change @@ -45,9 +45,13 @@ public URI getSessionMapUri() {
45
45
46
46
Optional <URI > host = config .get (SESSIONS_SECTION , "host" ).map (str -> {
47
47
try {
48
- return new URI (str );
48
+ URI sessionUri = new URI (str );
49
+ if (sessionUri .getHost () == null || sessionUri .getPort () == -1 ) {
50
+ throw new ConfigException ("Undefined host or port in SessionMap server URI: " + str );
51
+ }
52
+ return sessionUri ;
49
53
} catch (URISyntaxException e ) {
50
- throw new ConfigException ("Session map server URI is not a valid URI: " + str );
54
+ throw new ConfigException ("Session Map server URI is not a valid URI: " + str );
51
55
}
52
56
});
53
57
Original file line number Diff line number Diff line change 20
20
import com .google .auto .service .AutoService ;
21
21
import com .google .common .collect .ImmutableMap ;
22
22
import com .google .common .collect .ImmutableSet ;
23
+
23
24
import org .openqa .selenium .BuildInfo ;
24
25
import org .openqa .selenium .cli .CliCommand ;
25
26
import org .openqa .selenium .grid .TemplateGridServerCommand ;
26
27
import org .openqa .selenium .grid .config .Config ;
27
28
import org .openqa .selenium .grid .config .Role ;
28
- import org .openqa .selenium .grid .server .BaseServerOptions ;
29
29
import org .openqa .selenium .grid .server .Server ;
30
30
import org .openqa .selenium .grid .sessionmap .SessionMap ;
31
31
import org .openqa .selenium .grid .sessionmap .config .SessionMapOptions ;
@@ -108,7 +108,7 @@ protected void execute(Config config) {
108
108
109
109
BuildInfo info = new BuildInfo ();
110
110
LOG .info (String .format (
111
- "Started Selenium session map %s (revision %s): %s" ,
111
+ "Started Selenium SessionMap %s (revision %s): %s" ,
112
112
info .getReleaseLabel (),
113
113
info .getBuildRevision (),
114
114
server .getUrl ()));
Original file line number Diff line number Diff line change @@ -39,7 +39,11 @@ public URI getSessionQueueUri() {
39
39
40
40
Optional <URI > host = config .get (SESSION_QUEUE_SECTION , "host" ).map (str -> {
41
41
try {
42
- return new URI (str );
42
+ URI sessionQueueUri = new URI (str );
43
+ if (sessionQueueUri .getHost () == null || sessionQueueUri .getPort () == -1 ) {
44
+ throw new ConfigException ("Undefined host or port in SessionQueue server URI: " + str );
45
+ }
46
+ return sessionQueueUri ;
43
47
} catch (URISyntaxException e ) {
44
48
throw new ConfigException ("Session queue server URI is not a valid URI: " + str );
45
49
}
Original file line number Diff line number Diff line change 20
20
import com .google .auto .service .AutoService ;
21
21
import com .google .common .collect .ImmutableMap ;
22
22
import com .google .common .collect .ImmutableSet ;
23
+
23
24
import org .openqa .selenium .BuildInfo ;
24
25
import org .openqa .selenium .cli .CliCommand ;
25
26
import org .openqa .selenium .grid .TemplateGridServerCommand ;
@@ -110,9 +111,9 @@ protected void execute(Config config) {
110
111
111
112
BuildInfo info = new BuildInfo ();
112
113
LOG .info (String .format (
113
- "Started Selenium New Session Queue %s (revision %s): %s" ,
114
- info .getReleaseLabel (),
115
- info .getBuildRevision (),
116
- server .getUrl ()));
114
+ "Started Selenium SessionQueue %s (revision %s): %s" ,
115
+ info .getReleaseLabel (),
116
+ info .getBuildRevision (),
117
+ server .getUrl ()));
117
118
}
118
119
}
You can’t perform that action at this time.
0 commit comments