Examples of HostFile


Examples of org.testng.internal.HostFile

  }

  @SuppressWarnings({"unchecked"})
  private List<ISuite> runSuitesRemotely() {
    List<ISuite> result = new ArrayList<ISuite>();
    HostFile hostFile = new HostFile(m_hostFile);
   
    //
    // Create one socket per host found
    //
    String[] hosts = hostFile.getHosts();
    Socket[] sockets = new Socket[hosts.length];
    for (int i = 0; i < hosts.length; i++) {
      String host = hosts[i];
      String[] s = host.split(":");
      try {
        sockets[i] = new Socket(s[0], Integer.parseInt(s[1]));
      }
      catch (NumberFormatException e) {
        e.printStackTrace(System.out);
      }
      catch (UnknownHostException e) {
        e.printStackTrace(System.out);
      }
      catch (IOException e) {
        Utils.error("Couldn't connect to " + host + ": " + e.getMessage());
      }
    }
   
    //
    // Add these hosts to the pool
    //
    try {
      m_slavePool.addSlaves(sockets);
    }
    catch (IOException e1) {
      e1.printStackTrace(System.out);
    }

    //
    // Dispatch the suites/tests to each host
    //
    List<Runnable> workers = new ArrayList<Runnable>();
    //
    // Send one XmlTest at a time to remote hosts
    //
    if (hostFile.isStrategyTest()) {
      for (XmlSuite suite : m_suites) {
        suite.setVerbose(hostFile.getVerbose());
        SuiteRunner suiteRunner =
          new SuiteRunner(suite, m_outputDir, new IAnnotationFinder[] {m_javadocAnnotationFinder, m_jdkAnnotationFinder});
        for (XmlTest test : suite.getTests()) {
          XmlSuite tmpSuite = new XmlSuite();
          tmpSuite.setXmlPackages(suite.getXmlPackages());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.