01: package org.testng.remote.adapter;
02:
03: import java.io.IOException;
04: import java.util.Properties;
05:
06: import org.testng.xml.XmlSuite;
07:
08: /**
09: * This interface should be implemented by the Master-Slave transport adapter.
10: * This interface is used by the Master to push suites and get results.
11: *
12: * @author Guy Korland
13: * @date April 9, 2007
14: * @see IWorkerApadter
15: */
16: public interface IMasterAdapter {
17: /**
18: * Initializes the Master adapter.
19: * @param properties holds the properties loaded from the remote.properties file.
20: * @throws Exception adapter might throw any exception on initialization, which will abort this adapter.
21: */
22: void init(Properties prop) throws Exception;
23:
24: /**
25: * Run a suite remotely.
26: * @param suite the suite to send.
27: * @param listener the corresponded listener, should be called when result is ready.
28: * @throws IOException might be thrown on IO error.
29: */
30: void runSuitesRemotely(XmlSuite suite, RemoteResultListener listener)
31: throws IOException;
32:
33: /**
34: * A blocking wait for the remote results to return.
35: *
36: * @param timeout the maximum time to wait for all the suites to return a result.
37: * @throws InterruptedException
38: */
39: public void awaitTermination(long timeout)
40: throws InterruptedException;
41: }
|