File tree 2 files changed +20
-4
lines changed
java/server/src/org/openqa/grid
2 files changed +20
-4
lines changed Original file line number Diff line number Diff line change @@ -64,9 +64,10 @@ public static GridRole find(String[] args) {
64
64
return NODE ;
65
65
} else if ("hub" .equals (role )) {
66
66
return HUB ;
67
+ } else if ("standalone" .equals (role )) {
68
+ return NOT_GRID ;
67
69
} else {
68
- throw new GridConfigurationException ("The role specified :" + role
69
- + " doesn't match a recognized role for grid." );
70
+ return null ;
70
71
}
71
72
}
72
73
}
Original file line number Diff line number Diff line change @@ -45,6 +45,23 @@ public class GridLauncher {
45
45
public static void main (String [] args ) throws Exception {
46
46
47
47
CommandLineOptionHelper helper = new CommandLineOptionHelper (args );
48
+ GridRole role = GridRole .find (args );
49
+
50
+ if (role == null ) {
51
+ System .out .println (
52
+ "\n " +
53
+ "The role '" + helper .getParamValue ("-role" ) + "' does not match a recognized role for Selenium server\n " +
54
+ "\n " +
55
+ "Selenium server can run in one of the following roles:\n " +
56
+ " hub as a hub of a Selenium grid\n " +
57
+ " node as a node of a Selenium grid\n " +
58
+ " standalone as a standalone server not being a part of a grid\n " +
59
+ "\n " +
60
+ "If -role option is not specified the server runs standalone" +
61
+ "\n " );
62
+ return ;
63
+ }
64
+
48
65
if (helper .isParamPresent ("-help" ) || helper .isParamPresent ("-h" )){
49
66
String separator = "\n ----------------------------------\n " ;
50
67
RemoteControlLauncher .usage (separator +"To use as a standalone server" +separator );
@@ -54,8 +71,6 @@ public static void main(String[] args) throws Exception {
54
71
55
72
configureLogging (helper );
56
73
57
- GridRole role = GridRole .find (args );
58
-
59
74
switch (role ) {
60
75
case NOT_GRID :
61
76
log .info ("Launching a standalone Selenium Server" );
You can’t perform that action at this time.
0 commit comments