Package org.testng.remote.strprotocol

Examples of org.testng.remote.strprotocol.StringMessageSenderHelper$ReaderThread


    setConnectionParameters((String) cmdLineArgs.get(TestNGCommandLineArgs.HOST_COMMAND_OPT),
                            Integer.parseInt((String) cmdLineArgs.get(TestNGCommandLineArgs.PORT_COMMAND_OPT)));
  }

  public void run() {
    final StringMessageSenderHelper msh= new StringMessageSenderHelper(m_host, m_port);
    try {
      if(msh.connect()) {
        if(m_suites.size() > 0) {

          int testCount= 0;

          for(int i= 0; i < m_suites.size(); i++) {
            testCount+= ((XmlSuite) m_suites.get(i)).getTests().size();
          }

          GenericMessage gm= new GenericMessage(MessageHelper.GENERIC_SUITE_COUNT);
          gm.addProperty("suiteCount", m_suites.size()).addProperty("testCount", testCount);
          msh.sendMessage(gm);

          addListener(new RemoteSuiteListener(msh));
          setTestRunnerFactory(new DelegatingTestRunnerFactory(buildTestRunnerFactory(), msh));

          super.run();
        }
        else {
          System.err.println("WARNING: No test suite found.  Nothing to run");
        }
      }
      else {
        System.err.println("Cannot connect to " + m_host + " on " + m_port);
      }
    }
    catch(Throwable cause) {
      cause.printStackTrace(System.err);
    }
    finally {
      msh.shutDown();
      System.exit(0);
    }
  }
View Full Code Here


    setConnectionParameters((String) cmdLineArgs.get(TestNGCommandLineArgs.HOST_COMMAND_OPT),
                            Integer.parseInt((String) cmdLineArgs.get(TestNGCommandLineArgs.PORT_COMMAND_OPT)));
  }

  public void run() {
    final StringMessageSenderHelper msh= new StringMessageSenderHelper(m_host, m_port);
    try {
      if(msh.connect()) {
        if(m_suites.size() > 0) {

          int testCount= 0;

          for(int i= 0; i < m_suites.size(); i++) {
            testCount+= ((XmlSuite) m_suites.get(i)).getTests().size();
          }

          GenericMessage gm= new GenericMessage(MessageHelper.GENERIC_SUITE_COUNT);
          gm.addProperty("suiteCount", m_suites.size()).addProperty("testCount", testCount);
          msh.sendMessage(gm);

          addListener(new RemoteSuiteListener(msh));
          setTestRunnerFactory(new DelegatingTestRunnerFactory(buildTestRunnerFactory(), msh));

          super.run();
        }
        else {
          System.err.println("WARNING: No test suite found.  Nothing to run");
        }
      }
      else {
        System.err.println("Cannot connect to " + m_host + " on " + m_port);
      }
    }
    catch(Throwable cause) {
      cause.printStackTrace(System.err);
    }
    finally {
      msh.shutDown();
      System.exit(0);
    }
  }
View Full Code Here

    setConnectionParameters((String) cmdLineArgs.get(TestNGCommandLineArgs.HOST_COMMAND_OPT),
                            Integer.parseInt((String) cmdLineArgs.get(TestNGCommandLineArgs.PORT_COMMAND_OPT)));
  }

  public void run() {
    final StringMessageSenderHelper msh= new StringMessageSenderHelper(m_host, m_port);
    try {
      if(msh.connect()) {
        if(m_suites.size() > 0) {

          int testCount= 0;

          for(int i= 0; i < m_suites.size(); i++) {
            testCount+= ((XmlSuite) m_suites.get(i)).getTests().size();
          }

          GenericMessage gm= new GenericMessage(MessageHelper.GENERIC_SUITE_COUNT);
          gm.addProperty("suiteCount", m_suites.size()).addProperty("testCount", testCount);
          msh.sendMessage(gm);

          addListener(new RemoteSuiteListener(msh));
          setTestRunnerFactory(new DelegatingTestRunnerFactory(buildTestRunnerFactory(), msh));

          super.run();
        }
        else {
          System.err.println("No test suite found.  Nothing to run");
        }
      }
      else {
        System.err.println("Cannot connect to " + m_host + " on " + m_port);
      }
    }
    catch(Throwable cause) {
      cause.printStackTrace(System.err);
    }
    finally {
      msh.shutDown();
      System.exit(0);
    }
  }
View Full Code Here

    }
  }

  @Override
  public void run() {
    final StringMessageSenderHelper msh= new StringMessageSenderHelper(m_host, m_port);
    try {
      if(msh.connect()) {
        List<XmlSuite> suites = Lists.newArrayList();
        calculateAllSuites(m_suites, suites);
        if(suites.size() > 0) {

          int testCount= 0;

          for(int i= 0; i < suites.size(); i++) {
            testCount+= (suites.get(i)).getTests().size();
          }

          GenericMessage gm= new GenericMessage(MessageHelper.GENERIC_SUITE_COUNT);
          gm.addProperty("suiteCount", suites.size()).addProperty("testCount", testCount);
          msh.sendMessage(gm);

          addListener(new RemoteSuiteListener(msh));
          setTestRunnerFactory(new DelegatingTestRunnerFactory(buildTestRunnerFactory(), msh));

          super.run();
        }
        else {
          System.err.println("No test suite found.  Nothing to run");
        }
      }
      else {
        System.err.println("Cannot connect to " + m_host + " on " + m_port);
      }
    }
    catch(Throwable cause) {
      cause.printStackTrace(System.err);
    }
    finally {
      msh.shutDown();
      System.exit(0);
    }
  }
View Full Code Here

    }
  }

  @Override
  public void run() {
    final StringMessageSenderHelper msh= new StringMessageSenderHelper(m_host, m_port);
    try {
      if(msh.connect()) {
        List<XmlSuite> suites = Lists.newArrayList();
        calculateAllSuites(m_suites, suites);
        if(suites.size() > 0) {

          int testCount= 0;

          for(int i= 0; i < suites.size(); i++) {
            testCount+= (suites.get(i)).getTests().size();
          }

          GenericMessage gm= new GenericMessage(MessageHelper.GENERIC_SUITE_COUNT);
          gm.addProperty("suiteCount", suites.size()).addProperty("testCount", testCount);
          msh.sendMessage(gm);

          addListener(new RemoteSuiteListener(msh));
          setTestRunnerFactory(new DelegatingTestRunnerFactory(buildTestRunnerFactory(), msh));

          super.run();
        }
        else {
          System.err.println("No test suite found.  Nothing to run");
        }
      }
      else {
        System.err.println("Cannot connect to " + m_host + " on " + m_port);
      }
    }
    catch(Throwable cause) {
      cause.printStackTrace(System.err);
    }
    finally {
      msh.shutDown();
      System.exit(0);
    }
  }
View Full Code Here

TOP

Related Classes of org.testng.remote.strprotocol.StringMessageSenderHelper$ReaderThread

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.