1 package org.testng; 2 3 4 import java.util.Collection; 5 import java.util.List; 6 import java.util.Map; 7 8 import org.testng.internal.annotations.IAnnotationFinder; 9 import org.testng.xml.XmlSuite; 10 11 import com.google.inject.Injector; 12 13 /** 14 * Interface defining a Test Suite. 15 * 16 * @author Cedric Beust, Aug 6, 2004 17 * 18 */ 19 public interface ISuite extends IAttributes { 20 21 /** 22 * @return the name of this suite. 23 */ getName()24 public String getName(); 25 26 /** 27 * @return The results for this suite. 28 */ getResults()29 public Map<String, ISuiteResult> getResults(); 30 31 /** 32 * @return The object factory used to create all test instances. 33 */ getObjectFactory()34 public IObjectFactory getObjectFactory(); getObjectFactory2()35 public IObjectFactory2 getObjectFactory2(); 36 37 /** 38 * @return The output directory used for the reports. 39 */ getOutputDirectory()40 public String getOutputDirectory(); 41 42 /** 43 * @return true if the tests must be run in parallel. 44 */ getParallel()45 public String getParallel(); 46 getParentModule()47 public String getParentModule(); 48 getGuiceStage()49 public String getGuiceStage(); 50 51 /** 52 * @return The value of this parameter, or null if none was specified. 53 */ getParameter(String parameterName)54 public String getParameter(String parameterName); 55 56 /** 57 * Retrieves the map of groups and their associated test methods. 58 * 59 * @return A map where the key is the group and the value is a list 60 * of methods used by this group. 61 */ getMethodsByGroups()62 public Map<String, Collection<ITestNGMethod>> getMethodsByGroups(); 63 64 /** 65 * Retrieves the list of all the methods that were invoked during this run. 66 * @return a collection of ITestNGMethods belonging to all tests included in the suite. 67 * @deprecated Use getAllInvokedMethods(). 68 */ 69 @Deprecated getInvokedMethods()70 public Collection<ITestNGMethod> getInvokedMethods(); 71 72 /** 73 * @return a list of all the methods that were invoked in this suite. 74 */ getAllInvokedMethods()75 public List<IInvokedMethod> getAllInvokedMethods(); 76 77 /** 78 * @return All the methods that were not included in this test run. 79 */ getExcludedMethods()80 public Collection<ITestNGMethod> getExcludedMethods(); 81 82 /** 83 * Triggers the start of running tests included in the suite. 84 */ run()85 public void run(); 86 87 /** 88 * @return The host where this suite was run, or null if it was run locally. The 89 * returned string has the form: host:port 90 */ getHost()91 public String getHost(); 92 93 /** 94 * Retrieves the shared state for a suite. 95 * 96 * @return the share state of the current suite. 97 */ getSuiteState()98 public SuiteRunState getSuiteState(); 99 100 /** 101 * @return the annotation finder used for the specified type (JDK5 or javadoc) 102 */ getAnnotationFinder()103 public IAnnotationFinder getAnnotationFinder(); 104 105 /** 106 * @return The representation of the current XML suite file. 107 */ getXmlSuite()108 public XmlSuite getXmlSuite(); 109 addListener(ITestNGListener listener)110 public void addListener(ITestNGListener listener); 111 getParentInjector()112 public Injector getParentInjector(); 113 setParentInjector(Injector injector)114 public void setParentInjector(Injector injector); 115 116 /** 117 * @return the total number of methods found in this suite. The presence of 118 * factories or data providers might cause the actual number of test methods 119 * run be bigger than this list. 120 */ getAllMethods()121 List<ITestNGMethod> getAllMethods(); 122 } 123