Package org.zkoss.zats.mimic
Class DefaultZatsEnvironment
- java.lang.Object
-
- org.zkoss.zats.mimic.DefaultZatsEnvironment
-
- All Implemented Interfaces:
ZatsEnvironment
public class DefaultZatsEnvironment extends Object implements ZatsEnvironment
A default implementation ofZatsEnvironment- Author:
- Hawk, Dennis
-
-
Constructor Summary
Constructors Constructor Description DefaultZatsEnvironment()Create a zats context, it uses built-in config file(web.xml, zk.xml) to init the context quickly and safely.DefaultZatsEnvironment(String webInfPathOrUrl)Create a zats Environment.DefaultZatsEnvironment(String webInfPathOrUrl, String contextPath)Create a zats Environment.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcleanup()close all clients and release resources.voiddestroy()destroy this environment to release the resource.voidinit(String resourceRoot)initialize testing environmentClientnewClient()create a client.
-
-
-
Constructor Detail
-
DefaultZatsEnvironment
public DefaultZatsEnvironment()
Create a zats context, it uses built-in config file(web.xml, zk.xml) to init the context quickly and safely.
-
DefaultZatsEnvironment
public DefaultZatsEnvironment(String webInfPathOrUrl)
Create a zats Environment.
The webInfPathOrUrl is the folder of the WEB-INF to start the zats environment.- Parameters:
webInfPathOrUrl- the folder of WEB-INF, a null value means use built-in WEB-INF folder.
-
DefaultZatsEnvironment
public DefaultZatsEnvironment(String webInfPathOrUrl, String contextPath)
Create a zats Environment.
The webInfPathOrUrl is the folder of the WEB-INF to start the zats environment, for example "./src/test/resources/web/WEB-INF".
The contextPath is the path of the application context, for example "/" or "/myapp".- Parameters:
webInfPathOrUrl- the folder of WEB-INF, a null value means suing built-in WEB-INF folder.contextPath- the name of the application, a null value means using "/"
-
-
Method Detail
-
init
public void init(String resourceRoot)
Description copied from interface:ZatsEnvironmentinitialize testing environment- Specified by:
initin interfaceZatsEnvironment- Parameters:
resourceRoot- the resource root folder of the zul, it is usually the web content folder.
-
destroy
public void destroy()
Description copied from interface:ZatsEnvironmentdestroy this environment to release the resource.- Specified by:
destroyin interfaceZatsEnvironment
-
newClient
public Client newClient()
create a client.- Specified by:
newClientin interfaceZatsEnvironment- Returns:
- a new client
-
cleanup
public void cleanup()
close all clients and release resources.- Specified by:
cleanupin interfaceZatsEnvironment
-
-