All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.easyb.plugin.remoting.RemoteRunner Maven / Gradle / Ivy

The newest version!
package org.easyb.plugin.remoting;

import java.io.IOException;
import java.util.ArrayList;
import static java.util.Arrays.asList;
import java.util.List;
import java.util.Collections;

import org.easyb.BehaviorRunner;
import org.easyb.Configuration;
import org.easyb.ConsoleReporter;
import org.easyb.report.ReportWriter;

public class RemoteRunner extends BehaviorRunner {
    public RemoteRunner(int port) throws IOException {
        super(new Configuration(), new ConsoleReporter(), new ExecutionListenerProxy(port));
    }

    public static void main(String[] args) {
        System.out.println("Remote runner");
        int port = Integer.parseInt(args[0]);
        System.out.println("Port: " + port);

        try {
            BehaviorRunner runner = new RemoteRunner(port);
            runner.runBehaviors(getBehaviors(stripFirst(args)));
        } catch (Exception e) {
            e.printStackTrace(System.err);
        }
    }

    private static String[] stripFirst(String[] args) {
        List argList = new ArrayList(asList(args));
        argList.remove(0);
        return argList.toArray(new String[args.length - 1]);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy