Package hudson.util

Examples of hudson.util.JVMBuilder


     *
     * @param rootDir
     *            The slave/master root.
     */
    public static Channel createSeleniumGridVM(TaskListener listener) throws IOException, InterruptedException {
        JVMBuilder vmb = new JVMBuilder();
        vmb.systemProperties(null);
        return Channels.newJVM("Selenium Grid", listener, vmb, new FilePath(Hudson.getInstance().getRootDir()),
                new ClasspathBuilder().add(findStandAloneServerJar()));
    }
View Full Code Here


            Map<String, String> envVariables) throws IOException, InterruptedException {

        String displayName = "Selenium RC";

        ClasspathBuilder classpath = new ClasspathBuilder().add(standaloneServerJar);
        JVMBuilder vmb = new JVMBuilder();
        vmb.systemProperties(properties);

        ServerSocket serverSocket = new ServerSocket();
        serverSocket.bind(new InetSocketAddress("localhost", 0));
        serverSocket.setSoTimeout(10000);

        // use -cp + FQCN instead of -jar since remoting.jar can be rebundled
        // (like in the case of the swarm plugin.)
        vmb.classpath().addJarOf(Channel.class);
        vmb.mainClass(Launcher.class);

        if (classpath != null)
            vmb.args().add("-cp").add(classpath);
        vmb.args().add("-connectTo", "localhost:" + serverSocket.getLocalPort());

        // TODO add XVFB options here
        Proc p = vmb.launch(new LocalLauncher(listener)).stdout(listener).envs(envVariables).start();

        Socket s = serverSocket.accept();
        serverSocket.close();

        return Channels.forProcess("Channel to " + displayName, Computer.threadPoolForRemoting, new BufferedInputStream(new SocketInputStream(s)),
View Full Code Here

     * @return
     *      never null
     * @since 1.300
     */
    public static Channel newJVM(String displayName, TaskListener listener, FilePath workDir, ClasspathBuilder classpath, Map<String,String> systemProperties) throws IOException {
        JVMBuilder vmb = new JVMBuilder();
        vmb.systemProperties(systemProperties);

        return newJVM(displayName,listener,vmb,workDir,classpath);
    }
View Full Code Here

TOP

Related Classes of hudson.util.JVMBuilder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.