Package com.lmax.ant.paralleljunit.util.process

Examples of com.lmax.ant.paralleljunit.util.process.DelegatingProcessBuilder


    public Process createForkedProcess(final int workerId, final ParallelJUnitTaskConfig config, final int serverPort)
    {
        final List<String> jvmCommand = config.getCommand(RemoteTestRunner.class, workerId, serverPort);

        final DelegatingProcessBuilder processBuilder = processBuilderFactory.createProcessBuilder(jvmCommand);

        final File workingDirectory = config.getDirectory(workerId);
        if (workingDirectory != null)
        {
            if (!workingDirectory.mkdirs() && !workingDirectory.isDirectory())
            {
                throw new BuildException("Failed to create worker directory: " + workingDirectory.getPath());
            }
            processBuilder.directory(workingDirectory);
        }

        final Map<String, String> environment = processBuilder.environment();

        if (config.isNewEnvironment())
        {
            environment.clear();
        }

        environment.putAll(config.getEnvironment());

        try
        {
            return processBuilder.start();
        }
        catch (final IOException e)
        {
            throw new BuildException("Error starting forked process.", e);
        }
View Full Code Here

TOP

Related Classes of com.lmax.ant.paralleljunit.util.process.DelegatingProcessBuilder

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.