1) Implement test execution resource class (extends TestExecResource)
public boolean init(TestExecContext testExecContext) throws Exception
public boolean isFree()
public boolean isFree(TestExecContext testExecContext)
public boolean match(String match)
public boolean matchRequirements(String properties)
public boolean isFree(TestExecContext testExecContext, String properties)
public boolean isFree(String properties)
2) Implement resource pool factory (implements ResourcePoolFactory)
method getResourceClass() should just return defined class, meaning current factory is producing only this kind of instances.)
method load receives string with lexical description of resources to be instantiated and added to resource pool for further use in test.
method getLoadCmdHelp() should return String with description of how to write argument for load(String cmd) method.
public interface ResourcePoolFactory {
public ArrayList load(String cmd);
public String getLoadCmdHelp();
public Class getResourceClass();
}
3) Add resource pool to project
ResoucePool tag is defining project's resource pool object.
Put classname to factoryclass and list of commands You wish to instantiate the pool by the factory (method load).
projects.xml
< project>
< adapterclass >...< /adapterclass >
< config > ... < /config >
< ResourcePool >
< !-- set factory class, it should be implementing ITestExecResourceFactory interface -- >
< factoryclass >org.kkonoplev.bali.selenium.browser.BrowserFactory< /factoryclass >
< loadcmd >3,,false,firefox< /loadcmd >
< loadcmd >2,,false,chrome< /loadcmd >
< /ResourcePool >
< /project >