01: package org.testng.remote;
02:
03: import java.util.List;
04:
05: import org.testng.ISuite;
06: import org.testng.SuiteRunner;
07: import org.testng.internal.remote.SlavePool;
08: import org.testng.remote.adapter.RemoteResultListener;
09: import org.testng.xml.XmlSuite;
10:
11: /**
12: * A worker that will be put into an Executor and that sends a suite
13: * This class
14: *
15: * @author cbeust
16: */
17: public class RemoteSuiteWorker extends RemoteWorker implements Runnable {
18: private XmlSuite m_suite;
19:
20: public RemoteSuiteWorker(XmlSuite suite, SlavePool slavePool,
21: RemoteResultListener listener) {
22: super (listener, slavePool);
23: m_suite = suite;
24: }
25:
26: public void run() {
27: try {
28: SuiteRunner result = sendSuite(getSlavePool().getSlave(),
29: m_suite);
30: m_listener.onResult(result);
31: } catch (Exception e) {
32: e.printStackTrace();
33: }
34:
35: }
36: }
|