Skip to content

Commit

Permalink
recording a debugger support so that I can resurrect it later
Browse files Browse the repository at this point in the history
  • Loading branch information
kohsuke committed Jun 5, 2010
1 parent 45ceeac commit 7d2bb37
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src/main/java/hudson/plugins/selenium/PluginImpl.java
Expand Up @@ -30,6 +30,7 @@
import hudson.remoting.Channel;
import hudson.slaves.Channels;
import hudson.util.ClasspathBuilder;
import hudson.util.JVMBuilder;
import hudson.util.StreamTaskListener;
import net.sf.json.JSONObject;
import org.kohsuke.stapler.StaplerRequest;
Expand Down Expand Up @@ -198,9 +199,10 @@ public List<SeleniumRemoteControl> call() throws RuntimeException {
*/
static /*package*/ Channel createSeleniumGridVM(File rootDir, TaskListener listener) throws IOException, InterruptedException {
FilePath distDir = install(rootDir, listener);
return Channels.newJVM("Selenium Grid",listener,distDir,
new ClasspathBuilder().addAll(distDir,"lib/selenium-grid-hub-standalone-*.jar, lib/log4j-*.jar"),
null);
JVMBuilder vmb = new JVMBuilder();
if (DEBUG) vmb.debug(8001);
return Channels.newJVM("Selenium Grid",listener,vmb, distDir,
new ClasspathBuilder().addAll(distDir,"lib/selenium-grid-hub-standalone-*.jar, lib/log4j-*.jar"));
}

/**
Expand All @@ -211,10 +213,11 @@ public List<SeleniumRemoteControl> call() throws RuntimeException {
*/
static /*package*/ Channel createSeleniumRCVM(File rootDir, TaskListener listener) throws IOException, InterruptedException {
FilePath distDir = install(rootDir, listener);
return Channels.newJVM("Selenium RC",listener,distDir,
JVMBuilder vmb = new JVMBuilder();
if (DEBUG) vmb.debug(DEBUG_PORT++);
return Channels.newJVM("Selenium RC",listener,vmb,distDir,
new ClasspathBuilder()
.addAll(distDir,"vendor/selenium-server-*.jar, lib/selenium-grid-remote-control-*.jar, lib/commons-httpclient-*.jar"),
null);
.addAll(distDir,"vendor/selenium-server-*.jar, lib/selenium-grid-remote-control-*.jar, lib/commons-httpclient-*.jar"));
}

private static FilePath install(File rootDir, TaskListener listener) throws IOException, InterruptedException {
Expand Down Expand Up @@ -242,4 +245,6 @@ public void doProgressiveLog( StaplerRequest req, StaplerResponse rsp) throws IO
}

private static final long serialVersionUID = 1L;
public static boolean DEBUG = Boolean.getBoolean("selenium.debug");
public static int DEBUG_PORT = 8010;
}

0 comments on commit 7d2bb37

Please sign in to comment.