1 package org.testng.remote.adapter; 2 3 import java.io.IOException; 4 import java.util.Properties; 5 6 import org.testng.xml.XmlSuite; 7 8 /** 9 * 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 * @since April 9, 2007 14 * @see IWorkerAdapter 15 */ 16 public interface IMasterAdapter 17 { 18 /** 19 * Initializes the Master adapter. 20 * @param prop 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 */ init( Properties prop)23 void init( Properties prop) throws Exception; 24 25 /** 26 * Run a suite remotely. 27 * @param suite the suite to send. 28 * @param listener the corresponded listener, should be called when result is ready. 29 * @throws IOException might be thrown on IO error. 30 */ runSuitesRemotely( XmlSuite suite, RemoteResultListener listener)31 void runSuitesRemotely( XmlSuite suite, RemoteResultListener listener) 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 */ awaitTermination(long timeout)39 public void awaitTermination(long timeout) throws InterruptedException; 40 }