Skip to content

Commit

Permalink
Implementing ability to run a standalone debug server with RC test pages
Browse files Browse the repository at this point in the history
  • Loading branch information
barancev committed Dec 23, 2013
1 parent 80ccbb8 commit 9961dd1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -245,12 +245,12 @@ protected ServletContextHandler addResourceHandler(String contextPath, File reso
return context;
}

private static int getHttpPortFromEnv() {
protected static int getHttpPortFromEnv() {
String port = System.getenv(FIXED_HTTP_PORT_ENV_NAME);
return port == null ? DEFAULT_HTTP_PORT : Integer.parseInt(port);
}

private static int getHttpsPortFromEnv() {
protected static int getHttpsPortFromEnv() {
String port = System.getenv(FIXED_HTTPS_PORT_ENV_NAME);
return port == null ? DEFAULT_HTTPS_PORT : Integer.parseInt(port);
}
Expand Down
13 changes: 13 additions & 0 deletions java/client/test/org/openqa/selenium/v1/SeleniumAppServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,17 @@ protected String getMainContextPath(String relativeUrl) {
}
return relativeUrl;
}

public static void main(String[] args) {
Jetty7AppServer server = new SeleniumAppServer();

server.listenOn(getHttpPortFromEnv());
System.out.println(String.format("Starting server on port %d", getHttpPortFromEnv()));

server.listenSecurelyOn(getHttpsPortFromEnv());
System.out.println(String.format("HTTPS on %d", getHttpsPortFromEnv()));

server.start();
}

}

0 comments on commit 9961dd1

Please sign in to comment.