01: package org.testng.remote.adapter;
02:
03: import java.io.IOException;
04: import java.util.Properties;
05:
06: import org.testng.ISuite;
07: import org.testng.xml.XmlSuite;
08:
09: /**
10: * This interface should be implemented by the Master-Slave transport adapter.
11: * This interface is used by the Slave to pull suites and return results.
12: *
13: * @author Guy Korland
14: * @date April 9, 2007
15: * @see IMasterAdapter
16: */
17: public interface IWorkerApadter {
18: /**
19: * Initializes the worker adapter.
20: * @param properties holds the properties loaded from the remote.properties file.
21: * @throws Exception adapter might throw any exception on initialization, which will abort this adapter.
22: */
23: void init(Properties properties) throws Exception;
24:
25: /**
26: * A blocking call to get the next Suite to test.
27: * @param timeout the maximum time to wait for the next suite.
28: * @return the next suite avaliable or <code>null</code> if the timeout has reached.
29: * @throws IOException might be thrown on IO error.
30: * @throws InterruptedException if interrupted while waiting.
31: */
32: XmlSuite getSuite(long timeout) throws InterruptedException,
33: IOException;
34:
35: /**
36: * Return a suite result.
37: * @param result the result to return
38: * @throws IOException might be thrown on IO error.
39: */
40: void returnResult(ISuite result) throws IOException;
41: }
|